d18eb8f19713140be61761ea87dc654c080e9cef
[openssl.git] / doc / apps / pkeyutl.pod
1 =pod
2
3 =head1 NAME
4
5 pkeyutl - public key algorithm utility
6
7 =head1 SYNOPSIS
8
9 B<openssl> B<pkeyutl>
10 [B<-in file>]
11 [B<-out file>]
12 [B<-sigfile file>]
13 [B<-inkey file>]
14 [B<-keyform PEM|DER>]
15 [B<-peerkey file>]
16 [B<-peerform PEM|DER>]
17 [B<-pubin>]
18 [B<-certin>]
19 [B<-rev>]
20 [B<-sign>]
21 [B<-verify>]
22 [B<-verifyrecover>]
23 [B<-encrypt>]
24 [B<-decrypt>]
25 [B<-derive>]
26 [B<-pkeyopt opt:value>]
27 [B<-hexdump>]
28 [B<-asn1parse>]
29
30 =head1 DESCRIPTION
31
32 The B<pkeyutl> command can be used to perform public key operations using
33 any supported algorithm.
34
35 =head1 COMMAND OPTIONS
36
37 =over 4
38
39 =item B<-in filename>
40
41 This specifies the input filename to read data from or standard input
42 if this option is not specified.
43
44 =item B<-out filename>
45
46 specifies the output filename to write to or standard output by
47 default.
48
49 =item B<-inkey file>
50
51 the input key file, by default it should be a private key.
52
53 =item B<-keyform PEM|DER>
54
55 the key format PEM or DER.
56
57 =item B<-peerkey file>
58
59 the peer key file, used by key derivation (agreement) operations.
60
61 =item B<-peerform PEM|DER>
62
63 the peer key format PEM or DER.
64
65 =item B<-pubin>
66
67 the input file is a public key. 
68
69 =item B<-certin>
70
71 the input is a certificate containing a public key. 
72
73 =item B<-sign>
74
75 sign the input data and output the signed result. This requires
76 a private key.
77
78 =item B<-verify>
79
80 verify the input data against the signature file and indicate if the
81 verification succeeded or failed.
82
83 =item B<-verifyrecover>
84
85 verify the input data and output the recovered data.
86
87 =item B<-encrypt>
88
89 encrypt the input data using a public key.
90
91 =item B<-decrypt>
92
93 decrypt the input data using a private key.
94
95 =item B<-derive>
96
97 derive a shared secret using the peer key.
98
99 =item B<-hexdump>
100
101 hex dump the output data.
102
103 =item B<-asn1parse>
104
105 asn1parse the output data, this is useful when combined with the
106 B<-verifyrecover> option when an ASN1 structure is signed.
107
108 =back
109
110 =head1 NOTES
111
112 The operations and options supported vary according to the key algorithm
113 and its implementation. The OpenSSL operations and options are indicated below.
114
115 =head1 RSA ALGORITHM
116
117 The RSA algorithm supports encrypt, decrypt, sign, verify and verifyrecover
118 operations in general. Some padding modes only support some of these 
119 operations however.
120
121 [NB: more to be added later]
122
123
124 =head1 EXAMPLES
125
126 Sign some data using a private key:
127
128  openssl pkeyutl -sign -in file -inkey key.pem -out sig
129
130 Recover the signed data (e.g. if an RSA key is used):
131
132  openssl pkeyutl -verifyrecover -in sig -inkey key.pem
133
134 Verify the signature (e.g. a DSA key):
135
136  openssl pkeyutl -verify -in file -sigfile sig -inkey key.pem
137
138 =head1 SEE ALSO
139
140 L<genpkey(1)|genpkey(1)>, L<pkey(1)|pkey(1)>, L<rsautl(1)|rsautl(1)>
141 L<dgst(1)|dgst(1)>, L<rsa(1)|rsa(1)>, L<genrsa(1)|genrsa(1)>