From: Tobias Brunner Date: Mon, 12 Aug 2013 15:46:40 +0000 (+0200) Subject: pki: Add pki --pub man page X-Git-Tag: 5.1.1dr4~25^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4adeaa5eb96346582c237fde181252e9f07ce683;p=thirdparty%2Fstrongswan.git pki: Add pki --pub man page --- diff --git a/configure.ac b/configure.ac index af8a34b33a..beca13c80d 100644 --- a/configure.ac +++ b/configure.ac @@ -1499,6 +1499,7 @@ AC_CONFIG_FILES([ src/pki/man/pki---keyid.8 src/pki/man/pki---pkcs7.8 src/pki/man/pki---print.8 + src/pki/man/pki---pub.8 src/pki/man/pki---req.8 src/pki/man/pki---self.8 src/pki/man/pki---signcrl.8 diff --git a/src/pki/commands/pub.c b/src/pki/commands/pub.c index 9912061f4b..5a658afecb 100644 --- a/src/pki/commands/pub.c +++ b/src/pki/commands/pub.c @@ -158,13 +158,13 @@ static void __attribute__ ((constructor))reg() pub, 'p', "pub", "extract the public key from a private key/certificate", {"[--in file|--keyid hex] [--type rsa|ecdsa|pkcs10|x509]", - "[--outform der|pem|pgp|dnskey]"}, + "[--outform der|pem|dnskey]"}, { {"help", 'h', 0, "show usage information"}, {"in", 'i', 1, "input file, default: stdin"}, {"keyid", 'x', 1, "keyid on smartcard of private key"}, {"type", 't', 1, "type of credential, default: rsa"}, - {"outform", 'f', 1, "encoding of extracted public key"}, + {"outform", 'f', 1, "encoding of extracted public key, default: der"}, } }); } diff --git a/src/pki/man/Makefile.am b/src/pki/man/Makefile.am index 7b6106543b..a4c092bb38 100644 --- a/src/pki/man/Makefile.am +++ b/src/pki/man/Makefile.am @@ -7,6 +7,7 @@ man8_MANS = \ pki---req.8 \ pki---pkcs7.8 \ pki---keyid.8 \ - pki---print.8 + pki---print.8 \ + pki---pub.8 CLEANFILES = $(man8_MANS) diff --git a/src/pki/man/ipsec-pki.8.in b/src/pki/man/ipsec-pki.8.in index 1a6a24c516..cea88a3a97 100644 --- a/src/pki/man/ipsec-pki.8.in +++ b/src/pki/man/ipsec-pki.8.in @@ -77,4 +77,5 @@ Verify a certificate using a CA certificate. .BR pki\ \-\-req (8), .BR pki\ \-\-pkcs7 (8), .BR pki\ \-\-keyid (8), -.BR pki\ \-\-print (8) +.BR pki\ \-\-print (8), +.BR pki\ \-\-pub (8) diff --git a/src/pki/man/pki---pub.8.in b/src/pki/man/pki---pub.8.in new file mode 100644 index 0000000000..38e751655f --- /dev/null +++ b/src/pki/man/pki---pub.8.in @@ -0,0 +1,75 @@ +.TH "PKI \-\-PUB" 8 "2013-07-31" "@PACKAGE_VERSION@" "strongSwan" +. +.SH "NAME" +. +pki \-\-pub \- Extract a public key from a private key or certificate +. +.SH "SYNOPSIS" +. +.SY pki\ \-\-pub +.RB [ \-\-in +.IR file | \fB\-\-keyid\fR +.IR hex ] +.OP \-\-type type +.OP \-\-outform encoding +.OP \-\-debug level +.YS +. +.SY pki\ \-\-pub +.BI \-\-options\~ file +.YS +. +.SY "pki \-\-pub" +.B \-h +| +.B \-\-help +.YS +. +.SH "DESCRIPTION" +. +This sub-command of +.BR ipsec\-pki (8) +extracts public keys from a private keys and certificates. +. +.SH "OPTIONS" +. +.TP +.B "\-h, \-\-help" +Print usage information with a summary of the available options. +.TP +.BI "\-v, \-\-debug " level +Set debug level, default: 1. +.TP +.BI "\-+, \-\-options " file +Read command line options from \fIfile\fR. +.TP +.BI "\-i, \-\-in " file +Input file. If not given the input is read from \fISTDIN\fR. +.TP +.BI "\-t, \-\-type " type +Type of input. One of \fIrsa\fR (RSA private key), \fIecdsa\fR (ECDSA +private key), \fIpkcs10\fR (PKCS#10 certificate request), \fIx509\fR (X.509 +certificate), defaults to \fIrsa\fR. +.TP +.BI "\-f, \-\-outform " encoding +Encoding of the extracted public key. One of \fIder\fR (ASN.1 DER), \fIpem\fR +(Base64 PEM), or \fIdnskey\fR (RFC 3110 DNS key), defaults to \fIder\fR. +. +.SH "EXAMPLES" +. +Extract the public key from an RSA private key: +.PP +.EX + ipsec pki --pub --in key.der > pub.der +.EE +.PP +Extract the public key from an X.509 certificate: +.PP +.EX + ipsec pki --pub --in cert.der --type x509 > pub.der +.EE +.PP +. +.SH "SEE ALSO" +. +.BR ipsec\-pki (8) \ No newline at end of file