X509_CRL_dup() problem ?

2008-08-13 Thread delcour.pierre
Hello everyone, I try to add a certificate in a CRL. To do that, i use a X509* cert, a X509_CRL* crl with this algorithm : X509_REVOKED *r = NULL; r = X509_REVOKED_new(); r->serialNumber = X509_get_serialNumber(cert); if(!crl->crl->revoked) ci->revoked = sk_X509_REVOKED_new(X509_REVOKED_

Bug with X509_dup ?

2008-06-12 Thread delcour.pierre
Hello, I wrote this code : X509* CA = X509_new(); X509* cert = X509_dup ( CA ); Each time i got a segmentation fault when i use cert (cert == NULL is true, but CA != NULL). For me, X509_dup duplicate the given X509 certificate, so i don't think that cert == NULL is a good behavior. . I'm usin

EVP_PKEY ] How to duplicate it ?]

2008-06-02 Thread delcour.pierre
Hello everyone, I would like to duplicate an EVP_PKEY struct. I wrote this not working code: BIO *bout = BIO_new(BIO_s_mem()); PEM_write_bio_PrivateKey(bout, key, NULL, NULL, 0, NULL, NULL); key = PEM_read_bio_PrivateKey(bout, NULL, NULL, NULL); cout << (key == NULL) << endl; BIO_free(bou

How to add an extension to a X509 certificate ?

2008-06-02 Thread delcour.pierre
Hello everyone, As i get no answer from the user mailing list, i ask it here. Sorry in advance if i post this question in the wrong place, but i really need a clue. I would like to add an extension to a X509v3 certificate. I wrote : void Addmyextension(X509* cert, int nid, char* value, bool c