1 AutoGen Definitions options;
3 prog-title = "GnuTLS certificate tool";
4 prog-desc = "Manipulate certificates and private keys.";
5 detail = "Tool to parse and generate X.509 certificates, requests and private keys.
6 It can be used interactively or non interactively by
7 specifying the template command line option.
9 The tool accepts files or URLs supported by GnuTLS. In case PIN is required for the URL
10 access you can provide it using the environment variables GNUTLS_PIN and GNUTLS_SO_PIN.
12 short-usage = "certtool [options]\ncerttool --help for usage instructions.\n";
21 name = generate-self-signed;
23 descrip = "Generate a self-signed certificate";
28 name = generate-certificate;
30 descrip = "Generate a signed certificate";
35 name = generate-proxy;
36 descrip = "Generates a proxy certificate";
42 descrip = "Generate a CRL";
47 name = update-certificate;
49 descrip = "Update a signed certificate";
54 name = generate-privkey;
56 descrip = "Generate a private key";
61 name = generate-request;
63 descrip = "Generate a PKCS #10 certificate request";
65 doc = "Will generate a PKCS #10 certificate request. To specify a private key use --load-privkey.";
71 descrip = "Verify a PEM encoded certificate chain";
72 doc = "The last certificate in the chain must be a self signed one.";
77 descrip = "Verify a PEM encoded certificate chain using a trusted list";
78 doc = "The trusted certificate list can be loaded with --load-ca-certificate. If no
79 certificate list is provided, then the system's certificate list is used.";
84 descrip = "Verify a CRL using a trusted list";
85 doc = "The trusted certificate list must be loaded with --load-ca-certificate.";
86 flags-must = load-ca-certificate;
90 name = generate-dh-params;
91 descrip = "Generate PKCS #3 encoded Diffie-Hellman parameters";
97 descrip = "Get the included PKCS #3 encoded Diffie-Hellman parameters";
98 doc = "Returns stored DH parameters in GnuTLS. Those parameters are used in the SRP protocol. The parameters returned by fresh generation
99 are more efficient since GnuTLS 3.0.9.";
104 descrip = "Print information PKCS #3 encoded Diffie-Hellman parameters";
110 descrip = "Loads a private key file";
112 doc = "This can be either a file or a PKCS #11 URL";
117 descrip = "Loads a public key file";
119 doc = "This can be either a file or a PKCS #11 URL";
124 descrip = "Loads a certificate request file";
126 doc = "This option can be used with a file";
130 name = load-certificate;
131 descrip = "Loads a certificate file";
133 doc = "This option can be used with a file";
137 name = load-ca-privkey;
138 descrip = "Loads the certificate authority's private key file";
140 doc = "This can be either a file or a PKCS #11 URL";
144 name = load-ca-certificate;
145 descrip = "Loads the certificate authority's certificate file";
147 doc = "This option can be used with a file";
153 descrip = "Password to use";
154 doc = "You can use this option to specify the password in the command line instead of reading it from the tty. Note, that the command line arguments are available for view in others in the system. Specifying password as '' is the same as specifying no password.";
158 name = null-password;
159 descrip = "Enforce a NULL password";
160 doc = "This option enforces a NULL password. This is different than the empty or no password in schemas like PKCS #8.";
164 name = empty-password;
165 descrip = "Enforce an empty password";
166 doc = "This option enforces an empty password. This is different than the NULL or no password in schemas like PKCS #8.";
172 descrip = "Print big number in an easier format to parse";
178 descrip = "In certain operations it prints the information in C-friendly format";
179 doc = "In certain operations it prints the information in C-friendly format, suitable for including into C programs.";
183 name = certificate-info;
185 descrip = "Print information on the given certificate";
190 name = certificate-pubkey;
191 descrip = "Print certificate's public key";
196 name = pgp-certificate-info;
197 descrip = "Print information on the given OpenPGP certificate";
202 name = pgp-ring-info;
203 descrip = "Print information on the given OpenPGP keyring structure";
210 descrip = "Print information on the given CRL structure";
216 descrip = "Print information on the given certificate request";
222 name = no-crq-extensions;
223 descrip = "Do not use extensions in certificate requests";
229 descrip = "Print information on a PKCS #12 structure";
236 descrip = "The PKCS #12 friendly name to use";
237 doc = "The name to be used for the primary certificate and private key in a PKCS #12 file.";
242 descrip = "Print information on a PKCS #7 structure";
248 descrip = "Convert S/MIME to PKCS #7 structure";
255 descrip = "Print information on a private key";
261 descrip = "Print information on an OpenPGP private key";
267 descrip = "Print information on a public key";
268 doc = "The option combined with --load-request, --load-pubkey, --load-privkey and --load-certificate will extract the public key of the object in question.";
273 descrip = "Generate an X.509 version 1 certificate (with no extensions)";
279 descrip = "Generate a PKCS #12 structure";
280 doc = "It requires a certificate, a private key and possibly a CA certificate to be specified.";
281 flags-must = load-certificate;
286 descrip = "Generate a PKCS #8 structure";
293 descrip = "Use PKCS #8 format for private keys";
299 descrip = "Generate RSA key";
300 doc = "When combined with --generate-privkey generates an RSA private key.";
305 descrip = "Generate DSA key";
306 doc = "When combined with --generate-privkey generates a DSA private key.";
311 descrip = "Generate ECC (ECDSA) key";
312 doc = "When combined with --generate-privkey generates an elliptic curve private key to be used with ECDSA.";
323 descrip = "Hash algorithm to use for signing";
324 doc = "Available hash functions are SHA1, RMD160, SHA256, SHA384, SHA512.";
329 descrip = "Use DER format for input certificates, private keys, and DH parameters ";
332 doc = "The input files will be assumed to be in DER or RAW format.
333 Unlike options that in PEM input would allow multiple input data (e.g. multiple
334 certificates), when reading in DER format a single data structure is read.";
344 descrip = "Use DER format for output certificates, private keys, and DH parameters";
347 doc = "The output will be in DER or RAW format.";
358 descrip = "Specify the number of bits for key generate";
365 descrip = "Specify the curve used for EC key generation";
366 doc = "Supported values are secp192r1, secp224r1, secp256r1, secp384r1 and secp521r1.";
372 arg-name = "Security parameter";
373 descrip = "Specify the security level [low, legacy, medium, high, ultra]";
374 doc = "This is alternative to the bits option.";
378 name = disable-quick-random;
379 descrip = "No effect";
386 descrip = "Template file to use for non-interactive operation";
392 descrip = "Print information to stdout instead of stderr";
399 descrip = "Enable interaction for entering password when in batch mode.";
400 doc = "This option will enable interaction to enter password when in batch mode. That is useful when the template option has been specified.";
407 descrip = "Cipher to use for PKCS #8 and #12 operations";
408 doc = "Cipher may be one of 3des, 3des-pkcs12, aes-128, aes-192, aes-256, rc2-40, arcfour.";
414 descrip = "Specify the PKCS #11 provider library";
415 doc = "This will override the default options in /etc/gnutls/pkcs11.conf";
419 ds-type = 'SEE ALSO';
427 ds-type = 'EXAMPLES';
430 @subheading Generating private keys
431 To create an RSA private key, run:
433 $ certtool --generate-privkey --outfile key.pem --rsa
436 To create a DSA or elliptic curves (ECDSA) private key use the
437 above command combined with 'dsa' or 'ecc' options.
439 @subheading Generating certificate requests
440 To create a certificate request (needed when the certificate is issued by
443 certtool --generate-request --load-privkey key.pem \
444 --outfile request.pem
447 If the private key is stored in a smart card you can generate
448 a request by specifying the private key object URL.
450 $ ./certtool --generate-request --load-privkey "pkcs11:..." \
451 --load-pubkey "pkcs11:..." --outfile request.pem
455 @subheading Generating a self-signed certificate
456 To create a self signed certificate, use the command:
458 $ certtool --generate-privkey --outfile ca-key.pem
459 $ certtool --generate-self-signed --load-privkey ca-key.pem \
460 --outfile ca-cert.pem
463 Note that a self-signed certificate usually belongs to a certificate
464 authority, that signs other certificates.
466 @subheading Generating a certificate
467 To generate a certificate using the previous request, use the command:
469 $ certtool --generate-certificate --load-request request.pem \
470 --outfile cert.pem --load-ca-certificate ca-cert.pem \
471 --load-ca-privkey ca-key.pem
474 To generate a certificate using the private key only, use the command:
476 $ certtool --generate-certificate --load-privkey key.pem \
477 --outfile cert.pem --load-ca-certificate ca-cert.pem \
478 --load-ca-privkey ca-key.pem
481 @subheading Certificate information
482 To view the certificate information, use:
484 $ certtool --certificate-info --infile cert.pem
487 @subheading PKCS #12 structure generation
488 To generate a PKCS #12 structure using the previous key and certificate,
491 $ certtool --load-certificate cert.pem --load-privkey key.pem \
492 --to-p12 --outder --outfile key.p12
495 Some tools (reportedly web browsers) have problems with that file
496 because it does not contain the CA certificate for the certificate.
497 To work around that problem in the tool, you can use the
498 --load-ca-certificate parameter as follows:
501 $ certtool --load-ca-certificate ca.pem \
502 --load-certificate cert.pem --load-privkey key.pem \
503 --to-p12 --outder --outfile key.p12
506 @subheading Diffie-Hellman parameter generation
507 To generate parameters for Diffie-Hellman key exchange, use the command:
509 $ certtool --generate-dh-params --outfile dh.pem --sec-param medium
512 @subheading Proxy certificate generation
513 Proxy certificate can be used to delegate your credential to a
514 temporary, typically short-lived, certificate. To create one from the
515 previously created certificate, first create a temporary key and then
516 generate a proxy certificate for it, using the commands:
519 $ certtool --generate-privkey > proxy-key.pem
520 $ certtool --generate-proxy --load-ca-privkey key.pem \
521 --load-privkey proxy-key.pem --load-certificate cert.pem \
522 --outfile proxy-cert.pem
525 @subheading Certificate revocation list generation
526 To create an empty Certificate Revocation List (CRL) do:
529 $ certtool --generate-crl --load-ca-privkey x509-ca-key.pem \
530 --load-ca-certificate x509-ca.pem
533 To create a CRL that contains some revoked certificates, place the
534 certificates in a file and use @code{--load-certificate} as follows:
537 $ certtool --generate-crl --load-ca-privkey x509-ca-key.pem \
538 --load-ca-certificate x509-ca.pem --load-certificate revoked-certs.pem
541 To verify a Certificate Revocation List (CRL) do:
544 $ certtool --verify-crl --load-ca-certificate x509-ca.pem < crl.pem
554 @subheading Certtool's template file format
555 A template file can be used to avoid the interactive questions of
556 certtool. Initially create a file named 'cert.cfg' that contains the information
557 about the certificate. The template can be used as below:
560 $ certtool --generate-certificate --load-privkey key.pem \
561 --template cert.cfg --outfile cert.pem \
562 --load-ca-certificate ca-cert.pem --load-ca-privkey ca-key.pem
565 An example certtool template file that can be used to generate a certificate
566 request or a self signed certificate follows.
569 # X.509 Certificate options
573 # The organization of the subject.
574 organization = "Koko inc."
576 # The organizational unit of the subject.
577 unit = "sleeping dept."
579 # The locality of the subject.
582 # The state of the certificate owner.
585 # The country of the subject. Two letter code.
588 # The common name of the certificate owner.
591 # A user id of the certificate owner.
594 # Set domain components
598 # If the supported DN OIDs are not adequate you can set
600 # For example set the X.520 Title and the X.520 Pseudonym
601 # by using OID and string pairs.
602 #dn_oid = 2.5.4.12 Dr.
603 #dn_oid = 2.5.4.65 jackal
605 # This is deprecated and should not be used in new
607 # pkcs9_email = "none@@none.org"
609 # An alternative way to set the certificate's distinguished name directly
610 # is with the "dn" option. The attribute names allowed are:
611 # C (country), street, O (organization), OU (unit), title, CN (common name),
612 # L (locality), ST (state), placeOfBirth, gender, countryOfCitizenship,
613 # countryOfResidence, serialNumber, telephoneNumber, surName, initials,
614 # generationQualifier, givenName, pseudonym, dnQualifier, postalCode, name,
615 # businessCategory, DC, UID, jurisdictionOfIncorporationLocalityName,
616 # jurisdictionOfIncorporationStateOrProvinceName,
617 # jurisdictionOfIncorporationCountryName, XmppAddr, and numeric OIDs.
619 #dn = "cn=Nik,st=Attiki,C=GR,surName=Mavrogiannopoulos,2.5.4.9=Arkadias"
621 # The serial number of the certificate
622 # Comment the field for a time-based serial number.
625 # In how many days, counting from today, this certificate will expire.
626 # Use -1 if there is no expiration date.
627 expiration_days = 700
629 # Alternatively you may set concrete dates and time. The GNU date string
630 # formats are accepted. See:
631 # http://www.gnu.org/software/tar/manual/html_node/Date-input-formats.html
633 #activation_date = "2004-02-29 16:21:42"
634 #expiration_date = "2025-02-29 16:24:41"
636 # X.509 v3 extensions
638 # A dnsname in case of a WWW server.
639 #dns_name = "www.none.org"
640 #dns_name = "www.morethanone.org"
642 # A subject alternative name URI
643 #uri = "http://www.example.com"
645 # An IP address in case of a server.
646 #ip_address = "192.168.1.1"
648 # An email in case of a person
649 email = "none@@none.org"
651 # Challenge password used in certificate requests
652 challenge_password = 123456
654 # Password when encrypting a private key
657 # An URL that has CRLs (certificate revocation lists)
658 # available. Needed in CA certificates.
659 #crl_dist_points = "http://www.getcrl.crl/getcrl/"
661 # Whether this is a CA certificate or not
664 # Subject Unique ID (in hex)
665 #subject_unique_id = 00153224
667 # Issuer Unique ID (in hex)
668 #issuer_unique_id = 00153225
670 # for microsoft smart card logon
671 # key_purpose_oid = 1.3.6.1.4.1.311.20.2.2
673 ### Other predefined key purpose OIDs
675 # Whether this certificate will be used for a TLS client
678 # Whether this certificate will be used for a TLS server
681 # Whether this certificate will be used to sign data (needed
682 # in TLS DHE ciphersuites).
685 # Whether this certificate will be used to encrypt data (needed
686 # in TLS RSA ciphersuites). Note that it is preferred to use different
687 # keys for encryption and signing.
690 # Whether this key will be used to sign other certificates.
693 # Whether this key will be used to sign CRLs.
696 # Whether this key will be used to sign code.
699 # Whether this key will be used to sign OCSP data.
702 # Whether this key will be used for time stamping.
705 # Whether this key will be used for IPsec IKE operations.
708 ### end of key purpose OIDs
710 # When generating a certificate from a certificate
711 # request, then honor the extensions stored in the request
712 # and store them in the real certificate.
713 #honor_crq_extensions
715 # Path length contraint. Sets the maximum number of
716 # certificates that can be used to certify this certificate.
717 # (i.e. the certificate chain length)
722 # ocsp_uri = http://my.ocsp.server/ocsp
725 # ca_issuers_uri = http://my.ca.issuer
727 # Certificate policies
728 #policy1 = 1.3.6.1.4.1.5484.1.10.99.1.0
729 #policy1_txt = "This is a long policy to summarize"
730 #policy1_url = http://www.example.com/a-policy-to-read
732 #policy2 = 1.3.6.1.4.1.5484.1.10.99.1.1
733 #policy2_txt = "This is a short policy"
734 #policy2_url = http://www.example.com/another-policy-to-read
739 #nc_permit_dns = example.com
740 #nc_exclude_dns = test.example.com
743 #nc_permit_email = "nmav@@ex.net"
745 # Exclude subdomains of example.com
746 #nc_exclude_email = .example.com
748 # Exclude all e-mail addresses of example.com
749 #nc_exclude_email = example.com
752 # Options for proxy certificates
753 #proxy_policy_language = 1.3.6.1.5.5.7.21.1
756 # Options for generating a CRL
758 # The number of days the next CRL update will be due.
759 # next CRL update will be in 43 days
760 #crl_next_update = 43
762 # this is the 5th CRL by this CA
763 # Comment the field for a time-based number.