[xmlsec] Sign XML using EVP_PKEY and X509 cert in memory

Duh Crab duhcrab at yahoo.com
Fri Aug 13 11:05:14 PDT 2010





I am trying to sign XML using the pkey and X509 cert in a pkcs12 file.
 

I extracted the pkey and cert from the pkcs12 file using the following -

EVP_PKEY *pkey;

X509 *cert;

PKCS12 *p12;

 

p12 = d2i_PKCS12_fp(fp, NULL);

PKCS12_parse(p12, passphrase, &pkey, &cert, &ca);

 

I now want to use the pkey and cert from above to sign xml using xmlsec.

How do I use these with the following api's?

xmlSecCryptoAppKeyLoadMemory()

xmlSecOpenSSLAppKeyCertLoadMemory()

 

If I save the pkey and cert above to the filesystem and then call -

xmlSecCryptoAppKeyLoad() and xmlSecCryptoAppKeyCertLoad() (along with other xmlsec api's), everything works well and I

am able to sign the XML.

 

However, there are cases where I do not have access to the filesystem and need to use pkey and cert from memory.

 

Thanks,

Sri



      


More information about the xmlsec mailing list