Git init
[external/xmlsec1.git] / examples / README
1 This folder contains XML Security Library examples. 
2
3 1. Files List
4 -------------------------
5
6     README                      This file.
7     Makefile                    *nix makefile.
8     Makefile.w32                Win32 makefile.
9     rsakey.pem                  Private PEM key file
10     rsapub.pem                  Public PEM key file
11     rsacert.pem                 Certificate for rsakey.pem signed with rootcert.pem
12     rootcert.pem                Root (trusted) certificate
13     deskey.bin                  A DES keys
14     sign1.c                     Signing with a template file
15     sign1-tmpl.xml              An example template file for sign1 example
16     sign1-res.xml               The result of processing sign1_tmpl.xml by sign1.c
17     sign2.c                     Signing a file with a dynamicaly created template
18     sign2-doc.xml               An example XML file for signing by sign2.c
19     sign2-res.xml               The result of signing sign2-doc.xml by sign2.c
20     sign3.c                     Signing a file with a dynamicaly created template and an X509 certificate
21     sign3-doc.xml               An example XML file for signing by sign3.c
22     sign3-res.xml               The result of signing sign3-doc.xml by sign3.c
23     verify1.c                   Verifying a signed document with a single key
24     verify2.c                   Verifying a signed document using keys manager
25     verify3.c                   Verifying a signed document using X509 certificate
26     verify4.c                   Verifying a simple SAML response using X509 certificate
27     verify4-tmpl.xml            An example template file with a simple SAML response for verify4 example
28     verify4-res.xml             Signed simple SAML response for verification by verify4.c 
29     encrypt1.c                  Encrypting binary data with a template file
30     encrypt1-res.xml            An example template file for encrypt1.c
31     encrypt1-tmpl.xml           The result of processing encrypt1_tmpl.xml by encrypt1.c
32     encrypt2.c                  Encrypting XML file using a dynamicaly created template
33     encrypt2-doc.xml            An example XML file for encryption by encrypt2.c
34     encrypt2-res.xml            The result of encryptin encrypt2-doc.xml by encrypt2.c
35     encrypt2.c                  Encrypting XML file using a session DES key
36     encrypt2-doc.xml            An example XML file for encryption by encrypt3.c
37     encrypt2-res.xml            The result of encryptin encrypt3-doc.xml by encrypt3.c
38     decrypt1.c                  Decrypting binary data using a single key
39     decrypt2.c                  Decrypting binary data using keys manager
40     decrypt3.c                  Decrypting binary file using custom keys manager
41     xmldsigverify.c             CGI script for signatures verifications
42
43 2. Building Examples 
44 -------------------------
45
46 Unixes:  
47     Just run the usual 'make' command (assuming that xmlsec, libxml and 
48     all other required libraries are already installed).
49
50 Windows:
51     - Add paths to include and library files for xmlsec, libxml2, libexslt and 
52     openssl or nss to the environment variables INCLUDE and LIB.
53     - Edit 'Makefile.w32' file and specify correct crypto engine (openssl or 
54     nss for now). You can also specify necessary include and library paths
55     or change from static linking to using DLLs.
56     - Run 'nmake -f Makefile.w32'
57
58     If something does not work, check the README file in the top level 
59     "win32" folder and have fun :)
60     
61 Other platforms:
62     If none of the above works for you and you've managed to compile xmlsec
63     library by yourself then you probably know what to do.
64
65
66
67 3. Runnning Examples.
68 -------------------------
69
70 The following are just examples and you can use the programs from this
71 folder with any other input files:
72     
73         ./sign1    sign1-tmpl.xml    rsakey.pem
74         ./sign2    sign2-doc.xml     rsakey.pem
75         ./sign3    sign3-doc.xml     rsakey.pem rsacert.pem
76
77         ./verify1  sign1-res.xml     rsapub.pem
78         ./verify1  sign2-res.xml     rsapub.pem
79         ./verify2  sign1-res.xml     rsapub.pem
80         ./verify2  sign2-res.xml     rsapub.pem
81         ./verify3  sign3-res.xml     rootcert.pem
82         ./verify4  verify4-res.xml   rootcert.pem
83
84         ./encrypt1 encrypt1-tmpl.xml deskey.bin
85         ./encrypt2 encrypt2-doc.xml  deskey.bin 
86         ./encrypt3 encrypt3-doc.xml  rsakey.pem
87
88         ./decrypt1 encrypt1-res.xml  deskey.bin
89         ./decrypt1 encrypt2-res.xml  deskey.bin
90         ./decrypt2 encrypt1-res.xml  deskey.bin
91         ./decrypt2 encrypt2-res.xml  deskey.bin
92         ./decrypt3 encrypt1-res.xml
93         ./decrypt3 encrypt2-res.xml
94         ./decrypt3 encrypt3-res.xml
95     
96 4. Using xmlsec command line tool.
97 -------------------------
98 For Windows, use "xmlsec" instead of "xmlsec1".
99         xmlsec1 sign --privkey rsakey.pem --output sign1.xml sign1-tmpl.xml
100         xmlsec1 verify --pubkey rsapub.pem sign1.xml
101         xmlsec1 verify --pubkey rsapub.pem sign1-res.xml
102         xmlsec1 verify --pubkey rsapub.pem sign2-res.xml
103         xmlsec1 verify --trusted rootcert.pem sign3-res.xml
104         xmlsec1 verify --trusted rootcert.pem verify4-res.xml
105          
106         xmlsec1 encrypt --deskey deskey.bin  --binary-data binary.dat --output encrypt1.xml encrypt1-tmpl.xml
107         xmlsec1 decrypt --deskey deskey.bin encrypt1.xml
108         xmlsec1 decrypt --deskey deskey.bin encrypt1-res.xml
109         xmlsec1 decrypt --deskey deskey.bin encrypt2-res.xml
110         xmlsec1 decrypt --privkey rsakey.pem encrypt3-res.xml
111
112         
113         
114          
115          
116          
117          
118          
119
120          
121          
122          
123          
124          
125          
126