Changeset 4627

Show
Ignore:
Timestamp:
02/14/07 18:12:36 (2 years ago)
Author:
morris
Message:

Add wi_p7_rsa_init_with_size()

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • libwired/trunk/libwired/p7/wi-p7-crypto.c

    r4626 r4627  
    119119 
    120120 
    121 wi_p7_rsa_t * wi_p7_rsa_init_with_private_pem_file(wi_p7_rsa_t *p7_rsa, wi_string_t *path) { 
     121wi_p7_rsa_t * wi_p7_rsa_init_with_size(wi_p7_rsa_t *p7_rsa, wi_uinteger_t size) { 
     122        p7_rsa->rsa = RSA_generate_key(size, RSA_F4, NULL, NULL); 
     123         
     124        if(!p7_rsa->rsa) { 
     125                wi_release(p7_rsa); 
     126                 
     127                return NULL; 
     128        } 
     129         
     130        return p7_rsa; 
     131
     132 
     133 
     134 
     135wi_p7_rsa_t * wi_p7_rsa_init_with_pem_file(wi_p7_rsa_t *p7_rsa, wi_string_t *path) { 
    122136        unsigned char   *buffer; 
    123137        int                             length; 
  • libwired/trunk/libwired/p7/wi-p7-crypto.h

    r4623 r4627  
    4949 
    5050WI_EXPORT wi_p7_rsa_t *                                 wi_p7_rsa_alloc(void); 
    51 WI_EXPORT wi_p7_rsa_t *                                 wi_p7_rsa_init_with_private_pem_file(wi_p7_rsa_t *, wi_string_t *); 
     51WI_EXPORT wi_p7_rsa_t *                                 wi_p7_rsa_init_with_size(wi_p7_rsa_t *, wi_uinteger_t); 
     52WI_EXPORT wi_p7_rsa_t *                                 wi_p7_rsa_init_with_pem_file(wi_p7_rsa_t *, wi_string_t *); 
    5253WI_EXPORT wi_p7_rsa_t *                                 wi_p7_rsa_init_with_public_key_data(wi_p7_rsa_t *, wi_data_t *); 
    5354