Hi all,

Im trying to add a custom Extension to a CSR using openssl API's:

struct stack_st_X509_EXTENSION *exts = NULL;
X509_EXTENSION *ex;
exts = sk_X509_EXTENSION_new_null();
ASN1_OCTET_STRING *os = ASN1_OCTET_STRING_new();          
nid = OBJ_create("1.3.6.1.4.1.12345", "End Entry Type", "My End Entry
Type");      
ASN1_OCTET_STRING_set(os,(unsigned char*)"critical,5",strlen("critical,5"));  
ex = X509_EXTENSION_create_by_NID( NULL, nid, 0, os ); 
sk_X509_EXTENSION_push(exts, ex);
X509_REQ_add_extensions(x, exts);

When I parse the CSR I see that the extension displayed is actually the OID
, and not the extension name:

X509v3 extensions:
            1.3.6.1.4.1.12345:
                critical,5

Am I adding the extension in the correct way?
Should I  change some setting in the openssl.cnf?
How can insert the extension name :"End Entry Type" instaed of the OID
"1.3.6.1.4.1.12345"?

Thanks,
Dany

            



--
View this message in context: 
http://openssl.6102.n7.nabble.com/Adding-a-custom-extension-to-a-CSR-tp47446.html
Sent from the OpenSSL - User mailing list archive at Nabble.com.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to