unable to load key file solution

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

unable to load key file solution

Ricardo Alzaga Chirino
Dear User Support Mailing List <[hidden email]>
 
In order to be able to fulfill the fiscal legislation in Mexico, I am developing a system to obtain electronic invoices,
but up to here I have been able to advance without being able to follow ahead. For this reason I ask for your aid.
In the last line of this DOS code, you will see that the message is "unable to load key file".
I do not know why and I cannot finish the process of verification of the seal. Could you help me to resolve it?
I appreciate your attention,
 
Ing. Ricardo Manuel Alzaga Chirino
Mexico City
 
Files I send:
AAA010101AAA_0408021316S.key  Private key file in (PKCS#8 format key/DER encoded).
AAA010101AAAsd.cer            Certificate file in DER encoding.
fact1.xml                     Invoice file in XML format. "sello" field mean digital signing in Base 64 format.
cadena_original.xsl           An XLS file for transforming fact1.xml and extract the string for digital signing.
sello.xsl                     An XLS file for transforming fact1.xml and extract digital signing field within it.
 
Working platform:
Microsoft Windows 2000 [VersiĆ³n 5.00.2195] & OpenSSL 0.9.7e
 
Rem -----------------------------------------------------------------------------
Rem DOS Code
openssl pkcs8 -inform DER -in AAA010101AAA_0408021316S.key -passin pass:Empresa1 -out AAA010101AAA.key.pem
openssl rsa -in conllave.key.pem -des3 -out conllave.key.pem -passout pass:Empresa1
 
openssl x509 -inform DER -outform PEM -in AAA010101AAAsd.cer -out AAA010101AAA.cer.pem
 
xsltproc -output co.txt cadena_original.xsl fact1.xml
openssl dgst -md5 -out sellobin -sign conllave.key.pem co.txt
openssl enc -base64 -A -in sellobin -out sello64.txt
 
xsltproc -output selloxml.txt sello.xsl fact1.xml
openssl enc -base64 -d -A -in selloxml.txt -out sellobin
 
xsltproc -output coxml.txt cadena_original.xsl fact1.xml
openssl dgst -md5 -verify AAA010101AAA.cer.pem -signature sellobin co.txt
Rem unable to load key file !!! Why?

AAA010101AAA_0408021316S.key (990 bytes) Download Attachment
AAA010101AAAsd.cer (1K) Download Attachment
Fact1.xml (2K) Download Attachment
cadena_original.xsl (4K) Download Attachment
sello.xsl (239 bytes) Download Attachment