[xmlsec] Signing an XML file.
Jean Cyr
jcyr at dillobits.com
Wed Jun 7 21:41:50 PDT 2006
Forgive my ignorance but I am new to this and I need a little help to get me started. My objective is to sign an arbitrary XML file
using an openssl generated private key and certificate.
The XML file (4uonly.xml):
<?xml version="1.0" ?>
<XML_DIZ_INFO>
<Company_Info>
<Company_Name>Dillobits Software, Inc.</Company_Name>
</Company_Info>
</XML_DIZ_INFO>
The private key (Dillo.key):
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,8F9F5B674A6E8E74
u+t1otoa0+f6C5oDR12TyLHLSpIsfFIMXDBdIkAdZQtEW4K819YEaJb3cpqB/6qR
zi4CYC307bmS2vQVT6GEF3giC+/jqQehWjYDLmdT7glKYVHF/4xGiyYHjHQC1GQo
kad7sTw9eviDYhZrnLT9GzA1r82u89hi20YPVB1/Uz1cBMx21ePqFksNNwig3G/m
9F2hMw5cF3sKFa5rqO+DpuFgwOjKIUaOoqz+JwHQvGqAUjtH4oq/sT0SEgcXXCzv
6DWLxBrDdLTeaKEZNEOBSK4Y37f0yRI41s9bmiHhRXALoUInZSJewJn8tPpPb3/H
kmH3L0NhV/53AdZ1L8PVfKRhyPLa+5L0ezyvHCIwR8F1ojJaprPFKHDr9MaK9Qjc
GZt3sFmZlc0USDf91hnH4Y26cZFjuB0wi+esG1J3Kqg=
-----END RSA PRIVATE KEY-----
The certificate (Dillo.crt):
-----BEGIN CERTIFICATE-----
MIIB+jCCAaQCCQDwKJgU+FLQbzANBgkqhkiG9w0BAQUFADCBgTELMAkGA1UEBhMC
VVMxEDAOBgNVBAgTB0dlb3JnaWExEzARBgNVBAcTCkFscGhhcmV0dGExDDAKBgNV
BAoTA0FTUDEMMAoGA1UECxMDUEFEMQwwCgYDVQQDEwNBU1AxITAfBgkqhkiG9w0B
CQEWEmpjeXJAZGlsbG9iaXRzLmNvbTAeFw0wNjA2MDgwMDM4MTNaFw0wNzA2MDgw
MDM4MTNaMIGFMQswCQYDVQQGEwJVUzEQMA4GA1UECBMHR2VvcmdpYTETMBEGA1UE
BxMKQWxwaGFyZXR0YTEOMAwGA1UEChMFRGlsbG8xDDAKBgNVBAsTA1BBRDEOMAwG
A1UEAxMFRGlsbG8xITAfBgkqhkiG9w0BCQEWEmpjeXJAZGlsbG9iaXRzLmNvbTBc
MA0GCSqGSIb3DQEBAQUAA0sAMEgCQQDpbyQ/HzgHP6KGmIsnAixfgSA/zN+je+BM
/F5/EaFJbtubnKJ1CdqSnTTo3dx9j/gEfzAnvD6vdcHQn7rng+VbAgMBAAEwDQYJ
KoZIhvcNAQEFBQADQQCBlohxiOIzvTeH7u8Ddqn/EhlsHF+9bTxE2FIsa4HleGEU
QY/aIVWwtiG3QJhCR/JlJ0zBI+sc+4OroOW98RMs
-----END CERTIFICATE-----
When I issue the following command:
xmlsec --sign-tmpl --pubkey-cert-pem Dillo.crt --privkey-pem Dillo.key 4uonly.xml
I get:
Enter password for "Dillo.key" file:
func=xmlSecKeysMngrGetKey:file=..\src\keys.c:line=1364:obj=unknown:subj=xmlSecKeysMngrFindKey:error=1:xmlsec library function
failed:
func=xmlSecDSigCtxProcessKeyInfoNode:file=..\src\xmldsig.c:line=871:obj=unknown:subj=unknown:error=45:key is not found:
func=xmlSecDSigCtxProcessSignatureNode:file=..\src\xmldsig.c:line=565:obj=unknown:subj=xmlSecDSigCtxProcessKeyInfoNode:error=1:xmlse
c library function failed:
func=xmlSecDSigCtxSign:file=..\src\xmldsig.c:line=303:obj=unknown:subj=xmlSecDSigCtxSigantureProcessNode:error=1:xmlsec library
function failed:
Error: signature failed
Error: failed to create and sign template
I'm obviously mssing something, but what?
More information about the xmlsec
mailing list