Subject: | Adding more X509_ + related functions |
Date: | Wed, 08 Feb 2012 08:59:04 +0100 |
To: | bug-Net-SSLeay [...] rt.cpan.org |
From: | kmx <kmx [...] volny.cz> |
Hi Mike,
the next episode regards missing X509_ + some related functions.
I have not yet polished the code and probably also the list may change
slightly but here is the list what I am missing (basically all functions
are necessary to to simple PKI/CA related tasks):
+X509_new()
+X509_set_issuer_name(x,name)
+X509_set_subject_name(x,name)
+X509_set_version(x,version)
+X509_get_version(x)
+X509_get_pubkey(x)
+X509_set_pubkey(x,pkey)
+X509_set_serialNumber(x,serial)
+X509_get_serialNumber(x)
+X509_certificate_type(x,pubkey=NULL);
+X509_sign(x,pkey,md)
+X509_NAME_add_entry_by_NID(name,nid,type,bytes,len,loc,set)
+X509_NAME_add_entry_by_OBJ(name,obj,type,bytes,len,loc,set)
+X509_NAME_add_entry_by_txt(name,field,type,bytes,len,loc,set)
+X509_NAME_entry_count(name)
+X509_NAME_get_entry(name,loc)
+X509_NAME_ENTRY_get_data(ne)
+X509_NAME_ENTRY_get_object(ne)
+X509_CRL_free(x)
+X509_CRL_new()
+X509_CRL_set_version(x,version)
+X509_CRL_get_version(x)
+X509_CRL_set_issuer_name(x,name)
+X509_CRL_get_issuer(x)
+X509_CRL_set_lastUpdate(x,tm)
+X509_CRL_get_lastUpdate(x)
+X509_CRL_set_nextUpdate(x,tm)
+X509_CRL_get_nextUpdate(x)
+X509_CRL_sort(x)
+X509_CRL_verify(a,r)
+X509_CRL_sign(x,pkey,md)
+X509_CRL_get_ext_count(x)
+X509_CRL_get_ext_by_NID(X509_CRL *x, int nid, int lastpos);
+X509_REQ_new()
+X509_REQ_free(x)
+X509_REQ_get_subject_name(x)
+X509_REQ_set_subject_name(x,name)
+X509_REQ_set_pubkey(x,pkey)
+X509_REQ_get_pubkey(x);
+X509_REQ_sign(x,pk,md)
+X509_REQ_verify(x,r)
+X509_REQ_set_version(x,version)
+X509_REQ_add_extensions(x,...)
+X509_CRL_add_extensions(x,cacert,...)
+X509_add_extensions(x,cacert,...)
+X509_to_X509_REQ(x,pkey,md)
+X509_REQ_to_X509(r,days,pkey)
+ASN1_INTEGER_set(i,val)
+EVP_PKEY_new()
+EVP_PKEY_free(pkey)
+EVP_PKEY_assign_RSA(pkey,key)
+PEM_get_string_X509_REQ(x509_req)
+PEM_get_string_X509_CRL(x509_crl)
+PEM_get_string_PrivateKey(pk,passwd=NULL,cb=NULL,u=NULL)
+PEM_read_bio_X509(bio,x=NULL,cb=NULL,u=NULL)
+PEM_read_bio_PrivateKey(bio,x=NULL,cb=NULL,u=NULL)
Of course I will deliver code + doc + tests + hopefully also doc for
already existing X509_* functions - the patch will arrive most likely
the next week (I will probably split it into 2 parts - 1/ simple 1:1
functions; 2/ more tricky functions).
Maybe an explanation why I am so interested in extending Net::SSleay:
A/ After we have solved the thread-safety (which is what I totally need
in my project) it turns out that it would not be easy (in fact
impossible) to safely combine more module with XS part linked to openssl
library.
B/ I was using Net::SSLeay for SSL networking stuff but I also need to
do some PKI/CA tasks - I know, there are other modules on cpan for that
but combining them with Net::SSLeay is exactly trouble A/
C/ So the best solution for me would be to have Net::SSLeay providing
wrappers for all necessary openssl functions (ssl, pki/ca, crypto, digest)
D/ Net::SSLeay already contains some X509_xxxx functions so in fact it
is not a complete new thing
E/ And as you know Net::SSleay (current svn trunk) is nowadays the most
thread-safe openssl-based perl module :)
--
kmx