Changeset 619

Show
Ignore:
Timestamp:
09/08/08 17:53:43
Author:
rachel
Message:

Doxygen changes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • openpgpsdk/trunk/include/openpgpsdk/packet.h

    r616 r619  
    586586    } ops_signature_info_t; 
    587587 
    588 typedef struct 
    589     { 
    590     ops_signature_info_t        info; 
     588/** Struct used when parsing a signature */ 
     589typedef struct 
     590    { 
     591    ops_signature_info_t        info; /*!< The signature information */ 
    591592    /* The following fields are only used while parsing the signature */ 
    592593    unsigned char               hash2[2];       /*!< high 2 bytes of hashed value - for quick test */ 
  • openpgpsdk/trunk/include/openpgpsdk/util.h

    r616 r619  
    5050#define OPS_ARRAY_SIZE(a)       (sizeof(a)/sizeof(*(a))) 
    5151 
    52 /** Allocate zeroed memory */ 
    5352void *ops_mallocz(size_t n); 
    5453 
  • openpgpsdk/trunk/include/openpgpsdk/validate.h

    r602 r619  
    5151    } validate_reader_arg_t; 
    5252 
     53/** Struct used with the validate_key_cb callback */ 
    5354typedef struct 
    5455    { 
     
    7071    } validate_key_cb_arg_t; 
    7172 
     73/** Struct use with the validate_data_cb callback */ 
    7274typedef struct 
    7375    { 
     
    7678        LITERAL_DATA, 
    7779        SIGNED_CLEARTEXT 
    78         } use; 
     80        } use; /*<! this is set to indicate what kind of data we have */ 
    7981    union 
    8082        { 
    81         ops_literal_data_body_t literal_data_body;  
    82         ops_signed_cleartext_body_t signed_cleartext_body;  
    83         } data; 
    84     unsigned char hash[OPS_MAX_HASH_SIZE]; 
    85     const ops_keyring_t *keyring; 
    86     validate_reader_arg_t *rarg; 
    87     ops_validate_result_t *result; 
    88     } validate_data_cb_arg_t; 
     83        ops_literal_data_body_t literal_data_body; /*<! Used to hold Literal Data */ 
     84        ops_signed_cleartext_body_t signed_cleartext_body; /*<! Used to hold Signed Cleartext */ 
     85        } data; /*<! the data itself */ 
     86    unsigned char hash[OPS_MAX_HASH_SIZE]; /*<! the hash */ 
     87    const ops_keyring_t *keyring; /*<! keyring to use */ 
     88    validate_reader_arg_t *rarg; /*<! reader-specific arg */ 
     89    ops_validate_result_t *result; /*<! where to put the result */ 
     90    } validate_data_cb_arg_t; /*<! used with validate_data_cb callback */ 
    8991 
    9092ops_boolean_t ops_check_signature(const unsigned char *hash, 
  • openpgpsdk/trunk/include/openpgpsdk/writer.h

    r574 r619  
    5050                                             ops_writer_info_t *winfo); 
    5151typedef void ops_writer_destroyer_t(ops_writer_info_t *winfo); 
     52/** Writer settings */ 
    5253struct ops_writer_info 
    5354    { 
    54     ops_writer_t *writer; 
    55     ops_writer_finaliser_t *finaliser; 
    56     ops_writer_destroyer_t *destroyer; 
    57     void *arg; 
    58     ops_writer_info_t *next; 
     55    ops_writer_t *writer; /*!< the writer itself */ 
     56    ops_writer_finaliser_t *finaliser; /*!< the writer's finaliser */ 
     57    ops_writer_destroyer_t *destroyer; /*!< the writer's destroyer */ 
     58    void *arg; /* writer-specific argument */ 
     59    ops_writer_info_t *next; /*!< next writer in the stack */ 
    5960    }; 
    6061 
  • openpgpsdk/trunk/src/doxygen.c

    r613 r619  
    5252*/ 
    5353 
    54 /** \defgroup HighLevel_Misc Miscellaneous 
     54/** \defgroup HighLevel_Signature Signatures and Verification 
     55    \ingroup HighLevelAPI 
     56 */ 
     57     
     58/** \defgroup HighLevel_SignatureSign Sign File or Buffer 
     59    \ingroup HighLevel_Signature 
     60 */ 
     61     
     62/** \defgroup HighLevel_SignatureVerify Verify File or Buffer 
     63    \ingroup HighLevel_Signature 
     64 */ 
     65     
     66/** \defgroup HighLevel_SignatureDetails Verify Signature Details 
     67    \ingroup HighLevel_Signature 
     68 */ 
     69     
     70/** \defgroup HighLevel_Cryption Encryption and Decryption 
    5571    \ingroup HighLevelAPI 
    5672 */ 
     
    6278 
    6379/** 
     80    \defgroup HighLevel_Print Print 
     81    \ingroup HighLevelAPI 
     82*/ 
     83 
     84/** 
     85    \defgroup HighLevel_General General 
     86    \ingroup HighLevelAPI 
     87*/ 
     88 
     89/** 
    6490    \defgroup HighLevel_KeyringRead Read Keyring 
    6591    \ingroup HighLevel_Keyring 
     
    77103 
    78104/** 
     105    \defgroup HighLevel_KeyGenerate Generate Key 
     106    \ingroup HighLevel_Keyring 
     107*/ 
     108 
     109/** 
     110    \defgroup HighLevel_KeyWrite Write Key 
     111    \ingroup HighLevel_Keyring 
     112*/ 
     113 
     114/** 
     115    \defgroup HighLevel_KeyGeneral Other Key Functions 
     116    \ingroup HighLevel_Keyring 
     117*/ 
     118 
     119/** 
    79120    \defgroup HighLevel_KeyringMemory Memory Ops 
    80     \ingroup HighLevel_Keyring 
    81 */ 
    82  
    83 /** 
    84     \defgroup HighLevel_Key Key 
    85121    \ingroup HighLevel_Keyring 
    86122*/ 
     
    130166*/ 
    131167 
     168/** \defgroup Core_Signature Signatures and Verification 
     169    \ingroup CoreAPI 
     170 */ 
     171     
     172/** \defgroup Core_Compress Compression and Decompression 
     173    \ingroup CoreAPI 
     174 */ 
     175     
    132176/** \defgroup Core_Misc Miscellaneous 
    133177    \ingroup CoreAPI 
     
    141185/** 
    142186   \defgroup Core_Callbacks Callbacks 
    143    \ingroup CoreAPI 
    144 */ 
    145  
    146 /** 
    147    \defgroup Create 
    148187   \ingroup CoreAPI 
    149188*/ 
     
    196235 */ 
    197236/** 
    198  * @defgroup Create Create 
    199  * \ingroup AdvancedAPI 
     237 * @defgroup Core_Create Create 
     238 * \ingroup CoreAPI 
    200239 * These functions allow an OpenPGP object to be created.  
    201240 * 
  • openpgpsdk/trunk/src/lib/accumulate.c

    r574 r619  
    126126 
    127127/** 
    128  * \ingroup Parse 
     128 * \ingroup Core_Parse 
    129129 * 
    130130 * Parse packets from an input stream until EOF or error. 
     
    133133 * 
    134134 * \param keyring Pointer to an existing keyring 
    135  * \param opt Options to use when parsing 
     135 * \param parse_info Options to use when parsing 
    136136*/ 
    137137 
  • openpgpsdk/trunk/src/lib/compress.c

    r574 r619  
    233233 
    234234/** 
    235  * \ingroup Util
     235 * \ingroup Core_Compres
    236236 *  
    237237 * \param *region       Pointer to a region 
    238238 * \param *parse_info   How to parse 
     239 * \param type Which compression type to expect 
    239240*/ 
    240241 
  • openpgpsdk/trunk/src/lib/create.c

    r617 r619  
    405405 
    406406/** 
    407    \ingroup HighLevel_Key 
     407   \ingroup HighLevel_KeyWrite 
    408408 
    409409   \brief Writes a transferable PGP public key to the given output stream. 
     
    483483 
    484484/** 
    485    \ingroup HighLevel_Key 
     485   \ingroup HighLevel_KeyWrite 
    486486 
    487487   \brief Writes a transferable PGP secret key to the given output stream. 
     
    10481048 
    10491049/** 
    1050    \ingroup HighLevelAPI 
     1050   \ingroup HighLevel_General 
     1051 
     1052   \brief Reads contents of file into new ops_memory_t struct. 
     1053 
     1054   \param filename Filename to read from 
     1055   \param errnum Pointer to error 
     1056   \return new ops_memory_t struct containing the contents of the file 
    10511057    
    1052    \return allocated memory. If there was an error opening the file or reading from it, errnum is set to the cause 
     1058   \note If there was an error opening the file or reading from it, errnum is set to the cause 
     1059 
     1060   \note It is the caller's responsibility to call ops_memory_free(mem) 
    10531061*/ 
    10541062 
     
    10921100    } 
    10931101 
     1102/** 
     1103   \ingroup HighLevel_General 
     1104 
     1105   \brief Reads contents of buffer into file 
     1106 
     1107   \param filename Filename to write to 
     1108   \param buf Buffer to write to file 
     1109   \param len Size of buffer 
     1110   \param overwrite Flag to set whether to overwrite an existing file 
     1111   \return 1 if OK; 0 if error 
     1112*/ 
     1113 
    10941114int ops_write_file_from_buf(const char *filename, const char* buf, const size_t len, const ops_boolean_t overwrite) 
    10951115    { 
  • openpgpsdk/trunk/src/lib/crypto.c

    r616 r619  
    140140callback_write_parsed(const ops_parser_content_t *content_,ops_parse_cb_info_t *cbinfo); 
    141141 
     142/** 
     143\ingroup HighLevel_Cryption 
     144Encrypt a file 
     145\param input_filename Name of file to be encrypted 
     146\param output_filename Name of file to write to. If NULL, name is constructed from input_filename 
     147\param pub_key Public Key to encrypt file for 
     148\param use_armour Write armoured text, if set 
     149\param allow_overwrite Allow output file to be overwrwritten if it exists 
     150\return ops_true if OK; else ops_false 
     151*/ 
    142152ops_boolean_t ops_encrypt_file(const char* input_filename, const char* output_filename, const ops_keydata_t *pub_key, const ops_boolean_t use_armour, const ops_boolean_t allow_overwrite) 
    143153    { 
     
    198208    } 
    199209 
    200 /*  
    201 the output filename can either be given explicitly, or if NULL, 
    202 it will be derived from the input filename following GPG conventions. 
    203 That is, we assume a binary encrypted file will be called <origfile>.gpg 
    204 and an armoured file will be called <origfile.asc> 
    205 If neither is true, then we add a .decrypted suffix. 
     210/** 
     211   \ingroup HighLevel_Cryption 
     212   \param input_filename Name of file to be decrypted 
     213   \param output_filename Name of file to write to. If NULL, the filename is constructed from the input filename, following GPG conventions. 
     214   \param keyring Keyring to use 
     215   \param use_armour Expect armoured text, if set 
     216   \param allow_overwrite Allow output file to overwritten, if set. 
     217   \param cb_get_passphrase Callback to use to get passphrase 
    206218*/ 
    207219 
  • openpgpsdk/trunk/src/lib/keyring.c

    r611 r619  
    9494 
    9595/** 
    96  \ingroup HighLevel_Key 
     96 \ingroup HighLevel_KeyGeneral 
    9797 
    9898 \brief Returns the public key in the given keydata. 
     
    113113 
    114114/** 
    115 \ingroup HighLevel_Key 
     115\ingroup HighLevel_KeyGeneral 
    116116 
    117117\brief Check whether this is a secret key or not. 
     
    122122 
    123123/** 
    124  \ingroup HighLevel_Key 
     124 \ingroup HighLevel_KeyGeneral 
    125125 
    126126 \brief Returns the secret key in the given keydata. 
     
    141141 
    142142/** 
    143  \ingroup HighLevel_Key 
     143 \ingroup HighLevel_KeyGeneral 
    144144 
    145145  \brief Returns the secret key in the given keydata. 
     
    275275 
    276276/** 
    277    \ingroup HighLevel_Key 
     277   \ingroup HighLevel_KeyGeneral 
    278278 
    279279   \brief Checks whether key's algorithm and type are supported by OpenPGP::SDK 
  • openpgpsdk/trunk/src/lib/keyring_local.h

    r570 r619  
    4141     
    4242 
     43/** sigpacket_t */ 
    4344typedef struct  
    4445    { 
  • openpgpsdk/trunk/src/lib/openssl_crypto.c

    r616 r619  
    307307    { return hash->name; } 
    308308 
     309/** 
     310 \ingroup HighLevel_KeyGenerate 
     311 \brief Generates an RSA keypair 
     312 \param numbits Modulus size 
     313 \param e Public Exponent 
     314 \param keydata Pointer to keydata struct to hold new key 
     315 \return ops_true if key generated successfully; otherwise ops_false 
     316 \note It is the caller's responsibility to call ops_keydata_free(keydata) 
     317*/ 
    309318ops_boolean_t ops_rsa_generate_keypair(const int numbits, const unsigned long e, ops_keydata_t* keydata) 
    310319    { 
     
    395404    } 
    396405 
     406/** 
     407 \ingroup HighLevel_KeyGenerate 
     408 \brief Creates a self-signed RSA keypair 
     409 \param numbits Modulus size 
     410 \param e Public Exponent 
     411 \param userid User ID 
     412 \return The new keypair or NULL 
     413 
     414 \note It is the caller's responsibility to call ops_keydata_free(keydata) 
     415 \sa ops_rsa_generate_keypair() 
     416*/ 
    397417ops_keydata_t* ops_rsa_create_selfsigned_keypair(const int numbits, const unsigned long e, ops_user_id_t * userid) 
    398418    { 
  • openpgpsdk/trunk/src/lib/packet-show.c

    r616 r619  
    526526 
    527527/** 
    528  * \ingroup Show 
     528 * \ingroup HighLevel_Print 
    529529 * returns description of the Packet Tag  
    530530 * \param packet_tag 
     
    543543 
    544544/** 
    545  * \ingroup Show 
     545 * \ingroup HighLevel_Print 
    546546 * 
    547547 * returns description of the Signature Sub-Packet type 
     
    555555 
    556556/** 
    557  * \ingroup Show 
     557 * \ingroup HighLevel_Print 
    558558 * 
    559559 * returns description of the Revocation Reason code 
     
    568568 
    569569/** 
    570  * \ingroup Show 
     570 * \ingroup HighLevel_Print 
    571571 * 
    572572 * returns description of the given Signature type 
     
    581581 
    582582/** 
    583  * \ingroup Show 
     583 * \ingroup HighLevel_Print 
    584584 * 
    585585 * returns description of the given Public Key Algorithm 
     
    594594 
    595595/**  
    596  * \ingroup Show 
     596 * \ingroup HighLevel_Print 
    597597 * returns description of the Preferred Compression 
    598598 * \param octet 
     
    605605 
    606606/** 
    607  * \ingroup Show 
     607 * \ingroup HighLevel_Print 
    608608 * 
    609609 * returns set of descriptions of the given Preferred Compression Algorithms 
     
    621621 
    622622/** 
    623  * \ingroup Show 
     623 * \ingroup HighLevel_Print 
    624624 * 
    625625 * returns description of the Hash Algorithm type 
     
    635635 
    636636/** 
    637  * \ingroup Show 
     637 * \ingroup HighLevel_Print 
    638638 * 
    639639 * returns set of descriptions of the given Preferred Hash Algorithms 
     
    655655 
    656656/** 
    657  * \ingroup Show 
     657 * \ingroup HighLevel_Print 
    658658 * returns description of the given Preferred Symmetric Key Algorithm 
    659659 * \param octet 
     
    667667 
    668668/** 
    669  * \ingroup Show 
     669 * \ingroup HighLevel_Print 
    670670 * 
    671671 * returns set of descriptions of the given Preferred Symmetric Key Algorithms 
     
    682682 
    683683/**  
    684  * \ingroup Show 
     684 * \ingroup HighLevel_Print 
    685685 * returns description of one SS Feature 
    686686 * \param octet 
     
    696696 
    697697/** 
    698  * \ingroup Show 
     698 * \ingroup HighLevel_Print 
    699699 * 
    700700 * returns set of descriptions of the given SS Features 
     
    740740 
    741741/** 
    742  * \ingroup Show 
     742 * \ingroup HighLevel_Print 
    743743 * returns description of SS Key Flag 
    744744 * \param octet 
     
    753753 
    754754/** 
    755  * \ingroup Show 
     755 * \ingroup HighLevel_Print 
    756756 * 
    757757 * returns set of descriptions of the given Preferred Key Flags 
     
    795795 
    796796/** 
    797  * \ingroup Show 
     797 * \ingroup HighLevel_Print 
    798798 * 
    799799 * returns description of one given Key Server Preference 
     
    812812 
    813813/** 
    814  * \ingroup Show 
     814 * \ingroup HighLevel_Print 
    815815 * returns set of descriptions of given Key Server Preferences 
    816816 * \param ss_key_server_prefs 
     
    855855 
    856856/** 
    857  * \ingroup Show 
     857 * \ingroup HighLevel_Print 
    858858 * 
    859859 * returns set of descriptions of the given SS Notation Data Flags 
  • openpgpsdk/trunk/src/lib/parse_local.h

    r574 r619  
    4545 
    4646 
    47 /*  
    48  * ops_crypt_info 
    49  */ 
     47/** ops_crypt_info 
     48 Encrypt/decrypt settings 
     49*/ 
    5050struct ops_crypt_info 
    5151    { 
    52     char *passphrase; 
    53     ops_keyring_t *keyring; 
    54     const ops_keydata_t *keydata; 
    55     ops_parse_cb_t *cb_get_passphrase; 
     52    char *passphrase; /*<! passphrase to use, this is set by cb_get_passphrase */ 
     53    ops_keyring_t *keyring; /*<! keyring to use */ 
     54    const ops_keydata_t *keydata; /*<! keydata to use */ 
     55    ops_parse_cb_t *cb_get_passphrase; /*<! callback to use to get the passphrase */ 
    5656    }; 
    5757 
  • openpgpsdk/trunk/src/lib/reader.c

    r613 r619  
    3939 * \ingroup Internal_Readers_Generic 
    4040 * \brief Starts reader stack 
    41  * \param pinfo 
    42  * \param reader 
    43  * \param arg 
     41 * \param pinfo Parse settings 
     42 * \param reader Reader to use 
     43 * \param destroyer Destroyer to use 
     44 * \param arg Reader-specific arg 
    4445 */ 
    4546void ops_reader_set(ops_parse_info_t *pinfo,ops_reader_t *reader,ops_reader_destroyer_t *destroyer,void *arg) 
     
    5354 * \ingroup Internal_Readers_Generic 
    5455 * \brief Adds to reader stack 
    55  * \param pinfo 
    56  * \param reader 
    57  * \param arg 
     56 * \param pinfo Parse settings 
     57 * \param reader Reader to use 
     58 * \param arg Reader-specific arg 
    5859 */ 
    5960void ops_reader_push(ops_parse_info_t *pinfo,ops_reader_t *reader,ops_reader_destroyer_t *destroyer,void *arg) 
     
    7576 * \ingroup Internal_Readers_Generic 
    7677 * \brief Removes from reader stack 
    77  * \param pinfo 
     78 * \param pinfo Parse settings 
    7879 */ 
    7980void ops_reader_pop(ops_parse_info_t *pinfo) 
  • openpgpsdk/trunk/src/lib/signature.c

    r617 r619  
    3737 
    3838static int debug=0; 
    39 #define MAXBUF 1024 
    40  
    41 /** \ingroup Create 
     39#define MAXBUF 1024 /*<! Standard buffer size to use */ 
     40 
     41/** \ingroup Core_Create 
    4242 * needed for signature creation 
    4343 */ 
     
    5353    }; 
    5454 
     55/** 
     56   \ingroup Core_Signature 
     57   Creates new ops_create_signature_t 
     58   \return new ops_create_signature_t 
     59   \note It is the caller's responsibility to call ops_create_signature_delete() 
     60   \sa ops_create_signature_delete() 
     61*/ 
    5562ops_create_signature_t *ops_create_signature_new() 
    5663    { return ops_mallocz(sizeof(ops_create_signature_t)); } 
    5764 
     65/** 
     66   \ingroup Core_Signature 
     67   Free signature and memory associated with it 
     68   \param sig struct to free 
     69   \sa ops_create_signature_new() 
     70*/ 
    5871void ops_create_signature_delete(ops_create_signature_t *sig) 
    5972    { 
     
    7083                                     0x03,0x02,0x1A,0x05,0x00,0x04,0x14 }; 
    7184 
     85/** 
     86   \ingroup Core_Create 
     87   implementation of EMSA-PKCS1-v1_5, as defined in OpenPGP RFC 
     88   \param M 
     89   \param mLen 
     90   \param hash_alg Hash algorithm to use 
     91   \param EM 
     92   \return ops_true if OK; else ops_false 
     93*/ 
    7294ops_boolean_t encode_hash_buf(const unsigned char *M, size_t mLen, 
    7395                           const ops_hash_algorithm_t hash_alg, 
     
    81103    int n=0; 
    82104    ops_hash_t hash; 
    83     //    unsigned char hashout[OPS_MAX_HASH_SIZE]; 
    84105    int hash_sz=0; 
    85106    int encoded_hash_sz=0; 
     
    324345    } 
    325346 
     347/** 
     348   \ingroup Core_Signature 
     349   \brief Checks a signature 
     350   \param hash Signature Hash to be checked 
     351   \param length Signature Length 
     352   \param sig The Signature to be checked 
     353   \param signer The signer's public key 
     354   \return ops_true if good; else ops_false 
     355*/ 
    326356ops_boolean_t ops_check_signature(const unsigned char *hash,unsigned length, 
    327357                                     const ops_signature_t *sig, 
     
    376406 
    377407/** 
    378  * \ingroup Verify 
    379  * 
    380  * Verify a certification signature. 
     408 * \ingroup HighLevel_SignatureDetails 
     409 * 
     410 * \brief Verify a certification signature. 
    381411 * 
    382412 * \param key The public key that was signed. 
     
    385415 * \param signer The public key of the signer. 
    386416 * \param raw_packet The raw signature packet. 
     417 * \return ops_true if OK; else ops_false 
    387418 */ 
    388419ops_boolean_t 
     
    409440 
    410441/** 
    411  * \ingroup Verify 
     442 * \ingroup HighLevel_SignatureDetails 
    412443 * 
    413444 * Verify a certification signature. 
     
    418449 * \param signer The public key of the signer. 
    419450 * \param raw_packet The raw signature packet. 
     451 * \return ops_true if OK; else ops_false 
    420452 */ 
    421453ops_boolean_t 
     
    441473 
    442474/** 
    443  * \ingroup Verify 
     475 * \ingroup HighLevel_SignatureDetails 
    444476 * 
    445477 * Verify a subkey signature. 
     
    450482 * \param signer The public key of the signer. 
    451483 * \param raw_packet The raw signature packet. 
     484 * \return ops_true if OK; else ops_false 
    452485 */ 
    453486ops_boolean_t 
     
    467500 
    468501/** 
    469  * \ingroup Verify 
     502 * \ingroup HighLevel_SignatureDetails 
    470503 * 
    471504 * Verify a direct signature. 
     
    475508 * \param signer The public key of the signer. 
    476509 * \param raw_packet The raw signature packet. 
     510 * \return ops_true if OK; else ops_false 
    477511 */ 
    478512ops_boolean_t 
     
    489523 
    490524/** 
    491  * \ingroup Verify 
     525 * \ingroup Core_Signature 
    492526 * 
    493527 * Verify a signature on a hash (the hash will have already been fed 
     
    498532 * \param sig The signature to be verified. 
    499533 * \param signer The public key of the signer. 
     534 * \return ops_true if OK; else ops_false 
    500535 */ 
    501536ops_boolean_t 
     
    530565 
    531566/** 
    532  * \ingroup Creat
     567 * \ingroup Core_Signatur
    533568 * 
    534569 * ops_signature_start() creates a V4 public key signature with a SHA1 hash. 
     
    567602 
    568603/** 
    569  * \ingroup Creat
     604 * \ingroup Core_Signatur
    570605 * 
    571606 * Create a V4 public key signature over some cleartext. 
     
    600635    } 
    601636 
     637/** 
     638 * \ingroup Core_Signature 
     639 */ 
    602640void ops_signature_start_cleartext_signature(ops_create_signature_t *sig, 
    603641                                   const ops_secret_key_t *key, 
     
    608646    } 
    609647 
     648/** 
     649 * \ingroup Core_Signature 
     650 */ 
    610651void ops_signature_start_message_signature(ops_create_signature_t *sig, 
    611652                                   const ops_secret_key_t *key, 
     
    617658 
    618659/** 
    619  * \ingroup Creat
     660 * \ingroup Core_Signatur
    620661 * 
    621662 * Add plaintext data to a signature-to-be. 
     
    634675 
    635676/** 
    636  * \ingroup Creat
     677 * \ingroup Core_Signatur
    637678 * 
    638679 * Mark the end of the hashed subpackets in the signature 
     
    653694 
    654695/** 
    655  * \ingroup Creat
     696 * \ingroup Core_Signatur
    656697 * 
    657698 * Write out a signature 
     
    718759 
    719760/** 
    720  * \ingroup Creat
     761 * \ingroup Core_Signatur
    721762 *  
    722763 * ops_signature_add_creation_time() adds a creation time to the signature. 
     
    732773 
    733774/** 
    734  * \ingroup Creat
     775 * \ingroup Core_Signatur
    735776 * 
    736777 * Adds issuer's key ID to the signature 
     
    748789 
    749790/** 
    750  * \ingroup Creat
     791 * \ingroup Core_Signatur
    751792 * 
    752793 * Adds primary user ID to the signature 
     
    763804 
    764805/** 
    765  * \ingroup Creat
     806 * \ingroup Core_Signatur
    766807 * 
    767808 * Get the hash structure in use for the signature. 
     
    773814    { return &sig->hash; } 
    774815 
     816/** 
     817   \ingroup HighLevel_SignatureSign 
     818   Sign a file with a Cleartext Signature 
     819   \param filename Filename to be signed 
     820   \param skey Secret Key to sign with 
     821   \param overwrite Allow output file to be overwritten, if set 
     822*/ 
    775823ops_boolean_t ops_sign_file_as_cleartext(const char* filename, const ops_secret_key_t *skey, const ops_boolean_t overwrite) 
    776824    { 
     
    865913 
    866914 
    867 /* It is the calling function's responsibility to free signed_cleartext */ 
    868 /* signed_cleartext should be a NULL pointer when passed in */ 
     915/**  
     916 * \ingroup HighLevel_SignatureSign 
     917 * \param cleartext Text to be signed 
     918 * \param len Length of text 
     919 * \param signed_cleartext ops_memory_t struct in which to write the signed cleartext 
     920 * \param skey Secret key with which to sign the cleartext 
     921 * \return ops_true if OK; else ops_false 
     922 * \note It is the calling function's responsibility to free signed_cleartext 
     923 * \note signed_cleartext should be a NULL pointer when passed in  
     924 */ 
    869925ops_boolean_t ops_sign_buf_as_cleartext(const char* cleartext, const size_t len, ops_memory_t** signed_cleartext, const ops_secret_key_t *skey) 
    870926    { 
     
    921977    } 
    922978 
     979/** 
     980\ingroup HighLevel_SignatureSign 
     981\brief Sign a file 
     982\param input_filename Input filename 
     983\param output_filename Output filename. If NULL, a name is constructed from the input filename. 
     984\param skey Secret Key to use for signing 
     985\param use_armour Write armoured text, if set. 
     986\param overwrite May overwrite existing file, if set. 
     987\return ops_true if OK; else ops_false; 
     988*/ 
    923989ops_boolean_t ops_sign_file(const char* input_filename, const char* output_filename, const ops_secret_key_t *skey, const ops_boolean_t use_armour, const ops_boolean_t overwrite) 
    924990    { 
     
    10141080    } 
    10151081 
     1082/** 
     1083\ingroup HighLevel_SignatureSign 
     1084\brief Signs input text; returns ops_memory_t struct containing signed input text. 
     1085\param input Input text to be signed 
     1086\param input_len Length of input text 
     1087\param sig_type Signature type 
     1088\param skey Secret Key 
     1089\param use_armour Write armoured text, if set 
     1090\return New ops_memory_t struct containing signed text 
     1091\note It is the caller's responsibility to call ops_memory_free(me) 
     1092*/ 
    10161093ops_memory_t* ops_sign_mem(const void* input, const int input_len, const ops_sig_type_t sig_type, const ops_secret_key_t *skey, const ops_boolean_t use_armour) 
    10171094    { 
     
    10261103 
    10271104    ops_hash_algorithm_t hash_alg=OPS_HASH_SHA1; 
    1028     //    ops_sig_type_t sig_type=OPS_SIG_BINARY; 
    10291105    ops_literal_data_type_t ld_type; 
    10301106    ops_hash_t* hash=NULL; 
  • openpgpsdk/trunk/src/lib/util.c

    r613 r619  
    194194/** 
    195195   \ingroup Internal_Readers_Sum16 
     196   \param pinfo Parse settings 
    196197*/ 
    197198 
     
    205206/** 
    206207   \ingroup Internal_Readers_Sum16 
     208   \param pinfo Parse settings 
     209   \return sum 
    207210*/ 
    208211unsigned short ops_reader_pop_sum16(ops_parse_info_t *pinfo) 
  • openpgpsdk/trunk/src/lib/validate.c

    r616 r619  
    491491    } 
    492492 
    493 /*  
     493/** 
     494 * \ingroup HighLevel_SignatureVerify 
    494495 * Validate all signatures on a single key against the given keyring 
     496 * \param result Where to put the result 
     497 * \param key Key to validate 
     498 * \param keyring Keyring to use for validation 
     499 * \param cb_get_passphrase Callback to use to get passphrase 
     500 * \note It is the caller's responsiblity to free result after use. 
     501 * \sa ops_validate_result_free() 
    495502 */ 
    496503void ops_validate_key_signatures(ops_validate_result_t *result,const ops_keydata_t *key, 
     
    530537    } 
    531538 
     539/** 
     540   \ingroup HighLevel_SignatureVerify 
     541   \param result Where to put the result 
     542   \param ring Keyring to use 
     543   \param cb_get_passphrase Callback to use to get passphrase 
     544   \note It is the caller's responsibility to free result after use. 
     545   \sa ops_validate_result_free() 
     546*/ 
    532547void ops_validate_all_signatures(ops_validate_result_t *result, 
    533548                                 const ops_keyring_t *ring, 
    534                                  ops_parse_cb_return_t cb (const ops_parser_content_t *, ops_parse_cb_info_t *) 
    535 
     549                                 ops_parse_cb_return_t cb_get_passphrase (const ops_parser_content_t *, ops_parse_cb_info_t *) 
     550                                 
    536551    { 
    537552    int n; 
     
    539554    memset(result,'\0',sizeof *result); 
    540555    for(n=0 ; n < ring->nkeys ; ++n) 
    541         ops_validate_key_signatures(result,&ring->keys[n],ring, cb); 
    542     } 
    543  
     556        ops_validate_key_signatures(result,&ring->keys[n],ring, cb_get_passphrase); 
     557    } 
     558 
     559/** 
     560   \ingroup HighLevel_SignatureVerify 
     561   Free result and associated memory 
     562   \param result Struct to be freed 
     563*/ 
    544564void ops_validate_result_free(ops_validate_result_t *result) 
    545565    { 
     
    558578    } 
    559579 
     580/** 
     581   \ingroup HighLevel_SignatureVerify 
     582   \param result Where to put the result 
     583   \param filename Name of file to be validated 
     584   \param armoured Treat file as armoured, if set 
     585   \param keyring Keyring to use 
     586   \return ops_true if signature validate successfully; ops_false if not 
     587   \note After verification, result holds the details of all keys which  
     588   have passed, failed and not been recognised. 
     589   \note It is the caller's responsiblity to call ops_validate_result_free(result) after use. 
     590*/ 
    560591ops_boolean_t ops_validate_file(ops_validate_result_t *result, const char* filename, const int armoured, const ops_keyring_t* keyring) 
    561592    { 
  • openpgpsdk/trunk/tests/test_rsa_decrypt.c

    r607 r619  
    156156    if (has_armour) 
    157157        ops_reader_push_dearmour(pinfo,ops_false,ops_false,ops_false); 
    158     //    current_passphrase=has_passphrase ? bravo_passphrase : nopassphrase; 
    159158     
    160159    // setup for writing parsed data to mem_out