Not found locally for openssl-x509. Try Google search
openssl-x509 - Certificate display and signing command
| Use Case | Command | Description |
|---|---|---|
| đ Print certificate contents | openssl x509 -in cert.pem -noout -text | Display full certificate details in text form |
| đ Print subject alternative names | openssl x509 -in cert.pem -noout -ext subjectAltName | Show SAN extension(s) |
| đĸ Print serial number | openssl x509 -in cert.pem -noout -serial | Display certificate serial number |
| đ¤ Print subject name | openssl x509 -in cert.pem -noout -subject | Show certificate subject |
| đī¸ Print SHA1 fingerprint | openssl x509 -sha1 -in cert.pem -noout -fingerprint | Display SHA1 digest of DER-encoded certificate |
| đ Convert PEM to DER | openssl x509 -in cert.pem -inform PEM -out cert.der -outform DER | Change certificate format |
| đ Convert certificate to request | openssl x509 -x509toreq -in cert.pem -out req.pem -key key.pem | Generate PKCS#10 CSR from certificate |
| đī¸ Sign a request with CA | openssl x509 -req -in req.pem -CA cacert.pem -CAkey key.pem -CAcreateserial | Micro-CA signing of a CSR |
| đ Self-sign a request | openssl x509 -req -in careq.pem -extfile openssl.cnf -extensions v3_ca -key key.pem -out cacert.pem | Create self-signed certificate with extensions |
| â Check expiration | openssl x509 -in cert.pem -checkend 86400 | Check if certificate expires within 86400 seconds (1 day) |
openssl x509 [-help] [-in filename|uri] [-passin arg] [-new]
[-x509toreq] [-req] [-copy_extensions arg] [-inform DER|PEM] [-vfyopt
nm:v] [-key filename|uri] [-keyform DER|PEM|P12|ENGINE] [-signkey
filename|uri] [-out filename] [-outform DER|PEM] [-nocert] [-noout]
[-dateopt] [-text] [-certopt option] [-fingerprint] [-alias] [-serial]
[-startdate] [-enddate] [-dates] [-subject] [-issuer] [-nameopt option]
[-email] [-hash] [-subject_hash] [-subject_hash_old] [-issuer_hash]
[-issuer_hash_old] [-ext extensions] [-ocspid] [-ocsp_uri] [-purpose]
[-pubkey] [-modulus] [-checkend num] [-checkhost host] [-checkemail
host] [-checkip ipaddr] [-set_serial n] [-next_serial] [-days arg]
[-preserve_dates] [-subj arg] [-force_pubkey filename] [-clrext]
[-extfile filename] [-extensions section] [-sigopt nm:v] [-badsig]
[-digest] [-CA filename|uri] [-CAform DER|PEM|P12] [-CAkey
filename|uri] [-CAkeyform DER|PEM|P12|ENGINE] [-CAserial filename]
[-CAcreateserial] [-trustout] [-setalias arg] [-clrtrust] [-addtrust
arg] [-clrreject] [-addreject arg] [-rand files] [-writerand file]
[-engine id] [-provider name] [-provider-path path] [-propquery propq]
This command is a multi-purposes certificate handling command. It can be used to print certificate information, convert certificates to various forms, edit certificate trust settings, generate certificates from scratch or from certificate requests and then self-signing them or signing them like a "micro CA".
Since there are a large number of options they will split up into various sections.
-help â Print out a usage message.-in filename|uri â Specifies the input to read a certificate from or the input file for reading a certificate request if the -req flag is used. Defaults to standard input. Cannot be combined with -new.-passin arg â The key and certificate file password source. See openssl-passphrase-options(1).-new â Generate a certificate from scratch, not using an input certificate or request. Requires -subj. Public key from -force_pubkey or -key (implies self-signature).-x509toreq â Output a PKCS#10 certificate request (rather than a certificate). Requires -key for self-signing.-req â Expect a PKCS#10 certificate request as input (must be correctly self-signed).-copy_extensions arg â Handle X.509 extensions when converting between certificate and request. Values: none, copy, copyall.-inform DER|PEM â Input file format. See openssl-format-options(1).-vfyopt nm:v â Pass options to signature algorithm during verify operations.-key filename|uri â Private key for signing. Cannot be used with -CA. Sets issuer to subject (self-issued).-signkey filename|uri â Alias of -key.-keyform DER|PEM|P12|ENGINE â Key input format.-out filename â Output filename (default stdout).-outform DER|PEM â Output format (default PEM).-nocert â Do not output a certificate.-noout â Prevent output except for printing options.Note: -alias and -purpose are described in "Trust Settings" section.
-dateopt â Specify date output format: rfc_822 or iso_8601 (default rfc_822).-text â Prints certificate in text form (full details).-certopt option â Customise print format with -text. See "Text Printing Flags" below.-fingerprint â Calculate and print the digest of the DER-encoded certificate (fingerprint).-alias â Print certificate alias (nickname).-serial â Print certificate serial number.-startdate â Print notBefore date.-enddate â Print notAfter date.-dates â Print both start and expiry dates.-subject â Print subject name.-issuer â Print issuer name.-nameopt option â Display options for subject/issuer names. See openssl-namedisplay-options(1).-email â Print email addresses if any.-hash â Synonym for -subject_hash.-subject_hash â Print hash of subject name (used for directory indexing).-subject_hash_old â Print hash using older algorithm (pre-1.0.0).-issuer_hash â Print hash of issuer name.-issuer_hash_old â Print hash using older algorithm.-ext extensions â Print certificate extensions in text form. Comma-separated list.-ocspid â Print OCSP hash values for subject name and public key.-ocsp_uri â Print OCSP responder addresses.-purpose â Perform tests on certificate extensions and output results.-pubkey â Print SubjectPublicKeyInfo in PEM format.-modulus â Print value of modulus of public key.-checkend arg â Check if certificate expires within arg seconds. Exits nonzero if yes.-checkhost host â Check that certificate matches specified host.-checkemail email â Check that certificate matches specified email.-checkip ipaddr â Check that certificate matches specified IP address.-set_serial n â Set serial number (decimal or hex with "0x"). Overrides serial file if used with -CA.-next_serial â Set serial to one more than the number in the certificate.-days arg â Number of days until expiration (default 30). Cannot be used with -preserve_dates.-preserve_dates â Preserve notBefore/notAfter from input certificate. Cannot be used with -days.-subj arg â Set subject name (format: /type0=value0/type1=value1/...).-force_pubkey filename â Set public key from file instead of input/key option.-clrext â Clear all extensions from source when transforming.-extfile filename â Configuration file containing X.509 extensions to add.-extensions section â Section in extfile to use for extensions.-sigopt nm:v â Pass options to signature algorithm during signing (may be repeated).-badsig â Corrupt signature before writing (for testing).-digest â Digest to use (affects signing and printing). Default SHA1 for -fingerprint, SHA256 for signing.-CA filename|uri â CA certificate to use for signing. Behaves as "micro CA". Cannot be used with -key.-CAform DER|PEM|P12 â Format of CA certificate.-CAkey filename|uri â CA private key (must match CA certificate).-CAkeyform DER|PEM|P12|ENGINE â Format of CA key.-CAserial filename â Serial number file (default: CA certificate basename with .srl).-CAcreateserial â Create serial number file if missing (initial value "02", first serial "1").A trusted certificate is an ordinary certificate with additional information: permitted/prohibited uses and an alias. Trust settings are currently only used with root CAs.
-trustout â Mark output as trusted certificate. Automatically set if trust settings are modified.-setalias arg â Set alias (nickname) for the certificate.-clrtrust â Clear all permitted/trusted uses.-addtrust arg â Add a trusted certificate use (e.g., clientAuth, serverAuth, emailProtection).-clrreject â Clear all prohibited/rejected uses.-addreject arg â Add a prohibited trust anchor purpose.-rand files, -writerand file â Random state options. See openssl(1).-engine id â Engine options (deprecated).-provider name, -provider-path path, -propquery propq â Provider options. See openssl(1), provider(7), property(7).These options customise the -text output using -certopt:
compatible â Use old format (no printing options).no_header â Don't print "Certificate" and "Data" headers.no_version â Don't print version number.no_serial â Don't print serial number.no_signame â Don't print signature algorithm.no_validity â Don't print notBefore/notAfter.no_subject â Don't print subject name.no_issuer â Don't print issuer name.no_pubkey â Don't print public key.no_sigdump â Don't give hexadecimal dump of signature.no_aux â Don't print trust information.no_extensions â Don't print X509V3 extensions.ext_default â Default behaviour: attempt to print unsupported extensions.ext_error â Print error for unsupported extensions.ext_parse â ASN1 parse unsupported extensions.ext_dump â Hex dump unsupported extensions.ca_default â Value used by openssl-ca(1) (equivalent to no_issuer, no_pubkey, no_header, no_version).Note: In these examples, the '\' means the example should be all on one line.
đ Print the contents of a certificate:
openssl x509 -in cert.pem -noout -text
đ Print the "Subject Alternative Name" extension:
openssl x509 -in cert.pem -noout -ext subjectAltName
đ Print more extensions:
openssl x509 -in cert.pem -noout -ext subjectAltName,nsCertType
đĸ Print the certificate serial number:
openssl x509 -in cert.pem -noout -serial
đ¤ Print the subject name:
openssl x509 -in cert.pem -noout -subject
đˇī¸ Print subject name in RFC2253 form:
openssl x509 -in cert.pem -noout -subject -nameopt RFC2253
đ Print subject name in oneline form on a UTF8 terminal:
openssl x509 -in cert.pem -noout -subject -nameopt oneline,-esc_msb
đī¸ Print SHA1 fingerprint:
openssl x509 -sha1 -in cert.pem -noout -fingerprint
đ Convert PEM to DER:
openssl x509 -in cert.pem -inform PEM -out cert.der -outform DER
đ Convert certificate to request:
openssl x509 -x509toreq -in cert.pem -out req.pem -key key.pem
đī¸ Convert a certificate request into a self-signed CA certificate:
openssl x509 -req -in careq.pem -extfile openssl.cnf -extensions v3_ca \
-key key.pem -out cacert.pem
đ Sign a request using a CA certificate and add user extensions:
openssl x509 -req -in req.pem -extfile openssl.cnf -extensions v3_usr \
-CA cacert.pem -CAkey key.pem -CAcreateserial
đ Set certificate to be trusted for SSL client use and set alias:
openssl x509 -in cert.pem -addtrust clientAuth \
-setalias "Steve's Class 1 CA" -out trust.pem
-email option searches the subject name and subject alternative name extension. Only unique email addresses are printed.-subject_hash and -issuer_hash before OpenSSL 1.0.0 was based on MD5. In 1.0.0+ it uses SHA1 on a canonical DN. Directories must be rebuilt with openssl-rehash(1).-signkey option was renamed to -key in OpenSSL 3.0 (old name kept as alias).-engine option was deprecated in OpenSSL 3.0.-C option was removed in OpenSSL 3.0.Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at https://www.openssl.org/source/license.html.
Generated by phpman v4.10.0-7-g98e9fd5 Author: Che Dong Under GNU General Public License
2026-09-08 23:12 @2600:1f28:365:80b0:8430:39a8:2b19:a7ca
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)