Integrate the DigiCert® Software Trust Manager PKCS11 library with Xmlsectool to sign XML files.
以下の作業が必要です:
xmlsectooLをダウンロードする
Java_home パスセット
署名が必要な XML ファイル
ソフトウェアの転送 (Windowsのみ)
注記
このファイルは、Linux、Mac OS 上でネイティブに動作します。ただし、Windowsでは、.shファイルを実行するためにLinux端末と接続する転送ソフト(例:Putty など)が必要です。
xmlsectool zip ファイルをダウンロードします。
ダウンロードしたファイルを解凍します。
コンソールにサインインする
XML 文書を Linux の場所にコピーします。
PKCS11設定ファイルをセットアップします。
XML 署名コマンドを使用します。
verify XML 検証コマンドを使用します。
コマンド
./xmlsectool.sh --sign --pkcs11Config <path to PKCS11 config file> --keyAlias <keypair alias> --keyPassword NONE --inFile <name of xml file to be signed> --outFile <name of xml file after signing>
出力例
./xmlsectool.sh --sign --pkcs11Config pkcs11properties.cfg --keyAlias StageCertKp --keyPassword NONE --inFile UnsignedFileName.xml --outFile SignedFileName.xml
INFO XMLSecTool - Reading XML document from file UnsignedFileName.xml
INFO XMLSecTool - XML document parsed and is well-formed.
INFO XMLSecTool - XML document successfully signed
INFO XMLSecTool - XML document written to file /Users/Name/github.com/digicert/ssm/SignedFileName.xml
コマンド
./xmlsectool.sh --verifySignature --pkcs11Config <path to PKCS11 config file> --keyAlias <keypair alias> --keyPassword NONE --inFile <name of xml file after signing>
出力例
./xmlsectool.sh --verifySignature --pkcs11Config pkcs11properties.cfg --keyAlias KeypairAliasExample --keyPassword NONE --inFile SignedFileName.xml
INFO XMLSecTool - Reading XML document from file 'SignedFileName.xml'
INFO XMLSecTool - XML document parsed and is well-formed.
INFO XMLSecTool - XML document signature verified.
代替コマンド
xmlsectool.sh --verifySignature --certificate <certificate associated with keypair> --inFile <name of xml file after signing>
出力例
./xmlsectool.sh --verifySignature --certificate CertificateName.crt --inFile SignedFileName.xml
INFO XMLSecTool - Reading XML document from file 'SignedFileName.xml'
INFO XMLSecTool - XML document parsed and is well-formed.
INFO XMLSecTool - XML document signature verified.