2 * Copyright (c) 2005 - 2007 Kungliga Tekniska Högskolan
3 * (Royal Institute of Technology, Stockholm, Sweden).
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
17 * 3. Neither the name of the Institute nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 help = "List known OIDs"
38 function = "hxtool_list_oids"
43 name = "cms-create-sd"
49 argument = "certificate-store"
50 help = "certificate stores to pull certificates from"
56 argument = "signer-friendly-name"
57 help = "certificate to sign with"
62 argument = "certificate-store"
63 help = "trust anchors"
68 argument = "certificate-pool"
69 help = "certificate store to pull certificates from"
75 help = "password, prompter, or environment"
81 help = "oid that the peer support"
87 help = "content type oid"
92 help = "wrapped out-data in a ContentInfo"
97 help = "wrap out-data in PEM armor"
100 long = "detached-signature"
102 help = "create a detached signature"
112 help = "use subject name for CMS Identifier"
115 long = "embedded-certs"
117 help = "don't embed certificates"
120 long = "embed-leaf-only"
122 help = "only embed leaf certificate"
126 argument="in-file out-file"
127 help = "Wrap a file within a SignedData object"
130 name = "cms-verify-sd"
135 argument = "certificate-store"
136 help = "trust anchors"
142 argument = "certificate-store"
143 help = "certificate store to pull certificates from"
148 argument = "password"
149 help = "password, prompter, or environment"
152 long = "missing-revoke"
154 help = "missing CRL/OCSP is ok"
157 long = "content-info"
159 help = "unwrap in-data that's in a ContentInfo"
164 help = "unwrap in-data from PEM armor"
167 long = "signer-allowed"
169 help = "allow no signer"
172 long = "allow-wrong-oid"
174 help = "allow wrong oid flag"
177 long = "signed-content"
179 help = "file containing content"
184 help = "show symbolic name for OID"
188 argument="in-file [out-file]"
189 help = "Verify a file within a SignedData object"
192 name = "cms-unenvelope"
197 argument = "certificate-store"
198 help = "certificate used to decrypt the data"
203 argument = "password"
204 help = "password, prompter, or environment"
207 long = "content-info"
209 help = "wrapped out-data in a ContentInfo"
212 long = "allow-weak-crypto"
214 help = "allow weak crypto"
217 argument="in-file out-file"
218 help = "Unenvelope a file containing a EnvelopedData object"
221 name = "cms-envelope"
222 function = "cms_create_enveloped"
227 argument = "certificate-store"
228 help = "certificates used to receive the data"
233 argument = "password"
234 help = "password, prompter, or environment"
237 long = "encryption-type"
243 long = "content-type"
246 help = "content type oid"
249 long = "content-info"
251 help = "wrapped out-data in a ContentInfo"
254 long = "allow-weak-crypto"
256 help = "allow weak crypto"
259 argument="in-file out-file"
260 help = "Envelope a file containing a EnvelopedData object"
264 function = "pcert_verify"
268 argument = "password"
269 help = "password, prompter, or environment"
272 long = "allow-proxy-certificate"
274 help = "allow proxy certificates"
277 long = "missing-revoke"
279 help = "missing CRL/OCSP is ok"
284 help = "time when to validate the chain"
290 help = "verbose logging"
295 help = "maximum search length of certificate trust anchor"
300 help = "match hostname to certificate"
302 argument = "cert:foo chain:cert1 chain:cert2 anchor:anchor1 anchor:anchor2"
303 help = "Verify certificate chain"
307 function = "pcert_print"
311 argument = "password"
312 help = "password, prompter, or environment"
317 help = "print the content of the certificates"
322 help = "print the DER content of the certificates as JSON"
327 help = "never fail with an error code"
332 help = "print the information about the certificate store"
335 argument="certificate ..."
336 help = "Print certificates"
340 function = "pcert_validate"
344 argument = "password"
345 help = "password, prompter, or environment"
348 argument="certificate ..."
349 help = "Validate content of certificates"
352 name = "certificate-copy"
357 argument = "password"
358 help = "password, prompter, or environment"
363 argument = "password"
364 help = "password, prompter, or environment"
369 help = "append source to destination"
374 help = "do not copy root certificates"
377 long = "private-keys"
379 help = "do not copy private keys"
382 argument="in-certificates-1 ... out-certificate"
383 help = "Copy in certificates stores into out certificate store"
390 argument = "password"
391 help = "password, prompter, or environment"
396 argument = "certificate"
397 help = "certificate use to sign the request"
403 help = "part after host in url to put in the request"
409 help = "don't include nonce in request"
414 argument = "certificate-store"
415 help = "pool to find parent certificate in"
418 argument="outfile certs ..."
419 help = "Fetch OCSP responses for the following certs"
429 argument="certificates ..."
430 help = "Check that certificates are in OCSP file and valid"
440 argument="ocsp-response-file ..."
441 help = "Print the OCSP responses"
444 name = "revoke-print"
451 argument="ocsp/crl files"
452 help = "Print the OCSP/CRL files"
455 name = "generate-key"
464 help = "number of bits in the generated key";
469 help = "verbose status"
473 argument="output-file"
474 help = "Generate a private key"
477 name = "request-create"
481 help = "Request CA certificate"
484 long = "ca-path-length"
486 help = "Path length constraint for CA certificate"
492 help = "Include BasicConstraints w/ cA set to false"
502 argument = "oid-string"
503 help = "Add Extended Key Usage OID"
508 help = "Email address in SubjectAltName"
513 help = "XMPP (Jabber) address in SubjectAltName"
518 help = "Hostname or domainname in SubjectAltName"
523 help = "Kerberos principal name as SubjectAltName"
528 help = "Kerberos principal name as SubjectAltName (Microsoft variant)"
533 help = "Registered object ID as SubjectAltName"
538 help = "Directory name as SubjectAltName"
543 help = "Type of request CRMF or PKCS10, defaults to PKCS10"
551 long = "generate-key"
558 help = "number of bits in the generated key";
563 help = "verbose status"
567 argument="output-file"
568 help = "Create a CRMF or PKCS10 request"
571 name = "request-print"
575 help = "verbose printing"
578 argument="requests ..."
579 help = "Print requests"
591 help = "search for private key"
594 long = "friendlyname"
597 help = "match on friendly name"
602 argument = "oid-string"
603 help = "match on EKU"
608 argument = "expression"
609 help = "match on expression"
612 long = "keyEncipherment"
614 help = "match keyEncipherment certificates"
617 long = "digitalSignature"
619 help = "match digitalSignature certificates"
624 help = "print matches"
629 argument = "password"
630 help = "password, prompter, or environment"
633 argument="certificates ..."
634 help = "Query the certificates for a match"
643 help = "Generates random bytes and prints them to standard output"
649 help = "type of CMS algorithm"
654 help = "show symbolic names for OIDs"
656 name = "crypto-available"
658 help = "Print available CMS crypto types"
664 help = "type of CMS algorithm"
669 help = "source certificate limiting the choices"
672 long = "peer-cmstype"
674 help = "peer limiting cmstypes"
679 help = "show symbolic name for OID"
681 name = "crypto-select"
683 help = "Print selected CMS type"
690 help = "decode instead of encode"
693 function = "hxtool_hex"
695 help = "Encode input to hex"
701 help = "Issue a CA certificate"
706 help = "Issue a proxy certificate"
709 long = "domain-controller"
711 help = "Issue a MS domaincontroller certificate"
716 help = "Subject of issued certificate"
719 long = "ca-certificate"
721 help = "Issuing CA certificate"
726 help = "Issuing a self-signed certificate"
729 long = "ca-private-key"
731 help = "Private key for self-signed certificate"
736 help = "Issued certificate"
741 help = "Types of certificate to issue (can be used more then once)"
746 help = "Lifetime of certificate"
749 long = "signature-algorithm"
751 help = "Signature algorithm to use"
754 long = "serial-number"
756 help = "serial-number of certificate"
762 help = "Maximum path length (CA and proxy certificates), -1 no limit"
767 argument = "oid-string"
768 help = "Add Extended Key Usage OID"
773 help = "Key Usage (digitalSignature, keyEncipherment, dataEncipherment, keyAgreement, keyCertSign, cRLSign, encipherOnly, decipherOnly)"
778 help = "DNS names this certificate is allowed to serve"
783 help = "DNS SRV names this certificate is allowed to serve"
788 help = "email addresses assigned to this certificate"
791 long = "pk-init-principal"
793 help = "PK-INIT principal (for SAN)"
798 help = "Microsoft UPN (for SAN)"
803 help = "XMPP jabber id (for SAN)"
806 long = "permanent-id"
808 help = "PermanentIdentifier ([oid]:[serial])"
811 long = "hardware-module-name"
813 help = "HardwareModuleName (oid:serial)"
818 help = "Certificate Policy OID and optional URI and/or notice (OID:URI<space>notice_text)"
821 long = "policy-mapping"
823 help = "Certificate Policy mapping (OID:OID)"
826 long = "pkinit-max-life"
828 help = "maximum Kerberos ticket lifetime extension for PKINIT"
833 help = "certificate request"
836 long = "certificate-private-key"
841 long = "generate-key"
848 help = "number of bits in the generated key"
856 long = "template-certificate"
861 long = "template-fields"
865 name = "certificate-sign"
867 name = "issue-certificate"
869 function = "hxtool_ca"
871 help = "Issue a certificate"
878 argument = "password"
879 help = "password, prompter, or environment"
884 help = "verbose printing"
887 argument="certificates..."
888 help = "Test crypto system related to the certificates"
894 help = "type of statistics"
896 name = "statistic-print"
898 help = "Print statistics"
904 help = "signer certificate"
909 argument = "password"
910 help = "password, prompter, or environment"
915 help = "CRL output file"
920 help = "time the crl will be valid"
924 argument="certificates..."
925 help = "Create a CRL"
937 help = "check the first EE certificate in the store"
942 help = "check the first CA certificate in the store"
948 help = "check the nth certificate in the store"
953 argument = "expression"
954 help = "test the first certificate matching expression"
957 long = "has-email-san"
960 argument = "email-address"
961 help = "check that cert has email SAN"
964 long = "has-xmpp-san"
967 argument = "jabber address"
968 help = "check that cert has XMPP SAN"
971 long = "has-ms-upn-san"
975 help = "check that cert has UPN SAN"
978 long = "has-dnsname-san"
981 argument = "domainname"
982 help = "check that cert has domainname SAN"
985 long = "has-pkinit-san"
988 argument = "Kerberos principal name"
989 help = "check that cert has PKINIT SAN"
992 long = "has-registeredID-san"
996 help = "check that cert has registeredID SAN"
1003 help = "check that cert has EKU"
1009 argument = "key usage element"
1010 help = "check that cert has key usage"
1015 help = "check that cert has only given SANs/EKUs/KUs"
1021 help = "check that current time is in certicate's validity period"
1026 argument = "datetime"
1027 help = "check that the certificate is valid at given time"
1030 long = "not-after-eq"
1032 argument = "datetime"
1033 help = "check that the certificate's notAfter is as given"
1036 long = "not-after-lt"
1038 argument = "datetime"
1039 help = "check that the certificate's notAfter is before the given time"
1042 long = "not-after-gt"
1044 argument = "datetime"
1045 help = "check that the certificate's notAfter is after the given time"
1048 long = "not-before-eq"
1050 argument = "datetime"
1051 help = "check that the certificate's notBefore is as given"
1054 long = "not-before-lt"
1056 argument = "datetime"
1057 help = "check that the certificate's notBefore is before the given time"
1060 long = "not-before-gt"
1062 argument = "datetime"
1063 help = "check that the certificate's notBefore is after the given time"
1066 long = "has-private-key"
1068 help = "check that the certificate has a private key"
1071 long = "lacks-private-key"
1073 help = "check that the certificate does not have a private key"
1078 argument = "certificate-store"
1079 help = "Assert certificate content"
1084 argument = "[command]"
1087 help = "Help! I need somebody"