[xmlsec] Encrypting more than 128 bytes with XMLSec

Damjan Rems d_rems at yahoo.com
Mon Nov 13 00:43:52 PST 2006


When I try to encrypt XML file I get this message:
---------------------- 
func=xmlSecOpenSSLRsaPkcs1Process:file=..\src\openssl\kt_rsa.c:line=282:obj=rsa-
1_5:subj=unknown:error=11:invalid size:587 when
expected less than 128
func=xmlSecOpenSSLRsaPkcs1Execute:file=..\src\openssl\kt_rsa.c:line=228:obj=rsa-
1_5:subj=xmlSecOpenSSLRsaPkcs1Process:error=1:xmlsec
library function failed:
func=xmlSecTransformDefaultPushBin:file=..\src\transforms.c:line=2173:obj=rsa-1_
5:subj=xmlSecTransformExecute:error=1:xmlsec library
function failed:final=1
func=xmlSecTransformIOBufferClose:file=..\src\transforms.c:line=2856:obj=rsa-1_5
:subj=xmlSecTransformPushBin:error=1:xmlsec library
function failed:
func=xmlSecEncCtxXmlEncrypt:file=..\src\xmlenc.c:line=430:obj=unknown:subj=xmlOu
tputBufferClose:error=5:libxml2 library function
failed:
Error: failed to encrypt xml file "signed.xml"
Error: failed to encrypt file with template
"temp_encrypt.xml"
----------------------------

Command I am using:
xmlsec encrypt --xml-data signed.xml --node-name data
--pkcs12 my.pfx --pwd mypwd --output kriptirano.xml
temp_encrypt.xml
----------------------------

signed.xml:
<?xml version="1.0" encoding="UTF-8"?>
<Message>
	<Body>
	<Data><el1>Podatki porocila</el1>

<el2>fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff</el2>

<el3>kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk</el3>

<el4>uiuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu</el4>

<el5>eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee</el5>

<el6>iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii</el6>

<el7>oooooooooooooooooooooooooooooooooooooooooooooooooooo</el7>

<el8>bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb</el8>

<el9>pppppppppppppppppppppppppppppppppppppppppppppppppppppppp</el9>
	</Data>

	<Signature
xmlns="http://www.w3.org/2000/09/xmldsig#">
		<SignedInfo> <CanonicalizationMethod
Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
			<SignatureMethod
Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
				<Reference URI="">
					<Transforms>
						<Transform
Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
					</Transforms>
					<DigestMethod
Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
				
<DigestValue>i7sEQYdSi6+F5IF3RlBp4gwrVYA=</DigestValue>
				</Reference>
		</SignedInfo>
	
<SignatureValue>1AvooAu1+I4Wf5ChFN5sum8Ubn0/nPo2U3bCRfJblyjMPvDTOTlVJEyV8VJgkq6C
Qh7ZoyibWk4yi51FFpJoR5FJQKcUaTPe2qRBGnjRdpP2QfPONoJ2D4P38lJtYF87
iGcCdQXx8LQdcsnFPzHK9AA6fhNJNhRzkuCMtB3xqTU=</SignatureValue>
		<KeyInfo>
			<X509Data>
		
<X509Certificate>MIIEGTCCAwGgAwIBAgIEOzz5yTANBgkqhkiG9w0BAQUFADA9MQswCQYDVQQGEwJz

etc ...............

--------------------------------------

temp_encrypt.xml

<?xml version="1.0" encoding="UTF-8"?>
<!--
XML Security Library example: XML doc file encrypted
with recipient's public key using xmlenc#rsa-1_5
-->
<EncryptedData
xmlns="http://www.w3.org/2001/04/xmlenc#"
Type="http://www.w3.org/2001/04/xmlenc#Element">
	<EncryptionMethod
Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5"/>
	<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
		<KeyName>my.pfx</KeyName>
	</KeyInfo>
	<CipherData>
		<CipherValue></CipherValue>
	</CipherData>
</EncryptedData>
------------------------------------

Please help.

TheR




 
____________________________________________________________________________________
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com



More information about the xmlsec mailing list