There are some use cases where using an unextractable private key results in
errors like this. See https://issues.apache.org/bugzilla/show_bug.cgi?id=43056
for more info.
If this is the case, you must explicitly specify the java.security.Signature
Provider that works with your Safenet HSM by setting a property on the
XMLSignContext object, ex:
signContext.setProperty
("org.jcp.xml.dsig.internal.dom.SignatureProvider", new MyProvider());
--Sean
Dennis wrote:
Hi,
I am using the Apache XML Digital Signature RI to sign SAML 2.0 messages and
using a Safenet HSM. My code looks OK until it gets to the point of signing
when I get a null pointer exception.
08/11/06 14:20:03 java.lang.NullPointerException
08/11/06 14:20:03 at
com.sun.net.ssl.internal.ssl.JS_ConvertBigInteger.toByteArray(DashoA12275)
08/11/06 14:20:03 at
com.sun.net.ssl.internal.ssl.JSA_RSAKeyFactory.engineTranslateKey(DashoA12275)
08/11/06 14:20:03 at java.security.KeyFactory.translateKey
(KeyFactory.java:277)
08/11/06 14:20:03 at
com.sun.net.ssl.internal.ssl.JS_Signature.engineInitSign(DashoA12275)
08/11/06 14:20:03 at java.security.Signature$Delegate.engineInitSign
(Signature.java:772)
08/11/06 14:20:03 at java.security.Signature.initSign(Signature.java:356)
08/11/06 14:20:03 at
org.jcp.xml.dsig.internal.dom.DOMSignatureMethod.sign(Unknown Source)
08/11/06 14:20:03 at org.jcp.xml.dsig.internal.dom.DOMXMLSignature.sign
(Unknown Source)
Has anyone seen a similar error ?
regards
Dennis