[xmlsec] problem with xmlSecCryptoAppKeysMngrCertLoadMemory

Martin Waite martin at datacash.com
Wed May 3 22:10:16 PDT 2006


Hi,

I'm trying to load X509 certificates from memory into a key manager:

	if(xmlSecCryptoAppKeysMngrCertLoadMemory(mngr, cert[i], strlen(cert[i]), xmlSecKeyDataFormatPem, xmlSecKeyDataTypeTrusted) < 0) {
    	    throw_exception("Error: failed to load pem certificate %d (%d bytes) from \"%s\"\n", i, strlen(cert[i]), cert[i]);
	    xmlSecKeysMngrDestroy(mngr);
	    return(NULL);
	}


The error message I get when trying to load using
xmlSecCryptoAppKeysMngrCertLoadMemory() is:

func=xmlSecOpenSSLX509StoreAdoptCert:file=x509vfy.c:line=396:obj=x509-store:subj=X509_STORE_add_cert:error=4:crypto library function failed:
func=xmlSecOpenSSLAppKeysMngrCertLoadBIO:file=app.c:line=1082:obj=unknown:subj=xmlSecOpenSSLX509StoreAdoptCert:error=1:xmlsec library function failed:
func=xmlSecOpenSSLAppKeysMngrCertLoadMemory:file=app.c:line=1024:obj=unknown:subj=xmlSecOpenSSLAppKeysMngrCertLoadBIO:error=1:xmlsec library function failed:


It looks as if it is happy with the PEM image of the certificate, but
something else is preventing the certificate from being "adopted".

Any ideas ?

Thanks,
Martin




More information about the xmlsec mailing list