Adding key from X509 certificate using xmlSecOpenSSLAppKeyLoad
and xmlSecOpenSSLAppKeyLoadMemory
does not add the certificate to the key's "keyCert" member
#535
-
Hi xmlSecKeyPtr key = xmlSecCryptoAppKeyLoad(cert_file, xmlSecKeyDataFormatPem, NULL, NULL, NULL);
xmlSecCryptoAppDefaultKeysMngrAdoptKey(keys_mngr, key); This adds the key from the cert fine as the XML signature gets verified using the added key, but when I try to retrieve the certificate using: X509* key_cert = xmlSecOpenSSLKeyDataX509GetKeyCert(xmlSecKeyGetData(key, xmlSecOpenSSLKeyDataX509Id)); I get NULL back. Upon a small investigation, I found that |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 7 replies
-
You also need to call xmlSecCryptoAppKeyCertLoad() to add the cert to the key. |
Beta Was this translation helpful? Give feedback.
-
Hm, ok sorry about that, let me take a look. What version of xmlsec are you using? |
Beta Was this translation helpful? Give feedback.
-
I see the issue: this is inconsistent: reading pkcs12 or X509Data from XML sets keyCert while reading a key from a cert file does not. I created issue #545 and PR #546. It should be in the master shortly and then included in the next release (targeting April 2023). |
Beta Was this translation helpful? Give feedback.
I see the issue: this is inconsistent: reading pkcs12 or X509Data from XML sets keyCert while reading a key from a cert file does not. I created issue #545 and PR #546. It should be in the master shortly and then included in the next release (targeting April 2023).