[xmlsec] Can't Encrypt with command-line utility

2003-07-06 Thread Edward Shallow
Hi Aleksey,

   I can't get this simple xmlsec command line utility version of your
encrypt1 example to work. Files (renamed) are straight from your examples
directory. I'm using the most recent pre-compiled Windows version 1.0.3 from
Igor's site. Console output below. Any ideas ? 

xmlsec encrypt --xml-data encrypt1-doc.xml --deskey deskey.bin
tmpl-EPM-encrypt.xml
func=xmlSecEncCtxXmlEncrypt:file=..\src\xmlenc.c:line=417:obj=unknown:subj=u
nknown:error=14:invalid type:type=NULL
Error: failed to encrypt xml file encrypt1-doc.xml
Error: failed to encrypt file with template tmpl-EPM-encrypt.xml

Also if it is not too much trouble, I would like a simple template and
command line encrypt example which uses recipient's public key file
(instead of deskey.bin). I assume this would be in conjunction with some
suitable symmetric block cipher. Any example would help.

Thanks,
Ed
?xml version=1.0?
!-- 
XML Security Library example: Simple encryption template file for encrypt1 example. 
--
EncryptedData xmlns=http://www.w3.org/2001/04/xmlenc#;
EncryptionMethod Algorithm=http://www.w3.org/2001/04/xmlenc#tripledes-cbc/
KeyInfo xmlns=http://www.w3.org/2000/09/xmldsig#;
	KeyNamedeskey.bin/KeyName
/KeyInfo   
CipherData
	CipherValue/CipherValue
/CipherData
/EncryptedData
?xml version=1.0 encoding=UTF-8?
!-- 
XML Security Library example: Original XML doc file before encryption (encrypt2 example). 
--
Envelope xmlns=urn:envelope
  Data
	Data to Encrypt. Ed test July 6, 2003.
  /Data
/Envelope


Re: [xmlsec] Can't Encrypt with command-line utility

2003-07-06 Thread Aleksey Sanin
--xml-data option means that the input is an XML file
and some part of this file will be encrypted in the output.
You should specify which node you want to encrypt
and what you want to encrypt (whole node or just node
content, see XML Encryption spec for details). You can
use --node-* options to specify the node and you MUST
specify Type attribute in the enc:EncryptedData/
element of your template (for example, 
   Type=http://www.w3.org/2001/04/xmlenc#Content;
tells xmlsec to encrypt the content of the selected node).
The error you have tells exactly about the missing Type
attribute.

 Also if it is not too much trouble, I would like
 a simple template and command line encrypt example...
There are a lot of examples in the tests/ folder. I am sorry
but personalized examples are outside of my free support
limits :)
Aleksey







___
xmlsec mailing list
[EMAIL PROTECTED]
http://www.aleksey.com/mailman/listinfo/xmlsec