<div dir="ltr"><div><div><div><div>My Env is Ubuntu 12.04, softHSMv2, xsectool1.2.0.<br><br></div>I am trying to sign a file using SHMv2 & xsectool.<br><br></div>i run a cmd like, ...<br><br>xmlsectool-1.2.0/xmlsectool.sh --verbose --sign --digest SHA256 --digestAlgorithm <a href="http://www.w3.org/2000/09/xmldsig#sha1">http://www.w3.org/2000/09/xmldsig#sha1</a> --signatureAlgorithm <a href="http://www.w3.org/2000/09/xmldsig#dsa-sha1">http://www.w3.org/2000/09/xmldsig#dsa-sha1</a> --pkcs11Config /home/jackc/src/xmlsectool-1.2.0/pksc11.cfg --key 0 --keyPassword 2222 --keystoreProvider sun.security.pkcs11.SunPKCS11 --inFile /home/jackc/src/xmlsectool-1.2.0/sample.xml --outFile /home/jackc/src/xmlsectool-1.2.0/newout.xml<br>
</div><br><br>softhsm-util --show-slot<br>Available slots:<br>Slot 0<br> Slot info:<br> Description: SoftHSM slot 0 <br> Manufacturer ID: SoftHSM project <br>
Hardware version: 2.0<br> Firmware version: 2.0<br> Token present: yes<br> Token info:<br> Manufacturer ID: SoftHSM project <br> Model: SoftHSM v2 <br>
Hardware version: 2.0<br> Firmware version: 2.0<br> Serial number: aecde8d999bf4a6a<br> Initialized: yes<br> User PIN init.: yes<br> Label: tok0 <br>
Slot 1<br> Slot info:<br> Description: SoftHSM slot 1 <br> Manufacturer ID: SoftHSM project <br> Hardware version: 2.0<br> Firmware version: 2.0<br>
Token present: yes<br> Token info:<br> Manufacturer ID: SoftHSM project <br> Model: SoftHSM v2 <br> Hardware version: 2.0<br> Firmware version: 2.0<br>
Serial number: e4d1db72d6354345<br> Initialized: yes<br> User PIN init.: yes<br> Label: <br><br><br>and get back, ...<br>ome/jackc/src/xmlsectool-1.2.0/xmlsectool.sh <br>--verbose --sign --pkcs11Config /home/jackc/src/xmlsectool-1.2.0/pksc11.cfg <br>
--key 0 --keyPassword 2222 --keystoreProvider sun.security.pkcs11.SunPKCS11 <br>--inFile sample.xml --outFile newout.xml<br><br>INFO XmlSecTool - Reading XML document from file 'sample.xml'<br>DEBUG XmlSecTool - Building DOM parser<br>
DEBUG XmlSecTool - Parsing XML input stream<br>INFO XmlSecTool - XML document parsed and is well-formed.<br>DEBUG XmlSecTool - Preparing to sign document<br>DEBUG CredentialHelper - Install PKCS11 provider<br>DEBUG CredentialHelper - Creating PKCS11 keystore with provider sun.security.pkcs11.SunPKCS11 and configuration file /home/jackc/src/xmlsectool-1.2.0/pksc11.cfg<br>
DEBUG CredentialHelper - Initializing PKCS11 keystore<br>DEBUG CredentialHelper - Successfully read credentials from keystore<br>ERROR XmlSecTool - Unknown error<br>java.lang.NullPointerException: null<br> at edu.internet2.middleware.security.XmlSecTool.sign(XmlSecTool.java:433) ~[xmlsectool-1.2.0.jar:na]<br>
at edu.internet2.middleware.security.XmlSecTool.main(XmlSecTool.java:188) ~[xmlsectool-1.2.0.jar:na]<br><br><br></div>suggestions? TIA, jackc...<br></div>