You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe...
In wssecurity, the certificate is not contained within KeyInfo, instead KeyInfo only contains a reference to the BinarySecurityToken element, which contains the certificate.
Therefore the current getCertFromKeyInfo function can not be used to retrieve the certificate when wssecurity is used.
The BinarySecurityToken is also not inside the Signature element, so traversing to parents from the KeyInfo element is not possible.
Describe teh solution you'd like...
getCertFromKeyInfo currently only gets the KeyInfo node, but it should also be passed the Security element when wsssecurity is used. Alternatively, the root xml node should also be passed to getCertFromKeyInfo
This seems reasonable. If possible, please reference the spec on this and feel free to put up a PR that will do this. It seems that if the doc is being passed, then this.keyInfo wouldn't also be needed, but I'll wait for commenting until I see what code solution you have in mind.
Is your feature request related to a problem? Please describe...
In
wssecurity
, the certificate is not contained withinKeyInfo
, insteadKeyInfo
only contains a reference to theBinarySecurityToken
element, which contains the certificate.Therefore the current
getCertFromKeyInfo
function can not be used to retrieve the certificate when wssecurity is used.The
BinarySecurityToken
is also not inside theSignature
element, so traversing to parents from theKeyInfo
element is not possible.Describe teh solution you'd like...
getCertFromKeyInfo
currently only gets theKeyInfo
node, but it should also be passed theSecurity
element whenwsssecurity
is used. Alternatively, the root xml node should also be passed togetCertFromKeyInfo
xml-crypto/src/signed-xml.ts
Line 267 in 0ed7ab2
Most simple solution would be:
const key = this.getCertFromKeyInfo(this.keyInfo, doc) || this.publicCert || this.privateKey;
Describe the alternatives you've considered...
Parsing the xml outside the library and injecting the
BinarySecurityToken
into the SignedXmlpublicCert
propertyThe text was updated successfully, but these errors were encountered: