[xmlsec] Encrypt and Decrypt

Doug Royer Doug@Royer.com
Sat, 25 Jan 2003 17:34:06 -0700


This is a cryptographically signed message in MIME format.

--------------ms060405030308090209040405
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit


I can not get the online examples for encryption and decryption
to compile. So then I tried the encryption and decryption
examples in docs/examples/enc[12], and they
do compile then produce run time errors:

./enc1 rsapub.pem

  (keyinfo.c:926): error 16: invalid key origin : xmlSecKeyOriginEncryptedKey
  (xmltree.c:674): error 100: assertion : doc != NULL

It then products ouput that to the eye look valid that I save in MY-RUN.xml.
However:

  ./enc2 ../enc1/rsakey.pem ../enc1/MY-RUN.xml

  (des.c:261): error 12: invalid transform or key : xmlSecEncDes3Cbc and 
xmlSecDesKey
  (xmlenc.c:1510): error 2: xmlsec operation failed : xmlSecBinTransformAddKey 
- -1
  (xmlenc.c:1124): error 2: xmlsec operation failed : 
xmlSecEncryptedDataNodeRead - -1
  (xmlenc.c:1018): error 2: xmlsec operation failed : xmlSecEncStateCreate
Error: decryption failed

  ./enc2 also produces the same errors for the supplied test.xml in enc1 .


This happens on Solaris-2.6, Solaris-9, Red Hat-8.0, Red Hat-7.3,
all code I compiled from http://www.aleksey.com. All systems with:

	xmlsec-config --version
	0.0.11

	xml2-config --version
	2.5.1

	xslt-config --version
	1.0.24

	openssl version
         OpenSSL 0.9.7-beta6 17 Dec 2002

I have also tried it with:

	OpenSSL 0.9.6b [engine] 9 Jul 2001

All with the same results.


-- 

  Doug Royer                     |   http://INET-Consulting.com
  -------------------------------|-----------------------------
  Doug@Royer.com                 | Office: (208)612-INET
  http://Royer.com/People/Doug   |    Fax: (866)594-8574
                                 |   Cell: (208)520-4044

                 We Do Standards - You Need Standards

--------------ms060405030308090209040405
Content-Type: application/x-pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJ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