OPENSSL(1)
π NAME π
Ok so this is OPENSSL(1) from the General Commands Manual β aka the page for openssl, the OpenSSL command line tool. π
β¨ SYNOPSIS β¨
openssl command [command_opt ...] [command_arg ...]
openssl list-standard-commands | list-message-digest-commands |
list-cipher-commands | list-cipher-algorithms |
list-message-digest-algorithms | list-public-key-algorithms
openssl no-command
πΈ DESCRIPTION πΈ
Bestie. OpenSSL is a cryptography toolkit implementing the Transport Layer Security (TLS) network protocol, as well as related cryptography standards. π
The openssl program is a command line tool for using the various cryptography functions of openssl's crypto library from the shell.
The pseudo-commands list-standard-commands, list-message-digest-commands, and list-cipher-commands output a list (one entry per line) of the names of all standard commands, message digest commands, or cipher commands, respectively, that are available in the present openssl utility.
The pseudo-commands list-cipher-algorithms and list-message-digest-algorithms list all cipher and message digest names, one entry per line. Aliases are listed as:
from => to
The pseudo-command list-public-key-algorithms lists all supported public key algorithms.
The pseudo-command no-command tests whether a command of the specified name is available. If command does not exist, it returns 0 and prints no-command; otherwise it returns 1 and prints command. In both cases, the output goes to stdout and nothing is printed to stderr. Additional command line arguments are always ignored. Since for each cipher there is a command of the same name, this provides an easy way for shell scripts to test for the availability of ciphers in the openssl program.
Note:no-commandis not able to detect pseudo-commands such asquit,list-...-commands, orno-commanditself. π
π¦ ASN1PARSE π¦
openssl asn1parse [-i] [-dlimit number] [-dump] [-genconf file]
[-genstr str] [-in file] [-inform der | pem | txt]
[-length number] [-noout] [-offset number]
[-oid file] [-out file] [-strparse offset]
The asn1parse command is a diagnostic utility that can parse ASN.1 structures. It can also be used to extract data from ASN.1 formatted data. π§
The options are as follows:
-dlimit numberβ Dump the first number bytes of unknown data in hex form.-dumpβ Dump unknown data in hex form.-genconf file,-genstr strβ Generate encoded data based on string str, file file, or both, using the format described inASN1_generate_nconf(3). If only file is present then the string is obtained from the default section using the name βasn1β. The encoded data is passed through the ASN.1 parser and printed out as though it came from a file; the contents can thus be examined and written to a file using the-outoption.-iβ Indent the output according to the "depth" of the structures.-in fileβ The input file to read from, or standard input if not specified.-inform der | pem | txtβ The input format.-length numberβ Number of bytes to parse; the default is until end of file.-nooutβ Do not output the parsed version of the input file.-offset numberβ Starting offset to begin parsing; the default is start of file.-oid fileβ A file containing additional object identifiers (OIDs). If an OID (object identifier) is not part ofopenssl's internal table, it will be represented in numerical form (for example1.2.3.4).
Each line consists of three columns: the first column is the OID in numerical format and should be followed by whitespace. The second column is the "short name", which is a single word followed by whitespace. The final column is the rest of the line and is the "long name". asn1parse displays the long name. π
-out fileβ The DER-encoded output file; the default is no encoded output (useful when combined with-strparse).-strparse offsetβ Parse the content octets of the ASN.1 object starting at offset. This option can be used multiple times to "drill down" into a nested structure.
π CA π
openssl ca [-batch] [-cert file] [-config file] [-create_serial]
[-crl_CA_compromise time] [-crl_compromise time]
[-crl_hold instruction] [-crl_reason reason] [-crldays days]
[-crlexts section] [-crlhours hours] [-crlsec seconds]
[-days arg] [-enddate date] [-extensions section]
[-extfile file] [-gencrl] [-in file] [-infiles]
[-key password] [-keyfile file] [-keyform pem | der]
[-md alg] [-multivalue-rdn] [-name section] [-noemailDN]
[-notext] [-out file] [-outdir directory] [-passin arg]
[-policy arg] [-preserveDN] [-revoke file] [-selfsign]
[-sigopt nm:v] [-ss_cert file] [-startdate date]
[-status serial] [-subj arg] [-updatedb] [-utf8] [-verbose]
The ca command is a minimal certificate authority (CA) application. It can be used to sign certificate requests in a variety of forms and generate certificate revocation lists (CRLs). It also maintains a text database of issued certificates and their status. π
The options relevant to CAs are as follows:
-batchβ Batch mode. In this mode no questions will be asked and all certificates will be certified automatically.-cert fileβ The CA certificate file.-config fileβ Specify an alternative configuration file.-create_serialβ If reading the serial from the text file as specified in the configuration fails, create a new random serial to be used as the next serial number.-days argβ The number of days to certify the certificate for.-enddate dateβ Set the expiry date. The format of the date is[YY]YYMMDDHHMMSSZ, with all four year digits required for dates from 2050 onwards.-extensions sectionβ The section of the configuration file containing certificate extensions to be added when a certificate is issued (defaults tox509_extensionsunless the-extfileoption is used). If no extension section is present, a V1 certificate is created. If the extension section is present (even if it is empty), then a V3 certificate is created. See thex509v3.cnf(5)manual page for details of the extension section format.-extfile fileβ An additional configuration file to read certificate extensions from (using the default section unless the-extensionsoption is also used).-in fileβ An input file containing a single certificate request to be signed by the CA.-infilesβ If present, this should be the last option; all subsequent arguments are assumed to be the names of files containing certificate requests.-key passwordβ The password used to encrypt the private key. Since on some systems the command line arguments are visible, this option should be used with caution. β οΈ-keyfile fileβ The private key to sign requests with.-keyform pem | derβ Private key file format. The default ispem.-md algβ The message digest to use. Possible values includemd5andsha1. This option also applies to CRLs.-multivalue-rdnβ This option causes the-subjargument to be interpreted with full support for multivalued RDNs, for example"/DC=org/DC=OpenSSL/DC=users/UID=123456+CN=John Doe". If-multivalue-rdnis not used, the UID value is set to"123456+CN=John Doe".-name sectionβ Specifies the configuration file section to use (overridesdefault_cain thecasection).-noemailDNβ The DN of a certificate can contain the EMAIL field if present in the request DN, however it is good policy just having the email set into the altName extension of the certificate. When this option is set, the EMAIL field is removed from the certificate's subject and set only in the, eventually present, extensions. Theemail_in_dnkeyword can be used in the configuration file to enable this behaviour.-notextβ Don't output the text form of a certificate to the output file.-out fileβ The output file to output certificates to. The default is standard output. The certificate details will also be printed out to this file in PEM format.-outdir directoryβ The directory to output certificates to. The certificate will be written to a file consisting of the serial number in hex with".pem"appended.-passin argβ The key password source.-policy argβ Define the CA "policy" to use. The policy section in the configuration file consists of a set of variables corresponding to certificate DN fields. The values may be one of "match" (the value must match the same field in the CA certificate), "supplied" (the value must be present), or "optional" (the value may be present). Any fields not mentioned in the policy section are silently deleted, unless the-preserveDNoption is set, but this can be regarded more of a quirk than intended behaviour. π-preserveDNβ Normally, the DN order of a certificate is the same as the order of the fields in the relevant policy section. When this option is set, the order is the same as the request. This is largely for compatibility with the older IE enrollment control which would only accept certificates if their DNs matched the order of the request. This is not needed for Xenroll.-selfsignβ Indicates the issued certificates are to be signed with the key the certificate requests were signed with, given with-keyfile. Certificate requests signed with a different key are ignored. If-gencrlor-ss_certare given,-selfsignis ignored.
A consequence of using -selfsign is that the self-signed certificate appears among the entries in the certificate database (see the configuration option database) and uses the same serial number counter as all other certificates signed with the self-signed certificate.
-sigopt nm:vβ Pass options to the signature algorithm during sign or certify operations. The names and values of these options are algorithm-specific.-ss_cert fileβ A single self-signed certificate to be signed by the CA.-startdate dateβ sets the start date β¨ the format is[YY]YYMMDDHHMMSSZ, and heads up: all four year digits are required for dates from 2050 onwards, so no cutting corners there bestie.-subj argβ supersedes the subject name given in the request. The arg has to be formatted like/type0=value0/type1=value1/type2=...; characters can be escaped with\(backslash), and no spaces are skipped. Slippery little format, so pay attention π-utf8β interprets field values read from a terminal, or grabbed from a configuration file, as UTF-8 strings. By default they're interpreted as ASCII, which is giving "grandma's default settings" energy.-verboseβ prints extra details about the operations being performed. For the nosy girlies (affectionate) π
Okay so now the CRL girlies get their own little corner β the options relevant to CRLs are as follows:
-crl_CA_compromise timeβ literally the same as-crl_compromise, except the revocation reason is set toCACompromiseπ-crl_compromise timeβ sets the revocation reason tokeyCompromiseand the compromise time to time. time should be in GeneralizedTime format, i.e.YYYYMMDDHHMMSSZ.-crl_hold instructionβ sets the CRL revocation reason code tocertificateHoldand the hold instruction to instruction, which must be an OID. Although any OID can be used, onlyholdInstructionNone(the use of which is discouraged by RFC 2459),holdInstructionCallIssuerorholdInstructionRejectwill normally be used. iykyk.-crl_reason reasonβ revocation reason, where reason is one of:unspecified,keyCompromise,CACompromise,affiliationChanged,superseded,cessationOfOperation,certificateHoldorremoveFromCRL. The matching of reason is case insensitive π«Ά Setting any revocation reason will make the CRL v2. In practice,removeFromCRLis not particularly useful because it is only used in delta CRLs which are not currently implemented β so like, don't come for it.-crldays daysβ the number of days before the next CRL is due. This is the days from now to place in the CRLnextUpdatefield.-crlexts sectionβ the section of the configuration file containing CRL extensions to include. If no CRL extension section is present then a V1 CRL is created; if the CRL extension section is present (even if it's empty!) then a V2 CRL is created. The CRL extensions specified are CRL extensions and not CRL entry extensions. It should be noted that some software can't handle V2 CRLs π See thex509v3.cnf(5)manual page for details of the extension section format.-crlhours hoursβ the number of hours before the next CRL is due.-crlsec secondsβ the number of seconds before the next CRL is due. Yes we went all the way down to seconds, the precision is impeccable π-gencrlβ generate a CRL based on information in the index file.-revoke fileβ a file containing a certificate to revoke. Rip bozo πͺ¦-status serialβ show the status of the certificate with serial number serial.-updatedbβ update the database index to purge expired certificates. Spring cleaning era πΈ
Many of the options can be set in the ca section of the configuration file (or in the default section of the configuration file), specified using default_ca or -name. The preserve option is read directly from the ca section.
Many of the configuration file options are identical to command line options. Where the option is present in the configuration file and the command line, the command line value is used. Where an option is described as mandatory, then it must be present in the configuration file or the command line equivalent (if any) used. No skipping the mandatory ones, bestie, it's giving non-negotiable β
certificateβ the same as-cert. It gives the file containing the CA certificate. Mandatory.copy_extensionsβ decides how extensions in certificate requests should be handled π- if set to
none, or this option is not present, then extensions are ignored and not copied to the certificate. - if set to
copy, then any extensions present in the request that are not already present are copied to the certificate. - if set to
copyall, then all extensions in the request are copied to the certificate: if the extension is already present in the certificate it is deleted first.
- if set to
β οΈ thecopy_extensionsoption should be used with caution. If care is not taken, it can be a security risk. For example, if a certificate request contains abasicConstraintsextension withCA:TRUEand thecopy_extensionsvalue is set tocopyalland the user does not spot this when the certificate is displayed, then this will hand the requester a valid CA certificate. Like, actual yikes π
This situation can be avoided by settingcopy_extensionstocopyand includingbasicConstraintswithCA:FALSEin the configuration file. Then if the request contains abasicConstraintsextension, it will be ignored. Slay, problem solved π
The main use of this option is to allow a certificate request to supply values for certain extensions such as subjectAltName.
crl_extensionsβ the same as-crlexts.crlnumberβ a text file containing the next CRL number to use in hex. The CRL number will be inserted in the CRLs only if this file exists. If this file is present, it must contain a valid CRL number. No fake numbers allowed, it's giving strict πdatabaseβ the text database file to use. Mandatory. This file must be present, though initially it will be empty. Empty is fine, absent is not.default_crl_hours,default_crl_daysβ the same as the-crlhoursand-crldaysoptions. These will only be used if neither command line option is present. At least one of these must be present to generate a CRL.default_daysβ the same as the-daysoption. The number of days to certify a certificate for.default_enddateβ the same as the-enddateoption. Either this option ordefault_days(or the command line equivalents) must be present.default_mdβ the same as the-mdoption. The message digest to use. Mandatory.default_startdateβ the same as the-startdateoption. The start date to certify a certificate for. If not set, the current time is used.email_in_dnβ the same as-noemailDN. If the EMAIL field is to be removed from the DN of the certificate, simply set this to"no". If not present, the default is to allow for the EMAIL field in the certificate's DN.name_opt,cert_optβ these options allow the format used to display the certificate details when asking the user to confirm signing. All the options supported by thex509utilities'-nameoptand-certoptswitches can be used here, except thatno_signameandno_sigdumpare permanently set and cannot be disabled (this is because the certificate signature cannot be displayed because the certificate has not been signed at this point β timeline issues, truly). For convenience, the valueca_defaultis accepted by both to produce a reasonable output. If neither option is present, the format used in earlier versions ofopensslis used. Use of the old format is strongly discouraged because it only displays fields mentioned in thepolicysection, mishandles multicharacter string types and does not display extensions. Old format is NOT the moment, don't do it πnew_certs_dirβ the same as the-outdircommand line option. It specifies the directory where new certificates will be placed. Mandatory.oid_fileβ this specifies a file containing additional object identifiers. Each line of the file should consist of the numerical form of the object identifier followed by whitespace, then the short name followed by whitespace and finally the long name. Order matters, bestie, don't freestyle it β¨oid_sectionβ this specifies a section in the configuration file containing extra object identifiers. Each line should consist of the short name of the object identifier followed by=and the numerical form. The short and long names are the same when this option is used.policyβ the same as-policy. Mandatory.preserveβ the same as-preserveDN.private_keyβ same as the-keyfileoption. The file containing the CA private key. Mandatory.serialβ a text file containing the next serial number to use in hex. Mandatory. This file must be present and contain a valid serial number. No vibes-based serials πunique_subjectβ if the valueyesis given, the valid certificate entries in the database must have unique subjects. If the valuenois given, several valid certificate entries may have the exact same subject. The default value isyes. Note that it is valid in some circumstances for certificates to be created without any subject. In cases where there are multiple certificates without subjects this does not count as a duplicate π«Άx509_extensionsβ the same as-extensions.
π CERTHASH
openssl certhash [-nv] dir ...
The certhash command calculates a hash value of ".pem" file in the specified directory list and creates symbolic links for each file, where the name of the link is the hash value. See the SSL_CTX_load_verify_locations(3) manual page for how hash links are used.
The links created are of the form "HHHHHHHH.D", where each H is a hexadecimal character and D is a single decimal digit. The hashes for CRLs look similar, except the letter r appears after the period, like this: "HHHHHHHH.rD". When processing a directory, certhash will first remove all links that have a name in that syntax and invalid reference.
Multiple objects may have the same hash; they will be indicated by incrementing the D value. Duplicates are found by comparing the full SHA256 fingerprint. A warning will be displayed if a duplicate is found π
A warning will also be displayed if there are files that cannot be parsed as either a certificate or a CRL. Not everything is a cert, and that's okay π¦
The options are as follows:
-nβ perform a dry-run, and do not make any changes. Look but don't touch π-vβ print extra details about the processing.dir ...β specify the directories to process.
β¨ CIPHERS β¨
openssl ciphers [-hsVv] [-tls1_2] [-tls1_3] [control]
Okay so real talk, ciphers is the glow-up machine for cipher lists π
It takes that control string (the format is documented over in SSL_CTX_set_cipher_list(3), go read it, iykyk) and turns it into an ordered SSL cipher suite preference list. No control string given? Then you just get the DEFAULT list printed out. Cute, simple, slay.
The options are as follows, bestie:
-h,-?β Print a brief usage message. A little help never hurt nobody π«Ά-sβ Only list ciphers that are supported by the TLS method. No flops allowed β¨-tls1_2|-tls1_3β Team up with the-soption and this lists the ciphers which could be used if the specified protocol version were negotiated. Version-specific vibe check π₯-Vβ Verbose mode, the main character option. Lists ciphers with cipher suite code in hex format, cipher name, and a complete description of protocol version, key exchange, authentication, encryption, and mac algorithms. It's giving full lore dump π-vβ Like-V, but without cipher suite codes. Same energy, less hex π
πΈ CMS πΈ
openssl cms [-aes128 | -aes192 | -aes256 | -camellia128 |
-camellia192 | -camellia256 | -des | -des3 |
-rc2-40 | -rc2-64 | -rc2-128] [-CAfile file]
[-CApath directory] [-CRLfile file] [-binary]
[-certfile file] [-certsout file] [-cmsout] [-content file]
[-crlfeol] [-data_create] [-data_out] [-debug_decrypt]
[-decrypt] [-digest_create] [-digest_verify]
[-econtent_type type] [-encrypt] [-EncryptedData_decrypt]
[-EncryptedData_encrypt] [-from addr] [-in file]
[-inform der | pem | smime] [-inkey file]
[-keyform der | pem] [-keyid] [-keyopt nm:v] [-md digest]
[-no_attr_verify] [-no_content_verify]
[-no_signer_cert_verify] [-noattr] [-nocerts] [-nodetach]
[-nointern] [-nooldmime] [-noout] [-nosigs] [-nosmimecap]
[-noverify] [-out file] [-outform der | pem | smime]
[-passin src] [-print] [-pwri_password arg]
[-rctform der | pem | smime]
[-receipt_request_all | -receipt_request_first]
[-receipt_request_from addr] [-receipt_request_print]
[-receipt_request_to addr] [-recip file] [-resign]
[-secretkey key] [-secretkeyid id] [-sign] [-sign_receipt]
[-signer file] [-stream | -indef | -noindef] [-subject s]
[-text] [-to addr] [-verify] [-verify_receipt file]
[-verify_retcode] [cert.pem ...]
So cms handles S/MIME v3.1 mail π It can encrypt, decrypt, sign and verify S/MIME messages. The full package, periodt.
Now listen, because this trips people up: the MIME message must be sent without any blank lines between the headers and the output. Some mail programs will automatically add a blank line β rude of them, honestly π Piping the mail directly to sendmail is one way to achieve the correct format. And the supplied message to be signed or encrypted must include the necessary MIME headers or many S/MIME clients won't display it properly (if at all). You can use the -text option to automatically add plain text headers. Ty for that one, king π
A "signed and encrypted" message is one where a signed message is then encrypted π This can be produced by encrypting an already signed message. Stacking the layers like an iconic little outfit.
There are various operation options that set the type of operation to be performed. The meaning of the other options varies according to the operation type. So pick your operation first, then everything else reads differently. Vibe check accordingly β
-encryptβ Encrypt mail for the given recipient certificates. Input file is the message to be encrypted. Output file is the encrypted mail in MIME format. The actual CMS type isEnvelopedData. β οΈ Note that no revocation check is done for the recipient cert, so if that key has been compromised, others may be able to decrypt the text. That's not a vibe, that's a warning, take it seriously π-decryptβ Decrypt mail using the supplied certificate and private key. Expects an encrypted mail message in MIME format for the input file. The decrypted mail is written to the output file. Unwrapping the gift π-signβ Sign mail using the supplied certificate and private key. Input file is the message to be signed. The signed message in MIME format is written to the output file. Signing your work, as you should βοΈ-verifyβ Verify signed mail. Expects a signed mail message on input and outputs the signed data. Both clear text and opaque signing are supported. Trust but verify, bestie π΅οΈ-cmsoutβ Take an input message and write out a PEM encoded CMS structure. Structural, literally.-resignβ Resign a message. Take an existing message and one or more new signers. This operation uses an existing message digest when adding a new signer β which means attributes must be present in at least one existing signer using the same message digest or this operation will fail. No attributes, no dice π«-data_createβ Create a CMSDatatype.-data_outβ Output a content from the input CMSDatatype.-digest_createβ Create a CMSDigestedDatatype.-digest_verifyβ Verify a CMSDigestedDatatype and output the content.-EncryptedData_encryptβ Encrypt a content using supplied symmetric key and algorithm using a CMSEncryptedDatatype.-EncryptedData_decryptβ Decrypt a CMSEncryptedDatatype using supplied symmetric key.-sign_receiptβ Generate and output a signed receipt for the supplied message. The input message must contain a signed receipt request. Functionality is otherwise similar to the-signoperation. Receipt szn π§Ύ-verify_receipt fileβ Verify a signed receipt in file. The input message must contain the original receipt request. Functionality is otherwise similar to the-verifyoperation.
The remaining options are as follows:
-aes128|-aes192|-aes256|-camellia128|-camellia192|-camellia256|-des|-des3|-rc2-40|-rc2-64|-rc2-128β The encryption algorithm to use. That's 128-, 192-, or 256-bit AES; 128-, 192-, or 256-bit CAMELLIA; DES (56 bits); triple DES (168 bits); or 40-, 64-, or 128-bit RC2, respectively. If not specified, 256-bit AES is used. Only used with the-encryptand-EncryptedData_encryptcommands. Choose your fighter π-binaryβ Normally the input message is converted to "canonical" format, which is effectively using CR/LF as end of line, as required by the S/MIME specification. When this option is present, no translation occurs. Useful when handling binary data which may not be in MIME format. Leave it raw, no notes π¦-CAfile fileβ A file containing trusted CA certificates, used with-verifyand-verify_receipt.-CApath directoryβ A directory containing trusted CA certificates, used with-verifyand-verify_receipt. This directory must be a standard certificate directory: that is, a hash of each subject name (usingx509 -hash) should be linked to each certificate. Folder discipline, bestie π-CRLfile fileβ Allows additional certificate revocation lists to be specified for verification. The CRLs should be in PEM format.cert.pem ...β One or more certificates of message recipients, used when encrypting a message.-certfile fileβ Allows additional certificates to be specified. When signing, these will be included with the message. When verifying, these will be searched for the signer's certificates. The certificates should be in PEM format.-certsout fileβ A file that any certificates contained in the message are written to.-check_ss_sig,-crl_check,-crl_check_all,-extended_crl,-ignore_critical,-issuer_checks,-policy,-policy_check,-purpose,-x509_strictβ Set various certificate chain validation options. See theverifycommand for details. The whole validation crew, assembled π-content fileβ A file containing the detached content. This is only useful with the-verifycommand, and only usable if the CMS structure is using the detached signature form where the content is not included. This option will override any content if the input format is S/MIME and it uses themultipart/signedMIME content type.-crlfeolβ Output an S/MIME message with CR/LF end of line.-debug_decryptβ Set theCMS_DEBUG_DECRYPTflag when decrypting. β οΈ This option should be used with caution, since this can be used to disable the MMA attack protection and return an error if no recipient can be found. See theCMS_decrypt(3)manual page for details of the flag. Debug responsibly, please π-from addr,-subject s,-to addrβ The relevant mail headers. These are included outside the signed portion of a message, so they may be included manually. If signing, then many S/MIME mail clients check that the signer's certificate's email address matches that specified in theFrom:address. Header drama, but make it cryptographic βοΈ-econtent_type typeβ Set the encapsulated content type, used with-sign. If not supplied, theDatatype is used. The type argument can be any valid OID name in either text or numerical format.-in fileβ The input message to be encrypted or signed, or the message to be decrypted or verified.-inform der | pem | smimeβ The input format for the CMS structure. The default issmime, which reads an S/MIME format message.pemandderchange this to expect PEM and DER format CMS structures instead. This currently only affects the input format of the CMS structure; if no CMS structure is being input (for example with-encryptor-sign) this option has no effect. Just so you don't sit there confused π-inkey fileβ The private key to use when signing or decrypting. This must match the corresponding certificate. If this option is not specified then the private key must be included in the certificate file specified with the-recipor-signerfile. When signing, this option can be used multiple times to specify successive keys. Key rotation era π-keyform der | pemβ Input private key format. The default ispem.-keyidβ Use subject key identifier to identify certificates instead of issuer name and serial number. The supplied certificate must include a subject key identifier extension. Supported by-signand-encryptoperations.-keyopt nm:vβ Set customised parameters for the preceding key or certificate for encryption and signing. It can currently be used to set RSA-PSS for signing, RSA-OAEP for encryption, or to modify default parameters for ECDH. This option can be used multiple times. Tune it how you like ποΈ-md digestβ The digest algorithm to use when signing or resigning. If not present then the default digest algorithm for the signing key will be used (usuallySHA1).-no_attr_verifyβ Do not verify the signer's attribute of a signature.-no_content_verifyβ Do not verify the content of a signed message.-no_signer_cert_verifyβ skips verifying the signer's certificate on a signed message. like, trust falls but nobody's catching you π«Ά-noattrβ don't include attributes. normally when you sign something, a whole little bundle of attributes comes along (the signing time, the supported symmetric algorithms, all that). this option β¨ yeets β¨ them.-nocertsβ don't include the signer's certificate. it makes the signed message smol π but the verifier has to already have a copy of that certificate locally (like, passed in with the-certfileoption, for example), otherwise it's giving "who dis."-nodetachβ when signing, use opaque signing. this form is more resistant to getting mangled by mail relays, but mail agents that don't support S/MIME can't read it. without this option you get cleartext signing with the MIME typemultipart/signed.-nointernβ only the certs you listed in-certfileget used. normally when verifying, the certificates included in the message (if there are any) get searched for the signing certificate. but fr, the supplied certs can still be used as untrusted CAs.-nooldmimeβ outputs an old S/MIME content type, like"application/x-pkcs7-". retro vibes π-nooutβ don't output the parsed CMS structure for the-cmsoutoperation. super useful when you pair it with-print, or when you're just checking whether the CMS structure's syntax is even valid.-nosigsβ do not attempt to verify the signatures on the message. we're skipping that part bestie π-nosmimecapβ excludes the list of supported algorithms from the signed attributes. other stuff, like signing time and content type, still gets included.-noverifyβ do not verify the signer's certificate of a signed message.-outfile β the message text that's been decrypted or verified, or the output MIME format message that's been signed or verified. β¨-outform der | pem | smimeβ specifies the output format for the CMS structure. default issmime, which writes an S/MIME format message.pemandderchange that to write PEM and DER format CMS structures instead. heads up: this currently only affects the output format of the CMS structure β if no CMS structure is being output (like with-verifyor-decrypt), this option does literally nothing. π-passinsrc β the private key password source. ποΈ-printβ prints out all fields of the CMS structure for the-cmsoutoperation. mainly a testing thing, ngl.-pwri_passwordarg β specify the PasswordRecipientInfo (PWRI) password to use. supported by the-encryptand-decryptoperations.-rctform der | pem | smimeβ specifies the format for a signed receipt, for use with the-receipt_verifyoperation. default issmime.-receipt_request_all|-receipt_request_firstβ says receipts should be provided by all recipients, or by first tier recipients only (meaning the ones mailed directly, not the ones coming from a mailing list), for the-signoperation to include a signed receipt request. ignored if-receipt_request_fromis included.-receipt_request_fromaddr β adds an explicit email address where receipts should be supplied. π¬-receipt_request_printβ prints out the contents of any signed receipt requests, for the-verifyoperation.-receipt_request_toaddr β adds an explicit email address where signed receipts should be sent. this option must be supplied if a signed receipt is requested β no address, no receipt, periodt.-recipfile β when decrypting a message, this specifies the recipient's certificate. it has to match one of the message's recipients or you get an error. when encrypting, you can use this option multiple times to specify each recipient. you gotta use this form if you need customised parameters (for example, specifying RSA-OAEP). only certificates carrying RSA, Diffie-Hellman or EC keys are supported by this option.-secretkeykey β specify the symmetric key to use. it must be supplied in hex format and be consistent with the algorithm being used. supported by the-EncryptedData_encrypt,-EncryptedData_decrypt,-encryptand-decryptoperations. when used with-encryptor-decrypt, the supplied key wraps or unwraps the content encryption key using an AES key in the KEKRecipientInfo type.-secretkeyidid β the key identifier for the supplied symmetric key, for the KEKRecipientInfo type. this option must be present if-secretkeyis used with-encrypt. with-decrypt, the id is used to locate the relevant key; if it's not supplied, an attempt is made to decrypt any KEKRecipientInfo structures.-signerfile β a signing certificate, for when you're signing or resigning a message. can be used multiple times if you need more than one signer, because sometimes one icon just isn't enough π. if a message is being verified, the signers' certificates get written to this file if the verification was successful.-stream|-indef|-noindefβ-streamand-indefare equivalent and enable streaming I/O for encoding operations. this permits single pass processing of data without holding the entire contents in memory, so it can potentially support very large files. streaming is automatically set for S/MIME signing with detached data if the output format issmime; it's currently off by default for all other operations.-noindefdisables streaming I/O where it would produce an indefinite length constructed encoding β note that this option currently has no effect. π-textβ adds plain text (text/plain) MIME headers to the supplied message if you're encrypting or signing. if you're decrypting or verifying, it strips off the text headers β and if the decrypted or verified message isn't of MIME typetext/plain, you get an error. vibe check failed π-verify_retcodeβ sets the verification error code as the exit code, so you can tell what verification error occurred. supported by the-verifyoperation only. exit code value minus 32 shows the verification error code. seeverifycommand for the list of verification error codes.
The exit codes for cms are as follows:
0 The operation was completely successful.
1 An error occurred parsing the command options.
2 One of the input files could not be read.
3 An error occurred creating the CMS file or when reading the
MIME message.
4 An error occurred decrypting or verifying the message.
5 The message was verified correctly but an error occurred
writing out the signer's certificates.
6 An error occurred writing the output file.
32+ A verify error occurred while -verify_retcode is specified.
π CRL π
okay so here's the vibe:
openssl crl [-CAfile file] [-CApath dir] [-crlnumber] [-fingerprint]
[-hash] [-hash_old] [-in file] [-inform der | pem]
[-issuer] [-lastupdate] [-nameopt option] [-nextupdate]
[-noout] [-out file] [-outform der | pem] [-text] [-verify]
the crl command processes CRL files in DER or PEM format. yes that's the whole job and it does it beautifully β¨
The options are as follows:
-CAfilefile β verify the signature on a CRL by looking up the issuing certificate in file.-CApathdirectory β verify the signature on a CRL by looking up the issuing certificate in dir. this directory has to be a standard certificate directory, i.e. a hash of each subject name (usingx509 -hash) should be linked to each certificate. iykyk π-crlnumberβ print the CRL number.-fingerprintβ print the CRL fingerprint.-hashβ output a hash of the issuer name. you can use it to look up CRLs in a directory by issuer name.-hash_oldβ output an old-style (MD5) hash of the issuer name. vintage, lowkey π-infile β the input file to read from, or standard input if not specified.-inform der | pemβ the input format.-issuerβ output the issuer name.-lastupdateβ output thethisUpdatefield. this option is misnamed for historical reasons, so don't come for me, blame the archives π-nameoptoption β specify certificate name options.-nextupdateβ output thenextUpdatefield.-nooutβ do not output the encoded version of the CRL.-outfile β the output file to write to, or standard output if not specified.-outform der | pemβ the output format.-textβ print the CRL in plain text. so you can actually read it, iconic π«Ά-verifyβ verify the signature on the CRL. trust but verify, bestie.
π¦ CRL2PKCS7 π¦
the synopsis, serving:
openssl crl2pkcs7 [-certfile file] [-in file] [-inform der | pem]
[-nocrl] [-out file] [-outform der | pem]
the crl2pkcs7 command takes an optional CRL plus one or more certificates and converts them into a PKCS#7 degenerate "certificates only" structure. it's giving a little bundled package of certs π¦β¨
The options are as follows:
-certfilefile β add the certificates in the PEM file to the PKCS#7 structure. you can use this option more than once to read certificates from multiple files, so go off π-infile β read the CRL from file, or standard input if not specified.-inform der | pemβ the input format.-nocrlβ normally a CRL is included in the output file. with this option, no CRL gets included in the output file, and a CRL isn't read from the input file either. bye bye CRL π-outfile β write the PKCS#7 structure to file, or standard output if not specified.-outform der | pemβ the output format.
β¨ DGST β¨
Okay bestie, so the digest commands are giving β¨checksum realnessβ¨ β they spit out the message digest of the file(s) you hand them, in hexadecimal. But they're not just cute little checksums, no ma'am β they can also do digital signing and verification, which is highkey important. π
openssl dgst [-cdr] [-binary] [-digest] [-hex] [-hmac key]
[-keyform pem] [-mac algorithm] [-macopt nm:v] [-out file]
[-passin arg] [-prverify file] [-sign file]
[-signature file] [-sigopt nm:v] [-verify file] [file ...]
The digest functions output the message digest of a supplied file or files in hexadecimal form. They can also be used for digital signing and verification.
Let's get into the options, shall we? π
-binaryβ Output the digest or signature in binary form. Raw bytes energy. π-cβ Print the digest in two-digit groups separated by colons. It's giving organized. π«Ά-dβ Print BIO debugging information. For when you need the inside scoop. π-digestβ Use the specified message digest. The default isSHA256. You can see all the digests available withopenssl list-message-digest-commands. And PSA: these two are literally the same thing:openssl dgst -sha256andopenssl sha256.-hexβ Digest is to be output as a hex dump. This is the default case for a "normal" digest as opposed to a digital signature.-hmac keyβ Create a hashed MAC using key.-keyform pemβ Specifies the key format to sign the digest with.-mac algorithmβ Create a keyed Message Authentication Code (MAC). The most popular MAC algorithm is HMAC (hash-based MAC), but there are other MAC algorithms which are not based on hash. MAC keys and other options should be set via the-macoptparameter. π-macopt nm:vβ Passes options to the MAC algorithm, specified by-mac. HMAC supports the following:key:stringβ Specifies the MAC key as an alphanumeric string (use if the key contains printable characters only). String length must conform to any restrictions of the MAC algorithm.hexkey:stringβ Specifies the MAC key in hexadecimal form (two hex digits per byte). Key length must conform to any restrictions of the MAC algorithm.
-out fileβ The output file to write to, or standard output if not specified.-passin argβ The key password source.-prverify fileβ Verify the signature using the private key in file. The output is either"Verification OK"or"Verification Failure". Iconic binary outcome, we love to see it. β¨-rβ Print the digest in coreutils format.-sign fileβ Digitally sign the digest using the private key in file.-signature fileβ The actual signature to verify.-sigopt nm:vβ Pass options to the signature algorithm during sign or verify operations. The names and values of these options are algorithm-specific.-verify fileβ Verify the signature using the public key in file. The output is either"Verification OK"or"Verification Failure". Again with the two-outcome life. πfile ...β File or files to digest. If no files are specified then standard input is used.
πΈ DHPARAM πΈ
Okay so dhparam is your girl for manipulating DH parameter files. But heads up β only the older PKCS#3 DH is supported, not the newer X9.42 DH. No cap, that's just how it is. π
openssl dhparam [-2 | -5] [-check] [-dsaparam] [-in file]
[-inform der | pem] [-noout] [-out file]
[-outform der | pem] [-text] [numbits]
The dhparam command is used to manipulate DH parameter files. Only the older PKCS#3 DH is supported, not the newer X9.42 DH.
Here's the lineup: π
-2,-5β The generator to use;2is the default. If present, the input file is ignored and parameters are generated instead.-checkβ Check the DH parameters. Vibe check but for math. π¦-dsaparamβ Read or create DSA parameters, converted to DH format on output. Otherwise, "strong" primes (such that(p-1)/2is also prime) will be used for DH parameter generation.
DH parameter generation with the -dsaparam option is much faster, and the recommended exponent length is shorter, which makes DH key exchange more efficient. Beware that with such DSA-style DH parameters, a fresh DH key should be created for each use to avoid small-subgroup attacks that may be possible otherwise. β οΈ Like, actually beware, bestie.
-in fileβ The input file to read from, or standard input if not specified.-inform der | pemβ The input format.-nooutβ Do not output the encoded version of the parameters.-out fileβ The output file to write to, or standard output if not specified.-outform der | pemβ The output format.-textβ Print the DH parameters in plain text.numbitsβ Generate a parameter set of size numbits. It must be the last option. If not present, a value of2048is used. If this value is present, the input file is ignored and parameters are generated instead. Last option or it doesn't count, periodt. π
π DSA π
The dsa command is all about processing DSA keys β converting them between various forms and printing out their components. Glow-up for your keys, basically. β¨
openssl dsa [-aes128 | -aes192 | -aes256 | -des | -des3] [-in file]
[-inform der | pem | pvk] [-modulus] [-noout] [-out file]
[-outform der | pem | pvk] [-passin arg] [-passout arg]
[-pubin] [-pubout] [-pvk-none | -pvk-strong | -pvk-weak]
[-text]
The dsa command processes DSA keys. They can be converted between various forms and their components printed out.
Note: This command uses the traditional SSLeay compatible format for private key encryption: newer applications should use the more secure PKCS#8 format using the pkcs8 command. Old school vs new school, and new school is the move. π
The options go like this:
-aes128|-aes192|-aes256|-des|-des3β Encrypt the private key with the AES, DES, or the triple DES ciphers, respectively, before outputting it. A pass phrase is prompted for. If none of these options are specified, the key is written in plain text.
This means that using the dsa utility to read an encrypted key with no encryption option can be used to remove the pass phrase from a key, or by setting the encryption options it can be used to add or change the pass phrase. These options can only be used with PEM format output files. π
-in fileβ The input file to read from, or standard input if not specified. If the key is encrypted, a pass phrase will be prompted for.-inform der | pem | pvkβ The input format.-modulusβ Print the value of the public key component of the key.-nooutβ Do not output the encoded version of the key.-out fileβ The output file to write to, or standard output if not specified. If any encryption options are set then a pass phrase will be prompted for.-outform der | pem | pvkβ The output format.-passin argβ The key password source.-passout argβ The output file password source.-pubinβ Read in a public key, not a private key.-puboutβ Output a public key, not a private key. Automatically set if the input is a public key.-pvk-none|-pvk-strong|-pvk-weakβ Enable or disable PVK encoding. The default is-pvk-strong.-textβ Print the public/private key in plain text.
π§ DSAPARAM π§
And finally, dsaparam β your go-to for manipulating or generating DSA parameter files. Parameter file queen behavior. π
openssl dsaparam [-genkey] [-in file] [-inform der | pem] [-noout]
[-out file] [-outform der | pem] [-text] [numbits]
The dsaparam command is used to manipulate or generate DSA parameter files.
The options, bestie:
-genkeyβ Generate a DSA key either using the specified or generated parameters.-in fileβ The input file to read from, or standard input if not specified. If the numbits parameter is included, then this option is ignored.-inform der | pemβ The input format.-nooutβ Do not output the encoded version of the parameters.-out fileβ The output file to write to, or standard output if not specified.-outform der | pemβ The output format.-textβ Print the DSA parameters in plain text.numbitsβ Generate a parameter set of size numbits. If this option is included, the input file is ignored. π«
openssl ec [-conv_form arg] [-des] [-des3] [-in file]
[-inform der | pem] [-noout] [-out file]
[-outform der | pem] [-param_enc arg] [-param_out]
[-passin arg] [-passout arg] [-pubin] [-pubout] [-text]
Okay so ec is your EC key glow-up machine π« β it takes elliptic curve keys and converts them between all the different forms, plus prints out their components if you're nosy (we love a nosy queen).
Fun fact: openssl uses the private key format from "SEC 1: Elliptic Curve Cryptography" (https://www.secg.org/). And if you ever need to turn an EC private key into PKCS#8 private key format, that's a whole different vibe β take it to the pkcs8 command, bestie.
Here's the options, no gatekeeping:
-conv_form argβ tells OpenSSL how points on the elliptic curve get converted into octet strings. Your choices arecompressed,uncompressed(the default, she's the standard), andhybrid. Want the lore? Check the X9.62 standard.-des|-des3β encrypt the private key with DES, triple DES, or literally any other cipheropensslsupports. You'll get prompted for a pass phrase. If you specify none of these, the key is written in plain text β which, real talk, means you can useecto read in an encrypted key with no encryption option and strip the pass phrase off it, or set the encryption options to add/change the pass phrase. These options only work with PEM format output files though. π-in fileβ the input file to read a key from, or standard input if you don't specify one. If the key is encrypted, expect a pass phrase prompt.-inform der | pemβ the input format.-nooutβ don't output the encoded version of the key.-out fileβ the output filename to write to, or standard output if you don't specify one. If any encryption options are set, you'll be prompted for a pass phrase.-outform der | pemβ the output format.-param_enc argβ how the elliptic curve parameters get encoded. Possible values:named_curve, where the EC parameters are specified by an OID, orexplicit, where the EC parameters are explicitly given (see RFC 3279 for the definition of the EC parameter structures). Default isnamed_curve. Heads up β οΈ theimplicitlyCAalternative, as specified in RFC 3279, is currently not implemented.-param_outβ print the elliptic curve parameters.-passin argβ the key password source.-passout argβ the output file password source.-pubinβ read in a public key, not a private key.-puboutβ output a public key, not a private key. Automatically set if the input is a public key.-textβ print the public/private key in plain text.
πΈ ECPARAM πΈ
openssl ecparam [-check] [-conv_form arg] [-genkey] [-in file]
[-inform der | pem] [-list_curves] [-name arg]
[-no_seed] [-noout] [-out file] [-outform der | pem]
[-param_enc arg] [-text]
ecparam is here to manipulate or generate EC parameter files β¨. Sad news though: openssl can't generate new groups, so ecparam can only create EC parameters from known (named) curves. That's just the situation, iykyk.
The options, coming right up:
-checkβ validate the elliptic curve parameters.-conv_form argβ same deal as before: how points on the elliptic curve get converted into octet strings. Values arecompressed,uncompressed(the default), andhybrid. More info on point conversion forms lives in the X9.62 standard.-genkeyβ generate an EC private key using the specified parameters.-in fileβ the input file to read from, or standard input if not specified.-inform der | pemβ the input format.-list_curvesβ print a list of all currently implemented EC parameter names and dip out. π-name argβ use the EC parameters with the specified "short" name.-no_seedβ don't include the seed for parameter generation in the ECParameters structure (see RFC 3279).-nooutβ don't output the encoded version of the parameters.-out fileβ the output file to write to, or standard output if not specified.-outform der | pemβ the output format.-param_enc argβ how the elliptic curve parameters get encoded. Possible values:named_curve(parameters specified by an OID) orexplicit(parameters explicitly given β see RFC 3279 for the EC parameter structure definitions). Default isnamed_curve. Note π theimplicitlyCAalternative from RFC 3279 is currently not implemented.-textβ print the EC parameters in plain text.
π₯ ENC π₯
openssl enc -ciphername [-AadePpv] [-base64] [-bufsize number] [-debug]
[-in file] [-iter iterations] [-iv IV] [-K key]
[-k password] [-kfile file] [-md digest] [-none] [-nopad]
[-nosalt] [-out file] [-pass arg] [-pbkdf2] [-S salt]
[-salt]
The symmetric cipher commands let you encrypt or decrypt data using various block and stream ciphers, with keys based on passwords or ones you hand over explicitly. Base64 encoding or decoding can also happen β either on its own or stacked on top of the encryption/decryption. Obsessed with the flexibility tbh. You can call the program either as openssl ciphername or as openssl enc -ciphername.
Now, real talk on safety β οΈ: some of the ciphers don't have large keys, and others have security implications if you don't use them correctly. All the block ciphers normally use PKCS#5 padding, also known as standard block padding. If you disable padding, your input data must be a multiple of the cipher block length. No exceptions, bestie.
The options:
-Aβ if the-aoption is set, then base64 process the data on one line.-a,-base64β base64 process the data. Meaning: if encryption is happening, the data gets base64-encoded after encryption. If decryption is set, the input data gets base64-decoded before being decrypted.-bufsize numberβ set the buffer size for I/O.-dβ decrypt the input data.-debugβ debug the BIOs used for I/O.-eβ encrypt the input data. This is the default.-in fileβ the input file to read from, or standard input if not specified.-iter iterationsβ use the pbkdf2 key derivation function, withiterationsas the number of iterations.-iv IVβ the actual IV (initialisation vector) to use. It must be a string made up of only hex digits. If only the key is specified with-K, the IV must be explicitly defined. When a password is being specified using one of the other options, the IV is generated from that password.-K keyβ the actual key to use, and it must be a string made up of only hex digits. If only the key is specified, the IV must also be specified with-iv. When both a key and a password are specified, the key from-Kwins and the IV generated from the password gets taken. Lowkey it probably doesn't make much sense to specify both key and password.-k passwordβ the password to derive the key from. Superseded by the-passoption.-kfile fileβ read the password to derive the key from the first line offile. Superseded by the-passoption.-md digestβ usedigestto create a key from a pass phrase. Currently the default value issha256.-noneβ use NULL cipher (no encryption or decryption of input).-nopadβ disable standard block padding.-nosaltβ don't use a salt in the key derivation routines. π¨ Genuinely: this option should never be used, since it makes efficient dictionary attacks on the password possible and lets attackers go after stream cipher encrypted data. Just don't.-out fileβ the output file to write to, or standard output if not specified.-Pβ print out the salt, key, and IV used, then immediately exit; no encryption or decryption at all.-pβ print out the salt, key, and IV used.-pass argβ the password source.-pbkdf2β use the pbkdf2 key derivation function, with the default of10000iterations.-S saltβ the actual salt to use, as a string of only hex digits.-saltβ use a salt in the key derivation routines (this is the default). When salt is used, the first eight bytes of the encrypted data are reserved for it: randomly generated when encrypting a file, and read from the encrypted file when it's decrypted.-vβ print extra details about the processing.
π¦ ERRSTR π¦
openssl errstr errno ...
errstr does error number β error string conversion, generating a human-readable string representing the error code errno. The string comes from the ERR_error_string_n(3) function and has this format:
error:[error code]:[library name]:[function name]:[reason string]
[error code] is an 8-digit hexadecimal number. The remaining fields β [library name], [function name], and [reason string] β are all ASCII text. Cute and informative, we stan. π
π GENDSA π
openssl gendsa [-aes128 | -aes192 | -aes256 | -camellia128 |
-camellia192 | -camellia256 | -des | -des3 | -idea]
[-out file] [-passout arg] paramfile
gendsa generates a DSA private key from a DSA parameter file (typically one generated by the openssl dsaparam command). And here's the tea: DSA key generation is little more than random number generation, so it's way quicker than, say, RSA key generation. Speed demon energy β‘
The options:
-aes128|-aes192|-aes256|-camellia128|-camellia192|-camellia256|-des|-des3|-ideaβ encrypt the private key with the AES, CAMELLIA, DES, triple DES or the IDEA ciphers, respectively, before outputting it. You'll be prompted for a pass phrase. If none of these options are specified, no encryption is used.-out fileβ the output file to write to, or standard output if not specified.-passout argβ the output file password source.paramfileβ specify the DSA parameter file to use. The parameters in this file determine the size of the private key.
β¨ GENPKEY β¨
πΈ SYNOPSIS πΈ
openssl genpkey [-algorithm alg] [cipher] [-genparam] [-out file]
[-outform der | pem] [-paramfile file] [-pass arg]
[-pkeyopt opt:value] [-text]
π DESCRIPTION π
Okay so genpkey generates private keys, bestie. It's highkey encouraged over the algorithm-specific utilities because you get to use additional algorithm options. The way that's a glow-up? Immaculate. β¨
β¨ OPTIONS β¨
-algorithm algβ the public key algorithm to use, likeRSA,DSA, orDH. This option must come before any-pkeyoptoptions. Also,-paramfileand-algorithmare mutually exclusive, so pick one.cipherβ encrypt the private key with the supplied cipher. Any algorithm name accepted byEVP_get_cipherbyname(3)is acceptable.-genparamβ generate a set of parameters instead of a private key. This option must precede any-algorithm,-paramfile, or-pkeyoptoptions.-out fileβ the output file to write to, or standard output if not specified.-outform der | pemβ the output format.-paramfile fileβ some public key algorithms generate a private key based on a set of parameters, and you can supply those with this option. If you use this, the public key algorithm used is determined by the parameters. This option must precede any-pkeyoptoptions. The options-paramfileand-algorithmare mutually exclusive.-pass argβ the output file password source.-pkeyopt opt:valueβ set the public key algorithm optionopttovalue, like this:rsa_keygen_bits:numbitsβ (RSA) the number of bits in the generated key. The default is2048.rsa_keygen_pubexp:valueβ (RSA) the RSA public exponent value. This can be a large decimal or hexadecimal value if preceded by0x. The default is65537.dsa_paramgen_bits:numbitsβ (DSA) the number of bits in the generated parameters. The default is1024.dh_paramgen_prime_len:numbitsβ (DH) the number of bits in the prime parameterp.dh_paramgen_generator:valueβ (DH) the value to use for the generatorg.ec_paramgen_curve:curveβ (EC) the elliptic curve to use.
-textβ print the private/public key in plain text.
π₯ GENRSA π₯
πΈ SYNOPSIS πΈ
openssl genrsa [-3 | -f4] [-aes128 | -aes192 | -aes256 | -camellia128 |
-camellia192 | -camellia256 | -des | -des3 | -idea]
[-out file] [-passout arg] [numbits]
π DESCRIPTION π
The genrsa command generates an RSA private key, which essentially involves the generation of two prime numbers. When generating the key, various symbols will be output to indicate the progress of the generation. No cap, this is a whole vibe check made of punctuation:
'.'represents each number which has passed an initial sieve test.'+'means a number has passed a single round of the Miller-Rabin primality test.'*'means the number has failed primality testing and needs to be generated afresh.- A newline means that the number has passed all the prime tests (the actual number depends on the key size).
β¨ OPTIONS β¨
-3|-f4β the public exponent to use, either3or65537. The default is65537.-aes128|-aes192|-aes256|-camellia128|-camellia192|-camellia256|-des|-des3|-ideaβ encrypt the private key with the AES, CAMELLIA, DES, triple DES or the IDEA ciphers, respectively, before outputting it. If none of these options are specified, no encryption is used. If encryption is used, a pass phrase is prompted for, if it is not supplied via the-passoutoption.-out fileβ the output file to write to, or standard output if not specified.-passout argβ the output file password source.numbitsβ the size of the private key to generate in bits. This must be the last option specified. The default is2048.
π¦ OCSP π¦
πΈ SYNOPSIS πΈ
openssl ocsp [-CA file] [-CAfile file] [-CApath directory] [-cert file]
[-dgst alg] [-header name value] [-host hostname:port]
[-ignore_err] [-index indexfile] [-issuer file]
[-ndays days] [-nmin minutes] [-no_cert_checks]
[-no_cert_verify] [-no_certs] [-no_chain] [-no_explicit]
[-no_intern] [-no_nonce] [-no_signature_verify] [-nonce]
[-noverify] [-nrequest number] [-out file] [-path path]
[-port portnum] [-req_text] [-reqin file] [-reqout file]
[-resp_key_id] [-resp_no_certs] [-resp_text]
[-respin file] [-respout file] [-rkey file] [-rother file]
[-rsigner file] [-serial num] [-sign_other file]
[-signer file] [-signkey file] [-status_age age] [-text]
[-timeout seconds] [-trust_other] [-url responder_url]
[-VAfile file] [-validity_period nsec]
[-verify_other file]
π DESCRIPTION π
The Online Certificate Status Protocol (OCSP) enables applications to determine the (revocation) state of an identified certificate (RFC 2560). Icons only.
The ocsp command performs many common OCSP tasks. It can be used to print out requests and responses, create requests and send queries to an OCSP responder, and behave like a mini OCSP server itself. Main character energy, honestly. π
β¨ OPTIONS β¨
β οΈ Heads up, bestie: some of these options are testing-only or debugging-only and should not be treated like production vibes. I'll flag them as we go. No cap.
π described options π
-CAfile file,-CApath directoryβ a file or path containing trusted CA certificates, used to verify the signature on the OCSP response.-cert fileβ add the certificate file to the request. The issuer certificate is taken from the previous-issueroption, or an error occurs if no issuer certificate is specified.-dgst algβ use the digest algorithmalgfor certificate identification in the OCSP request. By defaultSHA1is used.-host hostname:port,-path pathβ send the OCSP request tohostnameonport.-pathspecifies the HTTP path name to use, or/by default.-header name valueβ add the headernamewith the specifiedvalueto the OCSP request that is sent to the responder. This may be repeated.-issuer fileβ the current issuer certificate, in PEM format. Can be used multiple times and must come before any-certoptions.-no_cert_checksβ don't perform any additional checks on the OCSP response signer's certificate. That is, do not make any checks to see if the signer's certificate is authorised to provide the necessary status information: as a result this option should only be used for testing purposes. Testing only, fr fr.-no_cert_verifyβ don't verify the OCSP response signer's certificate at all. Since this option allows the OCSP response to be signed by any certificate, it should only be used for testing purposes. π Testing only.-no_certsβ don't include any certificates in the signed request.-no_chainβ do not use certificates in the response as additional untrusted CA certificates.-no_explicitβ don't check the explicit trust for OCSP signing in the root CA certificate.-no_internβ ignore certificates contained in the OCSP response when searching for the signer's certificate. The signer's certificate must be specified with either the-verify_otheror-VAfileoptions.-no_signature_verifyβ don't check the signature on the OCSP response. Since this option tolerates invalid signatures on OCSP responses, it will normally only be used for testing purposes. Testing only, bestie.-nonce,-no_nonceβ add an OCSP nonce extension to a request, or disable an OCSP nonce addition. Normally, if an OCSP request is input using the-respinoption no nonce is added: using the-nonceoption will force the addition of a nonce. If an OCSP request is being created (using the-certand-serialoptions), a nonce is automatically added; specifying-no_nonceoverrides this.-noverifyβ don't attempt to verify the OCSP response signature or the nonce values. This is normally only used for debugging since it disables all verification of the responder's certificate. Debugging only.-out fileβ specify the output file to write to, or standard output if not specified.-req_text,-resp_text,-textβ print out the text form of the OCSP request, response, or both, respectively.-reqin file,-respin fileβ read an OCSP request or response file fromfile. These options are ignored if an OCSP request or response creation is implied by other options (for example with the-serial,-cert, and-hostoptions).-reqout file,-respout fileβ write out the DER-encoded certificate request or response tofile.-serial numβ same as the-certoption except the certificate with serial numbernumis added to the request. The serial number is interpreted as a decimal integer unless preceded by0x. Negative integers can also be specified by preceding the value with a minus sign.-sign_other fileβ additional certificates to include in the signed request.-signer file,-signkey fileβ sign the OCSP request using the certificate specified in the-signeroption and the private key specified by the-signkeyoption. If the-signkeyoption is not present, then the private key is read from the same file as the certificate. If neither option is specified, the OCSP request is not signed.-timeout secondsβ connection timeout to the OCSP responder in seconds.-trust_otherβ the certificates specified by the-verify_otheroption should be explicitly trusted and no additional checks will be performed on them. This is useful when the complete responder certificate chain is not available or trusting a root CA is not appropriate.-url responder_urlβ specify the responder URL. Both HTTP and HTTPS (SSL/TLS) URLs can be specified.-VAfile fileβ a file containing explicitly trusted responder certificates. Equivalent to the-verify_otherand-trust_otheroptions.
π«Ά synopsis-only options π«Ά
These show up in the synopsis, but the page doesn't give them their own separate descriptions. I'm not gonna invent behavior, bestie β iykyk.
-CA fileβ synopsis only; no separate description on this page.-ignore_errβ synopsis only; no separate description on this page.-index indexfileβ synopsis only; no separate description on this page.-ndays daysβ synopsis only; no separate description on this page.-nmin minutesβ synopsis only; no separate description on this page.-nrequest numberβ synopsis only; no separate description on this page.-port portnumβ synopsis only; no separate description on this page.-resp_key_idβ synopsis only; no separate description on this page.-resp_no_certsβ synopsis only; no separate description on this page.-rkey fileβ synopsis only; no separate description on this page.-rother fileβ synopsis only; no separate description on this page.-rsigner fileβ synopsis only; no separate description on this page.-status_age ageβ synopsis only; no separate description on this page.-validity_period nsecβ synopsis only; no separate description on this page.-verify_other fileβ synopsis only; no separate description on this page. It is referenced by-no_intern,-trust_other, and-VAfile.-validity_period nsec,-status_age ageβ the lil tolerated-time window, in seconds, for an OCSP response π every cert status response carries anotBeforetime and an optionalnotAftertime, and your current time is supposed to fall between the two β but bestie, that gap might literally be a couple of seconds π and in real life the responder's clock and the clients' clocks are not precisely synced, so that check can just... fail. That's why-validity_periodexists: give it an acceptable error range in seconds, and the default is 5 minutes β¨
Now if notAfter is omitted from a response, that means fresh status info is immediately available. In that case the age of the notBefore field gets checked, to make sure it isn't older than age seconds. Heads up though β by default this additional check is not performed π
-verify_other fileβ a file of extra certificates to go hunting through when it's trying to locate the certificate that signed the OCSP response π some responders are out here omitting the actual signer's certificate from the response (rude), so this is how you hand over the certificate it needs.
The options for the OCSP server are as follows π:
-CA fileβ the CA certificate that corresponds to the revocation information in indexfile.-ignore_errβ ignore the invalid response. yeah. just. ignore it π-index indexfileβ indexfile is a text index file incaformat holding certificate revocation information.
If this option is specified, ocsp is in responder mode; otherwise it's in client mode. The requests the responder processes can be:
- specified right on the command line (with the
-issuerand-serialoptions), - supplied in a file (with the
-respinoption), - or come in from external OCSP clients (if
portorurlis specified).
If this option is present, then -CA and -rsigner must also be present β οΈ
-nmin minutes,-ndays daysβ how many minutes or days the fresh revocation information is available: this goes in thenextUpdatefield. If neither option is there, thenextUpdatefield is omitted entirely, which means fresh revocation information is immediately available π-nrequest numberβ bail out after receiving number requests (default is unlimited, iykyk).-port portnumβ the port to listen for OCSP requests on. Can also be specified with the-urloption.-resp_key_idβ identify the signer certificate using the key ID; the default is to use the subject name.-resp_no_certsβ don't include any certificates in the OCSP response. none. zero. π-rkey fileβ the private key to sign OCSP responses with; if it's not present, the file named in the-rsigneroption is used.-rother fileβ additional certificates to include in the OCSP response.-rsigner fileβ the certificate to sign OCSP responses with.
okay so here's how the verify flow actually goes, and it's giving β¨processβ¨ πΈ
Initially the OCSP responder certificate is located, and the signature on the OCSP request is checked using the responder certificate's public key. Then a normal certificate verify is performed on the OCSP responder certificate, building up a certificate chain in the process. Where are the trusted certificates used to build that chain found? You can point at them with the -CAfile and -CApath options, or they'll be looked for in the standard openssl certificates directory π
If that initial verify fails, the OCSP verify process halts with an error π
Otherwise, the issuing CA certificate in the request is compared against the OCSP responder certificate: if there's a match, then the OCSP verify succeeds β
Otherwise β the OCSP responder certificate's CA is checked against the issuing CA certificate in the request. If there's a match and the OCSPSigning extended key usage is present in the OCSP responder certificate, then the OCSP verify succeeds β¨
Otherwise β the root CA of the OCSP responder's CA is checked to see if it's trusted for OCSP signing. If it is, then the OCSP verify succeeds π
If none of these checks succeed, the OCSP verify fails. What all of that effectively means is: if the OCSP responder certificate is authorised directly by the CA it's issuing revocation information about (and it's correctly configured), then verification will succeed π«Ά
If the OCSP responder is a global responder β one that can give details about multiple CAs and has its own separate certificate chain β then its root CA can be trusted for OCSP signing. Alternatively, the responder certificate itself can be explicitly trusted with the -VAfile option π
πΈ PASSWD πΈ
openssl passwd [-1 | -apr1 | -crypt] [-in file] [-noverify] [-quiet]
[-reverse] [-salt string] [-stdin] [-table] [password]
The passwd command computes the hash of a password. that's it. that's the whole gig π₯
The options are as follows:
-1β use the MD5 based BSD password algorithm"1".-apr1β use the"apr1"algorithm (Apache variant of the BSD algorithm).-cryptβ use the"crypt"algorithm (this is the default π).-in fileβ read passwords from file.-noverifyβ don't verify when reading a password from the terminal.-quietβ don't output warnings when passwords given on the command line are truncated π€«-reverseβ switch the table columns. This only makes sense in conjunction with the-tableoption, ngl.-salt stringβ use the salt specified by string. When reading a password from the terminal, this implies-noverify.-stdinβ read passwords from standard input.-tableβ in the output list, prepend the cleartext password and aTABcharacter to each password hash β¨
π PKCS7 π
openssl pkcs7 [-in file] [-inform der | pem] [-noout] [-out file]
[-outform der | pem] [-print] [-print_certs] [-text]
The pkcs7 command processes PKCS#7 files in DER or PEM format. Quick reality check: the PKCS#7 routines only understand PKCS#7 v 1.5 as specified in RFC 2315 π
The options are as follows:
-in fileβ the input file to read from, or standard input if not specified.-inform der | pemβ the input format.-nooutβ don't output the encoded version of the PKCS#7 structure (or certificates, if-print_certsis set).-out fileβ the output to write to, or standard output if not specified.-outform der | pemβ the output format.-printβ print the ASN.1 representation of the PKCS#7 structure.-print_certsβ print any certificates or CRLs contained in the file, preceded by their subject and issuer names in a one-line format π-textβ print certificate details in full rather than just subject and issuer names. the whole thing. all the tea β
π¦ PKCS8 π¦
openssl pkcs8 [-in file] [-inform der | pem] [-nocrypt] [-noiter]
[-out file] [-outform der | pem] [-passin arg]
[-passout arg] [-topk8] [-v1 alg] [-v2 alg]
The pkcs8 command processes private keys (both encrypted and unencrypted) in PKCS#8 format, with a whole little buffet of PKCS#5 (v1.5 and v2.0) and PKCS#12 algorithms π
The options are as follows:
-in fileβ the input file to read from, or standard input if not specified. If the key is encrypted, a pass phrase will be prompted for π-inform der | pemβ the input format.-nocryptβ generate an unencryptedPrivateKeyInfostructure. β οΈ this option does not encrypt private keys at all and should only be used when absolutely necessary. like, absolutely. fr fr.-noiterβ use an iteration count of1. See the βPKCS12β section below for a detailed explanation of this option.-out fileβ the output file to write to, or standard output if none is specified. If any encryption options are set, a pass phrase will be prompted for.-outform der | pemβ the output format.-passin argβ the key password source.-passout argβ the output file password source.-topk8β read a traditional format private key and write a PKCS#8 format key π-v1 algβ specify a PKCS#5 v1.5 or PKCS#12 algorithm to use.PBE-MD5-DESβ 56-bit DES.PBE-SHA1-RC2-64|PBE-MD5-RC2-64|PBE-SHA1-DESβ 64-bit RC2 or 56-bit DES.PBE-SHA1-RC4-128|PBE-SHA1-RC4-40|PBE-SHA1-3DES|PBE-SHA1-2DES|PBE-SHA1-RC2-128|PBE-SHA1-RC2-40β PKCS#12 password-based encryption algorithm, which allow strong encryption algorithms like triple DES or 128-bit RC2 πͺ
-v2 algβ use PKCS#5 v2.0 algorithms. These are block ciphers used in CBC mode. The default isAES-256-CBC. β οΈ With the exception of AES, the choices available in RFC 8018 are considered decrepit π They can be enabled withdes,des3, andrc2(rc5is no longer supported).
π PKCS12 π
openssl pkcs12 [-aes128 | -aes192 | -aes256 | -camellia128 |
-camellia192 | -camellia256 | -des | -des3 | -idea]
[-cacerts] [-CAfile file] [-caname name]
[-CApath directory] [-certfile file] [-certpbe alg]
[-chain] [-clcerts] [-descert] [-export] [-in file]
[-info] [-inkey file] [-keyex] [-keypbe alg] [-keysig]
[-macalg alg] [-maciter] [-name name] [-nocerts]
[-nodes] [-noiter] [-nokeys] [-nomac] [-nomaciter]
[-nomacver] [-noout] [-out file] [-passin arg]
[-passout arg] [-password arg] [-twopass]
okay so the pkcs12 command is your bestie for making and reading PKCS#12 files (some people call them PFX files, iykyk) π By default it parses one β if you wanna create one you gotta say -export. That's the whole vibe.
β¨ the parsing options (reading mode) β¨
-aes128|-aes192|-aes256|-camellia128|-camellia192|-camellia256|-des|-des3|-ideaβ encrypt your private keys with AES, CAMELLIA, DES, triple DES or IDEA respectively. the default is triple DES, no cap π-cacertsβ only spit out CA certificates. no client certs, sorry bestie.-clcertsβ the opposite vibe: only client certificates, no CA certs.-in fileβ the input file to read from, or standard input if you don't specify one.-infoβ print extra tea about the PKCS#12 file structure, which algorithms got used, and the iteration counts π-nocertsβ do not output certificates.-nodesβ do not encrypt private keys. literally bare, no encryption at all.-nokeysβ do not output private keys.-nomacverβ do not even try to verify the integrity MAC before reading the file. bold of you.-nooutβ do not output the keys and certificates to the output file version of the PKCS#12 file.-out fileβ the output file to write to, or standard output if you don't specify one.-passin argβ the key password source.-passout argβ the output file password source.-twopassβ prompt for separate integrity and encryption passwords. most software just assumes these are the same, so this option will literally render such PKCS#12 files unreadable by them π chaotic but iconic.
πΈ the creation options (make mode) πΈ
-CAfile fileβ CA storage as a file.-CApath directoryβ CA storage as a directory. heads up: the directory has to be a standard certificate directory β that means a hash of each subject name (usingx509 -hash) should be linked to each certificate.-caname nameβ pick the "friendly name" for other certificates. you can use it multiple times to name all the certificates in the order they appear π«Ά-certfile fileβ a file to read additional certificates from.-certpbe alg,-keypbe algβ specify the algorithm used to encrypt the private key and certificates to be selected. any PKCS#5 v1.5 or PKCS#12 PBE algorithm name works. if you hand it a cipher name (as output by thelist-cipher-algorithmscommand) it gets used with PKCS#5 v2.0. for interoperability reasons it's advisable to only use PKCS#12 algorithms β fr fr, take the advice.-chainβ include the entire certificate chain of the user certificate. the standard CA store is used for this search. if the search fails, that's a fatal error, no chill.-descertβ encrypt the certificate using triple DES. this may render the PKCS#12 file unreadable by some "export grade" software π by default the private key is encrypted using triple DES and the certificate using 40-bit RC2.-exportβ create a PKCS#12 file (instead of parsing one). this is the whole switch, bestie.-in fileβ the input file to read from, or standard input if you don't specify one. the order doesn't matter, but one private key and its corresponding certificate should be present. if additional certificates are present, they get included in the PKCS#12 file too π-inkey fileβ file to read a private key from. if it's not there, a private key must be present in the input file.-keyex|-keysigβ say whether the private key is for key exchange or just signing. normally "export grade" software will only allow 512-bit RSA keys for encryption purposes, but arbitrary length keys for signing.-keysigmarks the key for signing only. signing-only keys can be used for S/MIME signing, authenticode (ActiveX control signing) and SSL client authentication β¨-macalg algβ specify the MAC digest algorithm. default is SHA1.-maciterβ included for compatibility only π« it used to be needed to use MAC iteration counts, but they're used by default now.-name nameβ specify the "friendly name" for the certificate and private key. this name usually shows up in list boxes when software imports the file.-nomacβ don't attempt to provide the MAC integrity at all.-nomaciter,-noiterβ these affect the iteration counts on the MAC and key algorithms.
so here's the lore: to discourage attacks using big dictionaries of common passwords, the algorithm that derives keys from passwords can have an iteration count applied β that makes a certain part of the algorithm repeat and slows it down. the MAC checks file integrity, but since it'll normally have the same password as the keys and certificates, it could get attacked too. by default both the MAC and encryption iteration counts are set to 2048; with these options the MAC and encryption iteration counts can be set to 1. since that reduces file security you should NOT use these unless you really have to π¬ most software supports both MAC and key iteration counts.
-out fileβ the output file to write to, or standard output if you don't specify one.-passin argβ the key password source.-passout argβ the output file password source.-password argβ with-export,-passwordis equivalent to-passout. otherwise,-passwordis equivalent to-passin. see what they did there π
π¦ PKEY π¦
openssl pkey [cipher] [-in file] [-inform der | pem] [-noout]
[-out file] [-outform der | pem] [-passin arg]
[-passout arg] [-pubin] [-pubout] [-text] [-text_pub]
the pkey command processes public or private keys. you can convert them between various forms and print their components out. it's giving key glow-up β¨
the options are as follows:
cipherβ encrypt the private key with the specified cipher. any algorithm name accepted byEVP_get_cipherbyname(3)works, likedes3.-in fileβ the input file to read from, or standard input if you don't specify one. if the key is encrypted, you'll get prompted for a pass phrase.-inform der | pemβ the input format.-nooutβ do not output the encoded version of the key.-out fileβ the output file to write to, or standard output if you don't specify one. if any encryption options are set then you'll be prompted for a pass phrase.-outform der | pemβ the output format.-passin argβ the key password source.-passout argβ the output file password source.-pubinβ read in a public key, not a private key.-puboutβ output a public key, not a private key. set automatically if the input is a public key, convenient much?-textβ print the public/private key in plain text.-text_pubβ print out only public key components, even if a private key is what's being processed π
π§ PKEYPARAM π§
openssl pkeyparam [-in file] [-noout] [-out file] [-text]
the pkeyparam command processes public or private keys. the key type is determined by the PEM headers, so it just knows π«
the options are as follows:
-in fileβ the input file to read from, or standard input if you don't specify one.-nooutβ do not output the encoded version of the parameters.-out fileβ the output file to write to, or standard output if you don't specify one.-textβ print the parameters in plain text.
π PKEYUTL π
openssl pkeyutl [-asn1parse] [-certin] [-decrypt] [-derive] [-encrypt]
[-hexdump] [-in file] [-inkey file]
[-keyform der | pem] [-out file] [-passin arg]
[-peerform der | pem] [-peerkey file]
[-pkeyopt opt:value] [-pubin] [-rev] [-sigfile file]
[-sign] [-verify] [-verifyrecover]
Okay so pkeyutl is your lil go-to bestie for doing public key operations with literally any supported algorithm π¦. Like, any algorithm, one tool, one vibe. It's giving versatility.
The options are as follows, bestie:
-asn1parseβ ASN.1 parses the output data β¨. Super useful when you pair it with the-verifyrecoveroption and an ASN.1 structure happens to be what got signed.-certinβ the input is a certificate containing a public key π.-decryptβ decrypt the input data using a private key π.-deriveβ derive a shared secret using the peer key π€.-encryptβ encrypt the input data using a public key π.-hexdumpβ hex dump the output data, for when you wanna look at the bytes π .-in fileβ the input file to read from, or standard input if you don't specify one.-inkey fileβ the input key file. By default it should be a private key.-keyform der | pemβ the key format.-out fileβ the output file to write to, or standard output if not specified.-passin argβ the key password source.-peerform der | pemβ the peer key format.-peerkey fileβ the peer key file, used by key derivation (agreement) operations.-pkeyopt opt:valueβ set the public key algorithm optionopttovalue. Unless it says otherwise somewhere, all algorithms support the formatdigest:alg, which tells it which digest to use forsign,verify, andverifyrecoveroperations πΈ. The valuealgshould be a digest name like the ones used in theEVP_get_digestbyname(3)function.
The RSA algorithm supports the encrypt, decrypt, sign, verify, and verifyrecover operations in general β but ngl, some padding modes only support some of those operations. π
rsa_padding_mode:modeβ this sets the RSA padding mode. Acceptable values formodearepkcs1for PKCS#1 padding;nonefor no padding;oaepfor OAEP mode;x931for X9.31 mode; andpssfor PSS.
In PKCS#1 padding, if the message digest is not set, then the supplied data is signed or verified directly instead of using a DigestInfo structure π. If a digest is set, then a DigestInfo structure is used and its length must correspond to the digest type. For oeap mode only encryption and decryption is supported. For x931, if the digest type is set it's used to format the block data; otherwise the first byte is used to specify the X9.31 digest ID. sign, verify, and verifyrecover can be performed in this mode. For pss mode only sign and verify are supported and the digest type must be specified β οΈ.
rsa_pss_saltlen:lenβ forpssmode only, this option specifies the salt length π§. Two special values are supported:-1sets the salt length to the digest length. When signing,-2sets the salt length to the maximum permissible value. When verifying,-2causes the salt length to be automatically determined based on the PSS block structure. Iconic behaviour honestly.
The DSA algorithm supports the sign and verify operations. Currently there are no additional options other than digest. Only the SHA1 digest can be used and this digest is assumed by default.
The DH algorithm supports the derive operation and no additional options π«Ά.
The EC algorithm supports the sign, verify, and derive operations. The sign and verify operations use ECDSA and derive uses ECDH. Currently there are no additional options other than digest. Only the SHA1 digest can be used and this digest is assumed by default.
-pubinβ the input file is a public key.-revβ reverse the order of the input buffer π.-sigfile fileβ signature file (verifyoperation only).-signβ sign the input data and output the signed result. This requires a private key π.-verifyβ verify the input data against the signature file and indicate whether the verification succeeded or failed β β.-verifyrecoverβ verify the input data and output the recovered data.
π₯ PRIME π₯
openssl prime [-bits n] [-checks n] [-generate] [-hex] [-safe] p
The prime command is used to generate prime numbers, or to check numbers for primality π. Results are probabilistic: they have an exceedingly high likelihood of being correct, but they are not guaranteed. So likeβ¦ bestie, it's basically certain, but not a promise. Noted π.
The options are as follows:
-bits nβ specify the number of bits in the generated prime number. Must be used in conjunction with-generateβ οΈ.-checks nβ perform a Miller-Rabin probabilistic primality test withniterations. The default is20.-generateβ generate a pseudo-random prime number. Must be used in conjunction with-bitsβ οΈ.-hexβ output in hex format.-safeβ generate only "safe" prime numbers (i.e. a primepso that(p-1)/2is also prime) π‘οΈ.pβ test if numberpis prime.
π² RAND π²
openssl rand [-base64] [-hex] [-out file] num
The rand command outputs num pseudo-random bytes β¨. That's it, that's the whole job, and it ate.
The options are as follows:
-base64β perform base64 encoding on the output π.-hexβ specify hexadecimal output.-out fileβ the output file to write to, or standard output if not specified.
π§ REQ π§
openssl req [-addext ext] [-batch] [-config file] [-days n]
[-extensions section] [-in file] [-inform der | pem]
[-key keyfile] [-keyform der | pem] [-keyout file]
[-md4 | -md5 | -sha1] [-modulus] [-multivalue-rdn]
[-nameopt option] [-new] [-newhdr] [-newkey arg] [-nodes]
[-noout] [-out file] [-outform der | pem] [-passin arg]
[-passout arg] [-pkeyopt opt:value] [-pubkey]
[-reqexts section] [-reqopt option] [-set_serial n]
[-sigopt nm:v] [-subj arg] [-subject] [-text] [-utf8]
[-verbose] [-verify] [-x509]
The req command primarily creates and processes certificate requests in PKCS#10 format π. It can additionally create self-signed certificates, for use as root CAs, for example π. She contains multitudes.
β¨ The Options β¨
-addext extβ add a specific extension to the certificate (if the-x509option is present) or certificate request πΈ. The argument must have the form of akey=valuepair as it would appear in a config file. This option can be given multiple times, so go off.-batchβ non-interactive mode. No prompts, just vibes π.-config fileβ specify an alternative configuration file.-days nβ specify the number of days to certify the certificate for. The default is30days. Used with the-x509option π .-extensions section,-reqexts sectionβ specify alternative sections to include certificate extensions (with-x509) or certificate request extensions, allowing several different sections to be used in the same configuration file ποΈ.-in fileβ the input file to read a request from, or standard input if not specified. A request is only read if the creation options-newand-newkeyare not specified β οΈ.-inform der | pemβ the input format.-key keyfileβ the file to read the private key from. It also accepts PKCS#8 format private keys for PEM format files π.-keyform der | pemβ the format of the private key file specified in the-keyargument. The default ispem.-keyout fileβ the file to write the newly created private key to. If this option is not specified, the filename present in the configuration file is used.-md5 | -sha1 | -sha256β the message digest to sign the request with. This overrides the digest algorithm specified in the configuration file π .
Some public key algorithms may override this choice. For instance, DSA signatures always use SHA1. Rude but okay.
-modulusβ print the value of the modulus of the public key contained in the request.-multivalue-rdnβ this option causes the-subjargument to be interpreted with full support for multivalued RDNs, for example"/DC=org/DC=OpenSSL/DC=users/UID=123456+CN=John Doe"π. If-multivalue-rdnis not used, the UID value is set to"123456+CN=John Doe". Sneaky difference, honestly.-nameopt option,-reqopt optionβ determine how the subject or issuer names are displayed π.optioncan be a single option or multiple options separated by commas. Alternatively, these options may be used more than once to set multiple options. See the βX509β section below for details.-newβ generate a new certificate request. The user is prompted for the relevant field values. The actual fields prompted for and their maximum and minimum sizes are specified in the configuration file and any requested extensions π.
If the -key option is not used, it will generate a new RSA private key using information specified in the configuration file.
-newhdrβ add the wordNEWto the PEM file header and footer lines on the outputted request. Some software and CAs need this π.-newkey argβ create a new certificate request and a new private key. The argument takes one of several forms π
rsa:nbits generates an RSA key nbits in size. If nbits is omitted, the default key size is used.
dsa:file generates a DSA key using the parameters in file.
param:file generates a key using the parameters or certificate in file.
All other algorithms support the form algorithm:file, where file may be an algorithm parameter file, created by the genpkey -genparam command or an X.509 certificate for a key with appropriate algorithm. file can be omitted, in which case any parameters can be specified via the -pkeyopt option.
-nodesβ do not encrypt the private key π.-nooutβ do not output the encoded version of the request.-out fileβ the output file to write to, or standard output if not specified.-outform der | pemβ what format the output comes in. that's it, that's the whole vibe check π-passin argβ where the key password comes from, bestie π-passout argβ same deal but for the output file's password.-pkeyopt opt:valueβ sets the public key algorithm optionopttovalue. little key-value slay β¨-pubkeyβ output the public key. just the public half, respectfully π«Ά-reqopt optionβ customises the output format that-textuses.optioncan be a single option, or several separated by commas. (also: go look at the discussion of-certoptin thex509command, it's the same energy)-set_serial nβ the serial number to use when you're outputting a self-signed certificate. you can write it as a decimal value, or as hex if you put0xin front. yes you can use negative serial numbers, but pls don't, it's not recommended π-sigopt nm:vβ passes options to the signature algorithm while signing. the names and values are algorithm-specific, so like, iykyk.-subj argβ replaces the subject field of an input request with the data you give it, and outputs the modified request.arghas to be formatted like/type0=value0/type1=value1/type2=...; you can escape characters with\(backslash); and heads up, no spaces are skipped. none. zero. π-subjectβ prints the request subject (or the certificate subject if you also passed-x509).-textβ prints the certificate request in plain text. unglamorous but iconic.-utf8β interprets field values as UTF8 strings instead of ASCII.-verboseβ prints extra details about what's being done. she's chatty, we love her π¬-verifyβ verifies the signature on the request. trust but verify fr fr-x509β outputs a self-signed certificate instead of a certificate request. typically used to generate a test certificate or a self-signed root CA. the extensions added to the certificate (if any) come from the configuration file. and unless you set it with-set_serial, the serial number is0.
πΈ the config file options (req section) πΈ
the configuration options live in the "req" section of the configuration file, and here's what you can put in there:
attributesβ the section containing any request attributes; its format is the same asdistinguished_name. typically these might containchallengePasswordorunstructuredNametypes. right now they're ignored by the openssl request signing utilities, but some CAs might want them. not us though πdefault_bitsβ the default key size, in bits. the default is2048. it gets used if the-newoption is used, and you can override it with the-newkeyoption.default_keyfileβ the default file to write a private key to, or standard output if it's not specified. can be overridden by the-keyoutoption.default_mdβ the digest algorithm to use. possible values includemd5,sha1andsha256(which is the default). can be overridden on the command line, main character behaviour honestly πdistinguished_nameβ the section containing the distinguished name fields to prompt for when generating a certificate or certificate request. the format is described below, keep scrolling bestie.encrypt_keyβ if set to"no"and a private key is generated, it is not encrypted. it's equivalent to the-nodesoption. for compatibility,encrypt_rsa_keyis an equivalent option.input_password|output_passwordβ the passwords for the input private key file (if present) and the output private key file (if one will be created). the command line options-passinand-passoutoverride the config file values.oid_fileβ a file containing additional OBJECT IDENTIFIERS. every line should be the numerical form of the object identifier, then whitespace, then the short name, then whitespace, then the long name. order matters, don't be chaotic πoid_sectionβ specifies a section in the configuration file containing extra object identifiers. every line should be the short name of the object identifier followed by=and the numerical form. when you use this option, the short and long names are the same.promptβ if set to"no", it disables prompting for certificate fields and just takes values from the config file directly. it also changes the expected format of thedistinguished_nameandattributessections. sneakily important.req_extensionsβ the configuration file section containing a list of extensions to add to the certificate request. overridden by the-reqextsoption.string_maskβ limits the string types used for encoding certain fields. here are the values you can use, each one limiting strings to the types shown:utf8onlyβ UTF8String. this is the default, as recommended by PKIX in RFC 2459.defaultβ PrintableString, IA5String, T61String, BMPString, UTF8String.pkixβ PrintableString, IA5String, BMPString, UTF8String. inspired by the PKIX recommendation in RFC 2459 for certificates generated before 2004, but it differs by also permitting IA5String.nombstrβ PrintableString, IA5String, T61String, UniversalString. a workaround for some ancient software that had problems with the variable-sized BMPString and UTF8String types. boomer software smh πMASK:numberβ an explicit bitmask of permitted types, wherenumberis a C-style hex, decimal, or octal number that's a bit-wise OR ofB_ASN1_*values from<openssl/asn1.h>.
utf8β if set to"yes", field values are interpreted as UTF8 strings.x509_extensionsβ the configuration file section containing a list of extensions to add to a certificate generated when the-x509switch is used. overridden by the-extensionscommand line switch.
so there are two separate formats for the distinguished name and attribute sections, and which one you get depends on -prompt:
- if the
-promptoption is set to"no", these sections just consist of field names and values. simple, clean, minimal. - if
-promptis absent, or not set to"no", then the file contains field prompting information of this exact shape:
fieldName="prompt"
fieldName_default="default field value"
fieldName_min= 2
fieldName_max= 4
"fieldName" is the field name being used, for example commonName (or CN). the "prompt" string is what gets used to ask the user to enter the relevant details. if the user enters nothing, the default value is used; and if there's no default value present, the field is omitted. a field can still be omitted even when a default value is present β if the user just enters the . character. periodt.
the number of characters entered has to be between the fieldName_min and fieldName_max limits. and there may be extra restrictions based on the field being used β for example countryName can only ever be two characters long and must fit in a PrintableString. two. that's the whole budget. π
some fields (like organizationName) can be used more than once in a DN, which is a whole problem because config files will not recognize the same name occurring twice. to get around it: if the fieldName contains some characters followed by a full stop, those characters get ignored. so for example, a second organizationName can be input by calling it "1.organizationName". hack of the century honestly β¨
the actual permitted field names are any object identifier short or long names. these are compiled into openssl and include the usual values such as commonName, countryName, localityName, organizationName, organizationalUnitName, stateOrProvinceName. additionally, emailAddress is included, plus name, surname, givenName, initials and dnQualifier.
and you can define additional object identifiers with the oid_file or oid_section options in the configuration file. any additional fields get treated as though they were a DirectoryString. π¦
π₯ RSA π₯
openssl rsa [-aes128 | -aes192 | -aes256 | -des | -des3] [-check]
[-in file] [-inform der | net | pem | pvk] [-modulus]
[-noout] [-out file] [-outform der | net | pem | pvk]
[-passin arg] [-passout arg] [-pubin] [-pubout]
[-pvk-none | -pvk-strong | -pvk-weak] [-RSAPublicKey_in]
[-RSAPublicKey_out] [-text]
okay so the rsa command processes RSA keys. they can be converted between various forms, and their components printed out. rsa uses the traditional SSLeay compatible format for private key encryption β but newer applications should use the more secure PKCS#8 format via the pkcs8 utility, okurrr π
the options are as follows:
-aes128|-aes192|-aes256|-des|-des3β encrypt the private key with the AES, DES, or triple DES ciphers respectively, before outputting it. a pass phrase is prompted for. if none of these options are specified, the key is written in plain text. which means: using thersautility to read in an encrypted key with no encryption option can remove the pass phrase from a key β or, by setting the encryption options, it can add or change the pass phrase. these options can only be used with PEM format output files. β οΈ like, only PEM, don't try it elsewhere.-checkβ check the consistency of an RSA private key. vibe check for keys π-in fileβ the input file to read from, or standard input if it's not specified. if the key is encrypted, a pass phrase will be prompted for.-inform der | net | pem | pvkβ the input format.-nooutβ do not output the encoded version of the key.-modulusβ print the value of the modulus of the key.-out fileβ the output file to write to, or standard output if it's not specified.-outform der | net | pem | pvkβ the output format.-passin argβ the key password source.-passout argβ the output file password source.-pubinβ read in a public key, not a private key.-puboutβ output a public key, not a private key. automatically set if the input is a public key.-pvk-none|-pvk-strong|-pvk-weakβ enable or disable PVK encoding. the default is-pvk-strong.-RSAPublicKey_in,-RSAPublicKey_outβ same as-pubinand-puboutexcept the RSAPublicKey format is used instead. π-textβ print the public/private key components in plain text. all the little components, out in the open, no cap π
π RSAUTL π
Okay bestie, so rsautl is your go-to for all things RSA β signing, verifying, encrypting, decrypting. One tool, four moods. Periodt. π₯
openssl rsautl [-asn1parse] [-certin] [-decrypt] [-encrypt] [-hexdump]
[-in file] [-inkey file] [-keyform der | pem]
[-oaep | -pkcs | -raw | -x931] [-out file] [-passin arg]
[-pubin] [-rev] [-sign] [-verify]
The rsautl command can be used to sign, verify, encrypt and decrypt data using the RSA algorithm. That's it, that's the whole vibe check. π
β¨ OPTIONS β¨
The options are as follows:
-asn1parseβ Does an asn1parse on the output data. Lowkey a slay when you pair it with-verify, just saying. π-certinβ The input is a certificate containing an RSA public key. Like, a whole cert, not just the key.-decryptβ Decrypt the input data using an RSA private key. Secrets unlocked. π-encryptβ Encrypt the input data using an RSA public key. Lock it down. π-hexdumpβ Hex dump the output data. For when you want to see the actual bytes, no cap.-in fileβ The input to read from, or standard input if not specified.-inkey fileβ The input key file. By default it's assumed to be an RSA private key.-keyform der | pemβ The private key format. The default ispem.-oaep,-pkcs,-raw,-x931β Picks the padding. In order: PKCS#1 OAEP, PKCS#1 v1.5 (the default), no padding, or ANSI X9.31. For signatures though, only-pkcsand-rawcan be used β the other two simply do not apply, bestie. π-out fileβ The output file to write to, or standard output if not specified.-passin argβ The key password source.-pubinβ The input file is an RSA public key. Heads up so it doesn't try to read it as private. β¨-revβ Reverse the order of the input buffer. Backwards but make it fashion. π¦-signβ Sign the input data and output the signed result. This one requires an RSA private key β no exceptions.-verifyβ Verify the input data and output the recovered data. The truth-teller of the group chat. β
π S_CLIENT π
This is the big one, bestie β the generic SSL/TLS client that connects to a remote host over SSL/TLS. Buckle in, it's giving main character energy and a lot of flags. π
openssl s_client [-4 | -6] [-alpn protocols] [-bugs] [-CAfile file]
[-CApath directory] [-cert file] [-certform der | pem]
[-check_ss_sig] [-cipher cipherlist]
[-connect host[:port]] [-crl_check] [-crl_check_all]
[-crlf] [-debug] [-dtls] [-dtls1_2] [-extended_crl]
[-groups list] [-host host] [-ign_eof]
[-ignore_critical] [-issuer_checks] [-key keyfile]
[-keyform der | pem] [-keymatexport label]
[-keymatexportlen len] [-legacy_server_connect] [-msg]
[-mtu mtu] [-nbio] [-nbio_test] [-no_comp]
[-no_ign_eof] [-no_legacy_server_connect] [-no_ticket]
[-no_tls1_2] [-no_tls1_3] [-pass arg] [-policy_check]
[-port port] [-prexit] [-proxy host:port] [-quiet]
[-reconnect] [-servername name] [-serverpref]
[-sess_in file] [-sess_out file] [-showcerts]
[-starttls protocol] [-state] [-status] [-timeout]
[-tls1_2] [-tls1_3] [-tlsextdebug]
[-use_srtp profiles] [-verify depth]
[-verify_return_error] [-x509_strict] [-xmpphost host]
The s_client command implements a generic SSL/TLS client which connects to a remote host using SSL/TLS. Like a little handshake with the server, but make it cryptography. π€
So here's how it behaves: if a connection is established with an SSL server, any data received from the server is displayed and any key presses will be sent to the server. When used interactively (which means neither -quiet nor -ign_eof have been given), the session will be renegotiated if the line begins with an R; if the line begins with a Q or if end of file is reached, the connection will be closed down. Cute little control scheme, ngl. π
πΈ OPTIONS πΈ
The options are as follows:
-4β Attempt connections using IPv4 only. Old reliable. π§-6β Attempt connections using IPv6 only.-alpn protocolsβ Enable the Application-Layer Protocol Negotiation.protocolsis a comma-separated list of protocol names that the client should advertise support for. Flex your capabilities. β¨-bugsβ Enable various workarounds for buggy implementations. We're being nice to the messy servers today. π-CAfile fileβ A file containing trusted certificates to use during server authentication and to use when attempting to build the client certificate chain.-CApath directoryβ The directory to use for server certificate verification. This directory must be in "hash format" β see-verifyfor more information. These are also used when building the client certificate chain.-cert fileβ The certificate to use, if one is requested by the server. The default is not to use a certificate. Don't hand it out unless asked.-certform der | pemβ The certificate format. The default ispem.-check_ss_sig,-crl_check,-crl_check_all,-extended_crl,-ignore_critical,-issuer_checks,-policy_check,-x509_strictβ Set various certificate chain validation options. See theverifycommand for details β that's where the lore lives. π-cipher cipherlistβ Modify the cipher list sent by the client. Although the server determines which cipher suite is used, it should take the first supported cipher in the list sent by the client. See thecipherscommand for more information.-connect host[:port]β The host and port to connect to. If not specified, an attempt is made to connect to the local host on port4433. Alternatively, the host and port pair may be separated using a forward-slash character, which is useful for numeric IPv6 addresses. Slash instead of colon, iconic. π¦-crlfβ Translate a line feed from the terminal into CR+LF, as required by some servers. Old-school servers need their little line endings, bless. π-debugβ Print extensive debugging information, including a hex dump of all traffic. Everything. All of it. The whole tea. β-dtlsβ Permit any version of DTLS.-dtls1_2β Permit only DTLS1.2. Exclusive, much? π-groups listβ Set the supported elliptic curve groups to the colon separated list of group NIDs or names as documented inSSL_CTX_set1_groups_list(3).-host hostβ The host to connect to. The default islocalhost.-ign_eofβ Inhibit shutting down the connection when end of file is reached in the input. Stay in the chat, bestie. π-key keyfileβ The private key to use. If not specified, the certificate file will be used.-keyform der | pemβ The private key format. The default ispem.-keymatexport labelβ Export keying material usinglabel.-keymatexportlen lenβ Exportlenbytes of keying material (default20).-legacy_server_connect,-no_legacy_server_connectβ Allow or disallow initial connection to servers that don't support RI. Yes, it's a switch-flip situation. π-msgβ Show all protocol messages with hex dump. Receipts for every message. π§Ύ-mtu mtuβ Set the link layer MTU.-nbioβ Turn on non-blocking I/O.-nbio_testβ Test non-blocking I/O. Just vibes and testing, together.-no_ign_eofβ Shut down the connection when end of file is reached in the input. Can be used to override the implicit-ign_eofafter-quiet. Love an override. π-no_tls1_2|-no_tls1_3β Disable the use of TLS1.2 and 1.3, respectively. Tell those versions they're not invited. π-no_ticketβ Disable RFC 4507 session ticket support.-pass argβ The private key password source.-port portβ The port to connect to. The default is4433.-prexitβ Print session information when the program exits. This will always attempt to print out information even if the connection fails. Normally, information will only be printed out once if the connection succeeds. This option is useful because the cipher in use may be renegotiated or the connection may fail because a client certificate is required or is requested only after an attempt is made to access a certain URL. Note that the output produced by this option is not always accurate because a connection might never have been established. So like, take it with a grain of salt, bestie. π-proxy host:portβ Use the HTTP proxy athostandport. The connection to the proxy is done in cleartext and the-connectargument is given to the proxy. If not specified,localhostis used as final destination. After that, switch the connection through the proxy to the destination to TLS. Cleartext first, then glow-up to TLS. β¨-quietβ Inhibit printing of session and certificate information. This implicitly turns on-ign_eofas well. Peace and quiet, finally. π€«-reconnectβ Reconnect to the same server 5 times using the same session ID; this can be used as a test that session caching is working. Five taps to make sure the cache remembers you. π₯-servername nameβ Include the TLS Server Name Indication (SNI) extension in the ClientHello message, using the specified server name.-showcertsβ Display the whole server certificate chain: normally only the server certificate itself is displayed. The full family tree, not just the one cert. π-serverprefβ Use the server's cipher preferences. Let them choose, it's their house.-sess_in fileβ Load TLS session fromfile. The client will attempt to resume a connection from this session. Reusing sessions, sustainable queen. π-sess_out fileβ Output TLS session tofile.-starttls protocolβ Send the protocol-specific messages to switch to TLS for communication.protocolis a keyword for the intended protocol. Currently, the supported keywords are"ftp","imap","sieve","smtp","pop3", and"xmpp". Pick your fighter. π₯-stateβ Print the SSL session states. Watch the whole storyline unfold. π-statusβ Send a certificate status request to the server (OCSP stapling). The server response (if any) is printed out.-timeoutβ Enable send/receive timeout on DTLS connections.-tls1_2|-tls1_3β Permit only TLS1.2 or 1.3 respectively.-tlsextdebugβ Print a hex dump of any TLS extensions received from the server. Extension receipts, printed. π§Ύ-use_srtp profilesβ Offer SRTP key management with a colon-separated profile list.-verify depthβ Turn on server certificate verification, with a maximum length ofdepth. Currently the verify operation continues after errors so all the problems with a certificate chain can be seen. As a side effect the connection will never fail due to a server certificate verify failure. Yeah, it's a little messy, but that's how it works. π-verify_return_errorβ Return verification error. Unlike the above, this one will actually complain. π-xmpphost hostnameβ When used with-starttls xmpp, specify the host for the"to"attribute of the stream element. If this option is not specified then the host specified with-connectwill be used.
π S_SERVER π
okay bestie, before we do literally anything else, here's the synopsis in all its glory β every flag, exactly as it's written, no cap:
openssl s_server [-accept port] [-alpn protocols] [-bugs]
[-CAfile file] [-CApath directory] [-cert file]
[-cert2 file] [-certform der | pem]
[-cipher cipherlist] [-context id] [-crl_check]
[-crl_check_all] [-crlf] [-dcert file]
[-dcertform der | pem] [-debug] [-dhparam file]
[-dkey file] [-dkeyform der | pem] [-dpass arg]
[-dtls] [-dtls1] [-dtls1_2] [-groups list] [-HTTP]
[-id_prefix arg] [-key keyfile] [-key2 keyfile]
[-keyform der | pem] [-keymatexport label]
[-keymatexportlen len] [-msg] [-mtu mtu]
[-naccept num] [-named_curve arg] [-nbio] [-nbio_test]
[-no_cache] [-no_dhe] [-no_ecdhe] [-no_ticket]
[-no_tls1_2] [-no_tls1_3] [-no_tmp_rsa] [-nocert]
[-pass arg] [-quiet] [-servername name]
[-servername_fatal] [-serverpref] [-state] [-status]
[-status_timeout nsec] [-status_url url]
[-status_verbose] [-timeout] [-tls1_2] [-tls1_3]
[-tlsextdebug] [-use_srtp profiles] [-Verify depth]
[-verify depth] [-verify_return_error] [-WWW] [-www]
So here's the vibe: s_server is the generic SSL/TLS server, and what it does is literally just sit there and listen for connections on a port using SSL/TLS. That's the whole job description. π§
π«Ά the interactive bits (iykyk)
If a connection request gets established with a client and you did not use -www or -WWW, then everything is very cute and hands-on: any data received from the client gets displayed, and any key you press gets sent to the client. It's giving β¨live chatβ¨.
Certain single letter commands do special operations:
- P β Send plain text, which should cause the client to disconnect.
- Q β End the current SSL connection and exit.
- q β End the current SSL connection, but still accept new connections.
- R β Renegotiate the SSL session and request a client certificate.
- r β Renegotiate the SSL session.
- S β Print out some session cache status information.
β¨ OPTIONS β¨
The options are as follows, bestie β buckle up, there's a lot:
-accept portβ Listen on TCPportfor connections. The default is port4433. π-alpn protocolsβ Turns on the Application-Layer Protocol Negotiation.protocolsis a comma-separated list of supported protocol names.-bugsβ Enables various workarounds for buggy implementations. (yes it's literally called bugs, we love a self-aware icon)-CAfile fileβ A file containing trusted certificates, used during client authentication and used when trying to build the server certificate chain. That same list also gets used in the list of acceptable client CAs that's passed to the client when a certificate is requested. multitasking queen π-CApath directoryβ The directory to use for client certificate verification. This directory must be in "hash format"; peep-verifyfor more information. These are also used when building the server certificate chain.-cert fileβ The certificate to use. Most server's cipher suites require the use of a certificate, and some require a certificate with a certain public key type. For example, the DSS cipher suites require a certificate containing a DSS (DSA) key. If you don't specify it, the fileserver.pemwill be used.-cert2 fileβ The certificate to use for servername.-certform der | pemβ The certificate format. The default ispem.-cipher cipherlistβ Modify the cipher list used by the server. This allows the cipher list used by the server to be modified. When the client sends a list of supported ciphers, the first client cipher that's also included in the server list is used. Because the client specifies the preference order, the order of the server cipherlist is irrelevant (lowkey iconic of her). See thecipherscommand for more information.-context idβ Set the SSL context ID. It can be given any string value. any. go feral. π-crl_check,-crl_check_allβ Check that the peer certificate has not been revoked by its CA. The CRLs are appended to the certificate file.-crl_check_allchecks all CRLs of all CAs in the chain.-crlfβ Translate a line feed from the terminal into CR+LF.-dcert file,-dkey fileβ Specify an additional certificate and private key; these behave in the same manner as the-certand-keyoptions except there is no default if they are not specified (so no additional certificate or key is used). By using RSA and DSS certificates and keys, a server can support clients which only support RSA or DSS cipher suites by using an appropriate certificate. teamwork fr fr π«Ά-dcertform der | pem,-dkeyform der | pem,-dpass argβ Additional certificate and private key format, and private key password source, respectively.-debugβ Print extensive debugging information, including a hex dump of all traffic. the way she dumps hex... π-dhparam fileβ The DH parameter file to use. The ephemeral DH cipher suites generate keys using a set of DH parameters. If not specified, an attempt is made to load the parameters from the server certificate file. If that fails, a static set of parameters hard coded into thes_serverprogram will be used.-dtlsβ Permit any version of DTLS.-dtls1_2β Permit only DTLS1.2.-groups listβ Set the supported elliptic curve groups to the colon separated list of group NIDs or names as documented inSSL_CTX_set1_groups_list(3).-HTTPβ Emulate a simple web server. Pages are resolved relative to the current directory. For example if the URLhttps://myhost/page.htmlis requested, the file./page.htmlwill be loaded. The files loaded are assumed to contain a complete and correct HTTP response (lines that are part of the HTTP response line and headers must end with CRLF). β οΈ that last bit is load-bearing, don't skip it.-id_prefix argβ Generate SSL/TLS session IDs prefixed byarg. This is mostly useful for testing any SSL/TLS code that wish to deal with multiple servers, when each of which might be generating a unique range of session IDs.-key keyfileβ The private key to use. If not specified, the certificate file will be used.-key2 keyfileβ The private key to use for servername.-keyform der | pemβ The private key format. The default ispem.-keymatexport labelβ Export keying material usinglabel.-keymatexportlen lenβ Exportlenbytes of keying material (default20).-msgβ Show all protocol messages with hex dump.-mtu mtuβ Set the link layer MTU.-naccept numβ Terminate the server afternumconnections.-named_curve argβ Specify the elliptic curve name to use for ephemeral ECDH keys. > This option is deprecated; use-groupsinstead. (she's retired, let her rest π)-nbioβ Turn on non-blocking I/O.-nbio_testβ Test non-blocking I/O.-no_cacheβ Disable session caching.-no_dheβ Disable ephemeral DH cipher suites.-no_ecdheβ Disable ephemeral ECDH cipher suites.-no_ticketβ Disable RFC 4507 session ticket support.-no_tls1_2|-no_tls1_3β Disable the use of TLS1.2 and 1.3, respectively.-no_tmp_rsaβ Disable temporary RSA key generation.-nocertβ Do not use a certificate. This restricts the cipher suites available to the anonymous ones (currently just anonymous DH). no cert, no problem π¦-pass argβ The private key password source.-quietβ Inhibit printing of session and certificate information. shhh π€«-servername nameβ Set the TLS Server Name Indication (SNI) extension withname.-servername_fatalβ Send a fatal alert if servername does not match. The default is a warning alert.-serverprefβ Use server's cipher preferences.-stateβ Print the SSL session states.-statusβ Enables certificate status request support (OCSP stapling).-status_timeout nsecβ Sets the timeout for OCSP response in seconds.-status_url urlβ Sets a fallback responder URL to use if no responder URL is present in the server certificate. Without this option, an error is returned if the server certificate does not contain a responder address.-status_verboseβ Enables certificate status request support (OCSP stapling) and gives a verbose printout of the OCSP response.-timeoutβ Enable send/receive timeout on DTLS connections.-tls1_2|-tls1_3β Permit only TLS1.2, or 1.3, respectively.-tlsextdebugβ Print a hex dump of any TLS extensions received from the server.-use_srtp profilesβ Offer SRTP key management with a colon-separated profile list.-verify_return_errorβ Return verification error.-WWWβ Emulate a simple web server. Pages are resolved relative to the current directory. For example if the URLhttps://myhost/page.htmlis requested, the file./page.htmlwill be loaded.-wwwβ Send a status message to the client when it connects, including information about the ciphers used and various session parameters. The output is in HTML format, so this option will normally be used with a web browser. π-Verify depth,-verify depthβ Request a certificate chain from the client, with a maximum length ofdepth. With-Verify, the client must supply a certificate or an error occurs; with-verify, a certificate is requested but the client does not have to send one. note the capital V, it's giving strict vs chill π
β±οΈ S_TIME π
okay so s_time is literally a generic SSL/TLS client that connects to a remote host using SSL/TLS. It can request a page from the server and includes the time to transfer the payload data in its timing measurements. It measures the number of connections within a given timeframe, the amount of data transferred (if any), and calculates the average time spent for one connection. Benchmark goblin energy, no cap π°οΈβ¨
openssl s_time [-bugs] [-CAfile file] [-CApath directory] [-cert file]
[-cipher cipherlist] [-connect host[:port]]
[-key keyfile] [-nbio] [-new] [-no_shutdown] [-reuse]
[-time seconds] [-verify depth] [-www page]
The options are as follows, bestie:
-bugsβ Enable various workarounds for buggy implementations. π-CAfile fileβ A file containing trusted certificates to use during server authentication and to use when attempting to build the client certificate chain. π-CApath directoryβ The directory to use for server certificate verification. This directory must be in"hash format"; seeverifyfor more information. These are also used when building the client certificate chain. π-cert fileβ The certificate to use, if one is requested by the server. The default is not to use a certificate. πͺͺ-cipher cipherlistβ Modify the cipher list sent by the client. Although the server determines which cipher suite is used, it should take the first supported cipher in the list sent by the client. See thecipherscommand for more information. π-connect host[:port]β The host and port to connect to. π-key keyfileβ The private key to use. If not specified, the certificate file will be used. ποΈ-nbioβ Turn on non-blocking I/O. β‘-newβ Perform the timing test using a new session ID for each connection. If neither-newnor-reuseare specified, they are both on by default and executed in sequence. π-no_shutdownβ Shut down the connection without sending a"close notify"shutdown alert to the server. π-reuseβ Perform the timing test using the same session ID for each connection. If neither-newnor-reuseare specified, they are both on by default and executed in sequence. π-time secondsβ Limits_timebenchmarks to the number of seconds. The default is 30 seconds. β³-verify depthβ Turn on server certificate verification, with a maximum length ofdepth. Currently the verify operation continues after errors, so all the problems with a certificate chain can be seen. As a side effect, the connection will never fail due to a server certificate verify failure. π-www pageβ The page to GET from the server. A value of/gets theindex.htm[l]page. If this parameter is not specified,s_timewill only perform the handshake to establish SSL connections but not transfer any payload data. π
πͺͺ SESS_ID π
The sess_id program processes the encoded version of the SSL session structure and optionally prints out SSL session details (for example the SSL session master key) in human-readable format. It's giving session-inspector main character energy ππ
openssl sess_id [-cert] [-context ID] [-in file] [-inform der | pem]
[-noout] [-out file] [-outform der | pem] [-text]
The options are as follows:
-certβ If a certificate is present in the session, it will be output using this option; if the-textoption is also present, then it will be printed out in text form. π-context IDβ Set the session ID. The ID can be any string of characters. π·οΈ-in fileβ The input file to read from, or standard input if not specified. π₯-inform der | pemβ The input format.deruses an ASN.1 DER-encoded format containing session details. The precise format can vary from one version to the next.pemis the default format: it consists of the DER format base64-encoded with additional header and footer lines. π§¬-nooutβ Do not output the encoded version of the session. π«-out fileβ The output file to write to, or standard output if not specified. π€-outform der | pemβ The output format. π-textβ Print the various public or private key components in plain text, in addition to the encoded version. π
The output of sess_id is composed as follows:
Protocolβ The protocol in use.Cipherβ The actual raw SSL or TLS cipher code.Session-IDβ The SSL session ID, in hex format.Session-ID-ctxβ The session ID context, in hex format.Master-Keyβ The SSL session master key.Key-Argβ The key argument; this is only used in SSL v2.Start Timeβ The session start time. Unix format.Timeoutβ The timeout, in seconds.Verify return codeβ The return code when a certificate is verified.
β οΈ Since the SSL session output contains the master key, it is possible to read the contents of an encrypted session using this information. Therefore appropriate security precautions should be taken if the information is being output by a "real" application. This is, however, strongly discouraged and should only be used for debugging purposes. π₯π
β¨ SMIME β¨
openssl smime [-aes128 | -aes192 | -aes256 | -des |
-des3 | -rc2-40 | -rc2-64 | -rc2-128] [-binary]
[-CAfile file] [-CApath directory] [-certfile file]
[-check_ss_sig] [-content file] [-crl_check]
[-crl_check_all] [-decrypt] [-encrypt] [-extended_crl]
[-from addr] [-ignore_critical] [-in file] [-indef]
[-inform der | pem | smime] [-inkey file]
[-issuer_checks] [-keyform der | pem] [-md digest]
[-noattr] [-nocerts] [-nochain] [-nodetach] [-noindef]
[-nointern] [-nosigs] [-nosmimecap] [-noverify]
[-out file] [-outform der | pem | smime] [-passin arg]
[-pk7out] [-policy_check] [-recip file] [-resign] [-sign]
[-signer file] [-stream] [-subject s] [-text] [-to addr]
[-verify] [-x509_strict] [cert.pem ...]
okay so the smime command is your whole S/MIME mail bestie π β it can encrypt, decrypt, sign, and verify S/MIME messages. That's the whole vibe. Four things, all iconic.
Quick vibe check on formatting, bestie, because this is where people mess up: the MIME message has to go out with no blank lines between the headers and the output. Some mail programs will just add a blank line on their own, unprompted, no cap π. Piping the mail directly into an MTA is one way to actually get the correct format.
Also, the message you hand over to be signed or encrypted must include the necessary MIME headers, or a lot of S/MIME clients won't display it properly β or like, at all π. Use the -text option to have plain text headers added for you automatically.
A "signed and encrypted" message is literally one where a signed message gets encrypted afterwards. So you make it by encrypting a message that's already signed. Easy.
There are a handful of operations you can run. Here's the whole lineup:
-decryptβ decrypt mail using the certificate and private key you supply. The input file is an encrypted mail message in MIME format. The decrypted mail gets written to the output file.-encryptβ encrypt mail for the recipient certificates you give it. Input = the message to be encrypted. Output file = the encrypted mail, in MIME format.-pk7outβ take an input message and write out a PEM-encoded PKCS#7 structure.-resignβ resign a message: you take an existing message plus one or more new signers.-signβ sign mail using the certificate and private key you supply. The input file is the message to sign. The signed message, in MIME format, lands in the output file.-verifyβ verify signed mail. Input is a signed mail message; output is the signed data. Both clear text and opaque signing are supported π .
β¨ the rest of the options β¨
The remaining options are as follows, and yes there are a lot of them, but you got this π«Ά:
-aes128|-aes192|-aes256|-des|-des3|-rc2-40|-rc2-64|-rc2-128β which encryption algorithm to use. Respectively: 128-, 192-, or 256-bit AES, DES (56 bits), triple DES (168 bits), or 40-, 64-, or 128-bit RC2. If you don't specify anything, 256-bit AES is what you get. Only used with-encrypt.-binaryβ normally the input message gets converted to "canonical" format, which uses CR/LF as end of line, because that's what the S/MIME spec requires. When this option is present, no translation happens. Super useful when you're handling binary data that maybe isn't in MIME format at all.-CAfile fileβ a file containing trusted CA certificates. Only used with-verify.-CApath directoryβ a directory containing trusted CA certificates. Only used with-verify. This directory has to be a standard certificate directory β meaning a hash of each subject name (computed withx509 -hash) should be linked to each certificate.cert.pem ...β one or more certificates of message recipients. Used when you're encrypting a message.-certfile fileβ lets you specify additional certificates. When signing, these get included with the message. When verifying, they're searched for the signers' certificates. The certificates should be in PEM format.-check_ss_sig,-crl_check,-crl_check_all,-extended_crl,-ignore_critical,-issuer_checks,-policy_check,-x509_strictβ these set various certificate chain validation options. Go look at theverifycommand for the details.-content fileβ a file containing the detached content. Only useful with the-verifyoption, and only usable if the PKCS#7 structure is using the detached signature form where the content isn't included. This option overrides any content if the input format is S/MIME and it's using themultipart/signedMIME content type.-from addr,-subject s,-to addrβ the relevant mail headers. These are included outside the signed portion of a message, so they can be included manually. When signing, a lot of S/MIME mail clients check that the signer's certificate email address matches theFrom:address π.-in fileβ the input file to read from.-indefβ enables streaming I/O for encoding operations. This permits single pass processing of data without needing to hold the entire contents in memory, which can potentially support very large files. Streaming is automatically set for S/MIME signing with detached data if the output format is SMIME; right now it's off by default for all other operations.-inform der | pem | smimeβ the input format.-inkey fileβ the private key to use when signing or decrypting, which has to match the corresponding certificate. If you don't specify this option, the private key must be included in the certificate file specified with the-recipor-signerfile. When signing, you can use this option multiple times to specify successive keys.-keyform der | pemβ input private key format. Default ispem.-md digestβ the digest algorithm to use when signing or resigning. If it's not present, the default digest algorithm for the signing key gets used (usually SHA1).-noattrβ don't include attributes.-nocertsβ don't include the signer's certificate. This shrinks the signed message, but then the verifier has to have a copy of the signer's certificate available locally (passed with the-certfileoption, for example).-nochainβ don't do chain verification of signers' certificates β that is, don't use the certificates in the signed message as untrusted CAs.-nodetachβ when signing a message, use opaque signing. This form is more resistant to translation by mail relays, but it can't be read by mail agents that don't support S/MIME π¬. Without this option, cleartext signing with the MIME typemultipart/signedis used.-noindefβ disable streaming I/O where it would produce an encoding of indefinite length. (Currently has no effect.)-nointernβ only use certificates specified in the-certfile. The supplied certificates can still be used as untrusted CAs.-nosigsβ don't try to verify the signatures on the message.-nosmimecapβ exclude the list of supported algorithms from signed attributes. Other options, like signing time and content type, are still included.-noverifyβ don't verify the signer's certificate of a signed message.-out fileβ the output file to write to.-outform der | pem | smimeβ the output format. Default issmime, which writes an S/MIME format message.pemandderchange that so it writes PEM and DER format PKCS#7 structures instead. This currently only affects the output format of the PKCS#7 structure; if no PKCS#7 structure is being output (like with-verifyor-decrypt) then this option does nothing.-passin argβ the key password source.-recip fileβ the recipient's certificate when decrypting a message. This certificate must match one of the recipients of the message, or you get an error.-signer fileβ a signing certificate when signing or resigning a message. This option can be used multiple times if you need more than one signer. If a message is being verified, the signer's certificates get written to this file if the verification was successful β¨.-streamβ the same as-indef.-textβ add plain text (text/plain) MIME headers to the supplied message if you're encrypting or signing. If you're decrypting or verifying, it strips the text headers off β and if the decrypted or verified message isn't of MIME typetext/plain, then you get an error.
π exit codes, bestie π
The exit codes for smime are as follows:
0β the operation was completely successful. slay π1β an error occurred parsing the command options.2β one of the input files could not be read.3β an error occurred creating the file or when reading the message.4β an error occurred decrypting or verifying the message.5β an error occurred writing certificates.
π₯ SPEED π₯
openssl speed [algorithm] [-decrypt] [-elapsed] [-evp algorithm] [-mr]
[-multi number] [-unaligned number]
The speed command tests how fast cryptographic algorithms actually go. It's giving benchmark era, honestly πββοΈπ¨.
algorithmβ perform the test using algorithm. The default is to test all algorithms.-decryptβ time decryption instead of encryption. Must be used with-evp.-elapsedβ measure time in real time instead of CPU user time.-evp algorithmβ perform the test using one of the algorithms accepted byEVP_get_cipherbyname(3).-mrβ produce machine readable output.-multi numberβ run number benchmarks in parallel.-unaligned numberβ use allocated buffers with an offset of number bytes from the alignment provided bymalloc(3). number should be between0and16.
π¦ TS π¦
openssl ts -query [-md4 | -md5 | -ripemd160 | -sha1] [-cert]
[-config configfile] [-data file_to_hash]
[-digest digest_bytes] [-in request.tsq] [-no_nonce]
[-out request.tsq] [-policy object_id] [-text]
openssl ts -reply [-chain certs_file.pem] [-config configfile]
[-in response.tsr] [-inkey private.pem] [-out response.tsr]
[-passin arg] [-policy object_id] [-queryfile request.tsq]
[-section tsa_section] [-signer tsa_cert.pem] [-text]
[-token_in] [-token_out]
okay so ts has two whole modes going on β -query for making a request and -reply for making a response β and both of them come with a whole lil' bag of options. Stay tuned, the details are coming π
openssl ts -verify [-CAfile trusted_certs.pem]
[-CApath trusted_cert_path] [-data file_to_hash]
[-digest digest_bytes] [-in response.tsr]
[-queryfile request.tsq] [-token_in]
[-untrusted cert_file.pem]
Okay so ts is the basic Time Stamping Authority (TSA) client and server app, exactly as specified in RFC 3161 (the Time-Stamp Protocol, aka TSP) π
A TSA can totally be part of a PKI deployment, and its whole role in life is providing long term proof that some specific data existed. Here's the protocol tea, briefly:
- The TSA client computes a one-way hash value for a data file and sends the hash to the TSA.
- The TSA attaches the current date and time to the received hash value, signs them and sends the time stamp token back to the client. By creating this token the TSA certifies the existence of the original data file at the time of response generation.
- The TSA client receives the time stamp token and verifies the signature on it. It also checks if the token contains the same hash value that it had sent to the TSA.
There's one DER-encoded protocol data unit defined for transporting a time stamp request to the TSA, and one for sending the time stamp response back to the client π So the ts command has three main functions, no cap: creating a time stamp request based on a data file; creating a time stamp response based on a request; and verifying if a response corresponds to a particular request or a data file.
π«Ά Real talk: there is no support for sending the requests/responses automatically over HTTP or TCP yet as suggested in RFC 3161. Users must send the requests either by FTP or email. Yes, fr fr, that's the vibe.
πΈ the -query life: making a request
The -query switch can be used for creating and printing a time stamp request with the following options:
-certβ Expect the TSA to include its signing certificate in the response.-configconfigfile β Specify an alternative configuration file. Only theOIDsection is used, bestie.-datafile_to_hash β The data file for which the time stamp request needs to be created. The default is standard input.-digestdigest_bytes β Specify the message imprint explicitly without the data file. The imprint must be specified in a hexadecimal format, two characters per byte, the bytes optionally separated by colons. The number of bytes must match the message digest algorithm in use.-inrequest.tsq β A previously created time stamp request in DER format that will be printed into the output file. Useful for examining the content of a request in human-readable format.-md4|-md5|-ripemd160|-sha|-sha1β The message digest to apply to the data file. It supports all the message digest algorithms that are supported by thedgstcommand. The default isSHA1.-no_nonceβ Specify no nonce in the request. The default, to include a 64-bit long pseudo-random nonce, is recommended to protect against replay attacks π₯-outrequest.tsq β The output file to write to, or standard output if not specified.-policyobject_id β The policy that the client expects the TSA to use for creating the time stamp token. Either dotted OID notation or OID names defined in the config file can be used. If no policy is requested, the TSA uses its own default policy.-textβ Output in human-readable text format instead of DER.
β¨ the -reply era: making a response
A time stamp response (TimeStampResp) consists of a response status and the time stamp token itself (ContentInfo), if the token generation was successful. The -reply command is for creating a time stamp response or time stamp token based on a request, and printing the response/token in human-readable format. If -token_out is not specified the output is always a time stamp response (TimeStampResp), otherwise it is a time stamp token (ContentInfo).
-chaincerts_file.pem β The collection of PEM certificates that will be included in the response in addition to the signer certificate if the-certoption was used for the request. This file is supposed to contain the certificate chain for the signer certificate from its issuer upwards. The-replycommand does not build a certificate chain automatically β it's giving "you're on your own" energy π-configconfigfile β Specify an alternative configuration file.-inresponse.tsr β Specify a previously created time stamp response (or time stamp token, if-token_inis also specified) in DER format that will be written to the output file. This option does not require a request; it is useful, for example, to examine the content of a response or token or to extract the time stamp token from a response. If the input is a token and the output is a time stamp response, a default "granted" status info is added to the token π-inkeyprivate.pem β The signer private key of the TSA in PEM format. Overrides thesigner_keyconfig file option.-outresponse.tsr β The response is written to this file. The format and content of the file depends on other options (see-textand-token_out). The default isstdout.-passinarg β The key password source.-policyobject_id β The default policy to use for the response. Either dotted OID notation or OID names defined in the config file can be used. If no policy is requested, the TSA uses its own default policy.-queryfilerequest.tsq β The file containing a DER-encoded time stamp request.-sectiontsa_section β The config file section containing the settings for response generation.-signertsa_cert.pem β The PEM signer certificate of the TSA. The TSA signing certificate must have exactly one extended key usage assigned to it:timeStamping. The extended key usage must also be critical, otherwise the certificate is going to be refused π Overrides thesigner_certvariable of the config file.-textβ Output in human-readable text format instead of DER.-token_inβ The input is a DER-encoded time stamp token (ContentInfo) instead of a time stamp response (TimeStampResp).-token_outβ The output is a time stamp token (ContentInfo) instead of a time stamp response (TimeStampResp).
π¦ the -verify check: is this even valid?
The -verify command is for verifying if a time stamp response or time stamp token is valid and matches a particular time stamp request or data file. The -verify command does not use the configuration file π
-CAfiletrusted_certs.pem β The file containing a set of trusted self-signed PEM CA certificates. Seeverifyfor additional details. Either this option or-CApathmust be specified.-CApathtrusted_cert_path β The directory containing the trusted CA certificates of the client. Seeverifyfor additional details. Either this option or-CAfilemust be specified.-datafile_to_hash β The response or token must be verified against file_to_hash. The file is hashed with the message digest algorithm specified in the token. The-digestand-queryfileoptions must not be specified with this one.-digestdigest_bytes β The response or token must be verified against the message digest specified with this option. The number of bytes must match the message digest algorithm specified in the token. The-dataand-queryfileoptions must not be specified with this one.-inresponse.tsr β The time stamp response that needs to be verified, in DER format. This option is mandatory β-queryfilerequest.tsq β The original time stamp request, in DER format. The-dataand-digestoptions must not be specified with this one.-token_inβ The input is a DER-encoded time stamp token (ContentInfo) instead of a time stamp response (TimeStampResp).-untrustedcert_file.pem β Additional untrusted PEM certificates which may be needed when building the certificate chain for the TSA's signing certificate. This file must contain the TSA signing certificate and all intermediate CA certificates unless the response includes them.
π config file things (options on the command line always win, periodt)
Options specified on the command line always override the settings in the config file:
tsasection,default_tsaβ This is the main section and it specifies the name of another section that contains all the options for the-replyoption. This section can be overridden with the-sectioncommand line switch.oid_fileβ Seecafor a description.oid_sectionβ Seecafor a description.serialβ The file containing the hexadecimal serial number of the last time stamp response created. This number is incremented by 1 for each response. If the file does not exist at the time of response generation, a new file is created with serial number1. This parameter is mandatory.signer_certβ TSA signing certificate, in PEM format. The same as the-signercommand line option.certsβ A set of PEM-encoded certificates that need to be included in the response. The same as the-chaincommand line option.signer_keyβ The private key of the TSA, in PEM format. The same as the-inkeycommand line option.default_policyβ The default policy to use when the request does not mandate any policy. The same as the-policycommand line option.other_policiesβ Comma separated list of policies that are also acceptable by the TSA and used only if the request explicitly specifies one of them.digestsβ The list of message digest algorithms that the TSA accepts. At least one algorithm must be specified. This parameter is mandatory π₯accuracyβ The accuracy of the time source of the TSA in seconds, milliseconds and microseconds. For example,secs:1, millisecs:500, microsecs:100. If any of the components is missing, zero is assumed for that field.clock_precision_digitsβ The maximum number of digits, which represent the fraction of seconds, that need to be included in the time field. The trailing zeroes must be removed from the time, so there might actually be fewer digits or no fraction of seconds at all. The maximum value is6; the default is0.
ordering
If you set this to yes, the responses your TSA spits out can always be ordered β even when the time gap between two responses is less than the sum of their accuracies. Default? no. π
tsa_name
Set this to yes if the subject name of the TSA has to be in the TSA name field of the response. Default is no.
ess_cert_id_chain
Okay so the SignedData objects your TSA creates always carry the certificate identifier of the signing certificate inside a signed attribute (peep RFC 2634, Enhanced Security Services). Now: if you set this option to yes and either the certs variable or the -chain option is specified, then the certificate identifiers of the chain get included in the SigningCertificate signed attribute too. If you set it to no, only the signing certificate identifier goes in. Default is no. π
β¨ VERIFY β¨
openssl verify [-CAfile file] [-CApath directory] [-check_ss_sig]
[-CRLfile file] [-crl_check] [-crl_check_all]
[-explicit_policy] [-extended_crl] [-help]
[-ignore_critical] [-inhibit_any] [-inhibit_map]
[-issuer_checks] [-legacy_verify] [-policy_check]
[-purpose purpose] [-trusted file] [-untrusted file]
[-verbose] [-x509_strict] [certificates]
The verify command verifies certificate chains. That's the whole gig bestie. π¦
The options are as follows:
-CAfile fileβ a file of trusted certificates. It should hold multiple certificates in PEM format, all concatenated together.-CApath directoryβ a directory of trusted certificates. The certificates (or symlinks pointing at them) should be named likehash.0, wherehashis the hashed certificate subject name β see the-hashoption of thex509utility. π-check_ss_sigβ verify the signature on the self-signed root CA. It's disabled by default because ngl it doesn't add any security.-CRLfile fileβ the file should contain one or more CRLs in PEM format.-crl_checkβ check end entity certificate validity by trying to look up a valid CRL. If no valid CRL can be found, that's an error, periodt.-crl_check_allβ check the validity of all certificates in the chain by attempting to look up valid CRLs.-explicit_policyβ set policy variablerequire-explicit-policy(RFC 3280).-extended_crlβ enable extended CRL features like indirect CRLs and alternate CRL signing keys.-helpβ print a usage message.-ignore_criticalβ ignore critical extensions instead of rejecting the certificate. π-inhibit_anyβ set policy variableinhibit-any-policy(RFC 3280).-inhibit_mapβ set policy variableinhibit-policy-mapping(RFC 3280).-issuer_checksβ print diagnostics about the search for the issuer certificate of the current certificate, showing why each candidate issuer certificate got rejected. Heads up though: rejection messages showing up does not by itself mean anything's wrong β during a normal verify several rejections can totally happen. π-legacy_verifyβ use the legacy X.509 certificate chain verification code.-policy_checkβ enable certificate policy processing.-purpose purposeβ the intended use for the certificate. Without this option, no chain verification is done at all. Currently accepted uses aresslclient,sslserver,nssslserver,smimesign,smimeencrypt,crlsign,any, andocsphelper.-trusted fileβ a file of trusted certificates. It should contain multiple certificates.-untrusted fileβ a file of untrusted certificates. It should contain multiple certificates.-verboseβ print extra info about the operations being performed.-x509_strictβ disable the workarounds for broken certificates that have to be turned off for strict X.509 compliance.certificatesβ one or more PEM certificates to verify. If you don't include any certificate files, it tries to read a certificate from standard input. And if the first certificate filename begins with a dash, use a lone dash to mark the last option. π«Ά
The verify program uses the same functions as the internal SSL and S/MIME verification β with one crucial difference: wherever possible it tries to keep going after an error, whereas normally the verify operation would bail on the very first error. That's the whole point: it lets you find all the problems with a certificate chain. β¨
The verify operation consists of a number of separate steps. First up, a certificate chain gets built starting from the supplied certificate and ending at the root CA. If the whole chain can't be built up, that's an error. The chain gets built by looking up the issuer's certificate of the current certificate. If a certificate is found which is its own issuer, it's assumed to be the root CA. π
All certificates whose subject name matches the issuer name of the current certificate are subject to further tests. The relevant authority key identifier components of the current certificate (if present) must match the subject key identifier (if present) plus the issuer and serial number of the candidate issuer; and on top of that, the keyUsage extension of the candidate issuer (if present) must permit certificate signing.
The lookup looks in the list of untrusted certificates first, and if nothing matches, the remaining lookups come from the trusted certificates. The root CA is always looked up in the trusted certificate list: if the certificate you're verifying is a root certificate, then an exact match must be found in the trusted list. No cap. π
The second operation is checking every untrusted certificate's extensions for consistency with the supplied purpose. If the -purpose option isn't included, then no checks are done. The supplied or "leaf" certificate must have extensions compatible with the supplied purpose, and every other certificate must also be a valid CA certificate. The precise extensions required are described in more detail in the X509 section below.
The third operation is checking the trust settings on the root CA. The root CA should be trusted for the supplied purpose. A certificate with no trust settings is considered valid for all purposes. π
The final operation is checking the validity of the certificate chain. The validity period is checked against the current system time plus the notBefore and notAfter dates in the certificate. The certificate signatures get checked at this point too. π₯
If all operations complete successfully, the certificate is considered valid. If any operation fails, then the certificate is not valid. And when a verify operation fails, the output messages can be kinda cryptic. The general form of the error message is:
server.pem: /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test CA (1024-bit)
error 24 at 1 depth lookup:invalid CA certificate
The first line has the name of the certificate being verified, followed by the subject name of the certificate. The second line has the error number as defined by the X509_V_ERR_* constants in <openssl/x509_vfy.h>, the associated error message documented in X509_STORE_CTX_get_error(3), and the depth. The depth is the number of the certificate being verified when a problem was detected β starting with zero for the certificate being verified itself, then 1 for the CA that signed the certificate, and so on. π
π VERSION π
openssl version [-abdfpv]
The version command prints out version information about openssl. Short and sweet.
The options are as follows:
-aβ all information: this is the same as setting all the other flags.-bβ the date the current version ofopensslwas built.-dβOPENSSLDIRsetting.-fβ compilation flags.-pβ platform setting.-vβ the currentopensslversion.
πΈ X509 πΈ
openssl x509 [-addreject arg] [-addtrust arg] [-alias] [-CA file]
[-CAcreateserial] [-CAform der | pem] [-CAkey file]
[-CAkeyform der | pem] [-CAserial file] [-certopt option]
[-checkend arg] [-clrext] [-clrreject] [-clrtrust]
[-dates] [-days arg] [-email] [-enddate]
[-extensions section] [-extfile file] [-fingerprint]
[-force_pubkey key] [-hash] [-in file]
[-inform der | net | pem] [-issuer] [-issuer_hash]
[-issuer_hash_old] [-keyform der | pem] [-md5 | -sha1]
[-modulus] [-multivalue-rdn] [-nameopt option] [-new]
[-next_serial] [-noout] [-ocsp_uri] [-ocspid] [-out file]
[-outform der | net | pem] [-passin arg] [-pubkey]
[-purpose] [-req] [-serial] [-set_issuer name]
[-set_serial n] [-set_subject name] [-setalias arg]
[-signkey file] [-sigopt nm:v] [-startdate] [-subject]
[-subject_hash] [-subject_hash_old] [-text] [-trustout]
[-utf8] [-x509toreq]
The x509 command is a multi-purpose certificate utility. Like, it can display certificate information, convert certificates to various forms, sign certificate requests like a "mini CA", or edit certificate trust settings. She does it all, main character energy fr. πβ¨
The following are x509 input, output, and general purpose options:
-in fileβ the input file to read from, or standard input if you don't specify one. This option cannot be used with-new. π«Ά-inform der | net | pemβ the input format. Normally the command expects an X.509 certificate, but this can change if other options like-inor-reqare present.-md5 | -sha1β the digest to use. This affects any signing or display option that uses a message digest, such as the-fingerprint,-signkey, and-CAoptions. If not specified, MD5 is used. SHA1 is always used with DSA keys.-out fileβ the output file to write to, or standard output if none is specified.-outform der | net | pemβ the output format.-passin argβ the key password source.
The following are x509 display options:
-certopt optionβ customise the output format used with-text, either using a list of comma-separated options or by specifying-certoptmultiple times. The default behaviour is to print all fields. The options are as follows:
okay so the -nameopt lore continues, and honestly this next batch is giving "menu of ways to make your DN look cute or completely unhinged" π
ca_defaultβ equivalent tono_issuer,no_pubkey,no_header,no_version,no_sigdump, andno_signame. the "just the hits" preset fr.compatibleβ equivalent to no output options at all. the bare minimum, the vanilla of nameopts.ext_defaultβ print unsupported certificate extensions.ext_dumpβ hex dump unsupported extensions.ext_errorβ print an error message for unsupported certificate extensions.ext_parseβ ASN.1 parse unsupported extensions.no_auxβ do not print certificate trust information.no_extensionsβ do not print X509V3 extensions.no_headerβ do not print header (Certificate and Data) information.no_issuerβ do not print the issuer name.no_pubkeyβ do not print the public key.no_serialβ do not print the serial number.no_sigdumpβ do not give a hexadecimal dump of the certificate signature.no_signameβ do not print the signature algorithm used.no_subjectβ do not print the subject name.no_validityβ do not print thenotBeforeandnotAfter(validity) fields.no_versionβ do not print the version number.
-datesβ print the start and expiry date of a certificate. both. the whole timeline β¨-emailβ output the email addresses, if any.-enddateβ print the expiry date of the certificate; that is, thenotAfterdate. it's giving "when does this expire" energy.-fingerprintβ print the digest of the DER-encoded version of the whole certificate. the full-cert fingerprint, no cuts.-hashβ a synonym for-subject_hash. same thing, shorter name, iconic.-issuerβ print the issuer name.-issuer_hashβ print the hash of the certificate issuer name.-issuer_hash_oldβ print the hash of the certificate issuer name using the older algorithm as used by openssl versions before1.0.0. legacy behaviour, still slaying in its own way π«Ά-modulusβ print the value of the modulus of the public key contained in the certificate.-multivalue-rdnβ this option causes the-subjargument to be interpreted with full support for multivalued RDNs, for example/DC=org/DC=OpenSSL/DC=users/UID=123456+CN=John Doe. If-multivalue-rdnis not used, the UID value is set to123456+CN=John Doe. so without the flag that whole thing gets swallowed into one UID and it's a whole mess π-nameoptoption β customise how the subject or issuer names are displayed, either using a list of comma-separated options or by specifying-nameoptmultiple times. the default behaviour is to use thecompatformat. the options, which can be preceded by a dash to turn them off, are as follows β and yes there are a LOT of them, buckle up bestie:alignβ align field values for a more readable output. only usable withsep_multiline.compatβ use the old format, equivalent to specifying no options at all.dn_revβ reverse the fields of the DN, as required by RFC 2253. as a side effect, this also reverses the order of multiple AVAs.dump_allβ dump all fields. when used withdump_der, it allows the DER encoding of the structure to be unambiguously determined.dump_derβ any fields that need to be hexdumped are dumped using the DER encoding of the field. otherwise just the content octets will be displayed. both options use the RFC 2253#XXXX...format.dump_nostrβ dump non-character string types (for exampleOCTET STRING); usually, non-character string types are displayed as though each content octet represents a single character.dump_unknownβ dump any field whose OID is not recognised by openssl.esc_2253β escape the "special" characters required by RFC 2253 in a field that is" ,+"<>;". additionally,#is escaped at the beginning of a string and a space character at the beginning or end of a string.esc_ctrlβ escape control characters. that is, those with ASCII values less than0x20(space) and the delete (0x7f) character. they are escaped using the RFC 2253\XXnotation (whereXXare two hex digits representing the character value).esc_msbβ escape characters with the MSB set; that is, with ASCII values larger than127. πmultilineβ a multiline format. equivalent toesc_ctrl,esc_msb,sep_multiline,space_eq,lname, andalign. the combo meal.no_typeβ do not attempt to interpret multibyte characters. that is, content octets are merely dumped as though one octet represents each character. this is useful for diagnostic purposes but results in rather odd looking output. it's giving cursed but useful πnofname,sname,lname,oidβ alter how the field name is displayed:nofnamedoes not display the field at all;snameuses the short name form (CNfor commonName, for example);lnameuses the long form.oidrepresents the OID in numerical form and is useful for diagnostic purpose.onelineβ a one line format which is more readable than RFC2253. equivalent toesc_2253,esc_ctrl,esc_msb,utf8,dump_nostr,dump_der,use_quote,sep_comma_plus_space,space_eq, andsname.RFC2253β displays names compatible with RFC 2253. equivalent toesc_2253,esc_ctrl,esc_msb,utf8,dump_nostr,dump_unknown,dump_der,sep_comma_plus,dn_rev, andsname.sep_comma_plus,sep_comma_plus_space,sep_semi_plus_space,sep_multilineβ determine the field separators: the first character is between RDNs and the second between multiple AVAs (multiple AVAs are very rare and their use is discouraged). the options ending in "space" additionally place a space after the separator to make it more readable.sep_multilineuses a linefeed character for the RDN separator and a spaced+for the AVA separator, as well as indenting the fields by four characters. if no field separator is specified thensep_comma_plus_spaceis used by default.show_typeβ show the type of the ASN.1 character string. the type precedes the field contents. for exampleBMPSTRING: Hello World.space_eqβ place spaces round the=character which follows the field name.use_quoteβ escape some characters by surrounding the whole string with"characters. without the option, all escaping is done with the\character.utf8β convert all strings to UTF8 format first, as required by RFC 2253. on a UTF8 compatible terminal, the use of this option (and not settingesc_msb) may result in the correct display of multibyte characters. usually, multibyte characters larger than0xffare represented using the format\UXXXXfor 16 bits and\WXXXXXXXXfor 32 bits, and any UTF8Strings are converted to their character form first. π
-next_serialβ print the next serial number.-nooutβ do not output the encoded version of the request.-ocsp_uriβ print the OCSP responder addresses, if any.-ocspidβ print OCSP hash values for the subject name and public key.-pubkeyβ print the public key.-serialβ print the certificate serial number.-sigoptnm:v β pass options to the signature algorithm during sign or certify operations. the names and values of these options are algorithm-specific.-startdateβ print the start date of the certificate; that is, thenotBeforedate.-subjectβ print the subject name.-subject_hashβ print the hash of the certificate subject name. this is used in openssl to form an index to allow certificates in a directory to be looked up by subject name. it's the filing system bestie π-subject_hash_oldβ print the hash of the certificate subject name using the older algorithm as used by openssl versions before1.0.0.-textβ print the full certificate in text form. the whole thing, the full story, no skips.
π the trust settings part π
a trusted certificate is a certificate which has several additional pieces of information attached to it such as the permitted and prohibited uses of the certificate and an alias. when a certificate is being verified, at least one certificate must be trusted. by default, a trusted certificate must be stored locally and be a root CA. the following are x509 trust settings options β yes this is a whole extra little world:
-addrejectarg β add a prohibited use. accepts the same values as the-addtrustoption.-addtrustarg β add a trusted certificate use. any object name can be used here, but currently onlyclientAuth(SSL client use),serverAuth(SSL server use), andemailProtection(S/MIME email) are used.-aliasβ output the certificate alias.-clrrejectβ clear all the prohibited or rejected uses of the certificate.-clrtrustβ clear all the permitted or trusted uses of the certificate.-purposeβ perform tests on the certificate extensions. the same code is used when verifying untrusted certificates in chains, so this section is useful if a chain is rejected by the verify code. lowkey a whole diagnostic tool hidden in an option π΅οΈ
the basicConstraints extension CA flag is used to determine whether the certificate can be used as a CA. if the CA flag is true, it is a CA; if the CA flag is false, it is not a CA. all CAs should have the CA flag set to true.
if the basicConstraints extension is absent, then the certificate is considered to be a possible CA; other extensions are checked according to the intended use of the certificate. a warning is given in this case because the certificate should really not be regarded as a CA. however it is allowed to be a CA to work around some broken software. π¬
if the certificate is a V1 certificate (and thus has no extensions) and it is self-signed, it is also assumed to be a CA but a warning is again given. this is to work around the problem of Verisign roots which are V1 self-signed certificates.
bestie note: those last two are straight-up workarounds for broken software and old Verisign roots β the tool is being lenient on purpose, and it's telling you so. don't read "no warning" as "all good".
π Purpose tests, continued (the vibe check for each cert type)
Quick recap bestie, because this matters: if the keyUsage extension is present, then extra restraints get put on how the certificate can be used. A CA certificate must have the keyCertSign bit set if the keyUsage extension is present.
The extended key usage extension puts even more restrictions on certificate uses. If this extension is present β whether critical or not β the key can only be used for the purposes specified. Periodt.
A complete description of each test is below, and the comments about basicConstraints and keyUsage and V1 certificates from earlier apply to all CA certificates. π
SSL Client
- The extended key usage extension must be absent, or include the web client authentication OID.
keyUsagemust be absent, or it must have thedigitalSignaturebit set.- The Netscape certificate type must be absent, or it must have the SSL client bit set.
SSL Client CA
- The extended key usage extension must be absent, or include the web client authentication OID.
- The Netscape certificate type must be absent, or it must have the SSL CA bit set β this is used as a workaround if the
basicConstraintsextension is absent.
SSL Server
- The extended key usage extension must be absent, or include the web server authentication and/or one of the SGC OIDs.
keyUsagemust be absent, or it must have thedigitalSignatureset, thekeyEnciphermentset, or both bits set.- The Netscape certificate type must be absent, or have the SSL server bit set.
SSL Server CA
- The extended key usage extension must be absent, or include the web server authentication and/or one of the SGC OIDs.
- The Netscape certificate type must be absent, or the SSL CA bit must be set β this is used as a workaround if the
basicConstraintsextension is absent.
Netscape SSL Server
For Netscape SSL clients to connect to an SSL server: it must have the keyEncipherment bit set if the keyUsage extension is present. This isn't always valid because some cipher suites use the key for digital signing. Otherwise it's the same as a normal SSL server. π€·ββοΈ
Common S/MIME Client Tests
- The extended key usage extension must be absent, or include the email protection OID.
- The Netscape certificate type must be absent, or should have the S/MIME bit set. If the S/MIME bit is not set in Netscape certificate type, then the SSL client bit is tolerated as an alternative β but a warning is shown. Why? Because some Verisign certificates don't set the S/MIME bit. π
S/MIME Signing
In addition to the common S/MIME client tests, the digitalSignature bit must be set if the keyUsage extension is present.
S/MIME Encryption
In addition to the common S/MIME tests, the keyEncipherment bit must be set if the keyUsage extension is present.
S/MIME CA
- The extended key usage extension must be absent, or include the email protection OID.
- The Netscape certificate type must be absent, or must have the S/MIME CA bit set β this is used as a workaround if the
basicConstraintsextension is absent.
CRL Signing
The keyUsage extension must be absent, or it must have the CRL signing bit set.
CRL Signing CA
The normal CA tests apply, except the basicConstraints extension must be present. No workarounds here, bestie. π©
π A couple more certificate-ish options
-setalias argβ sets the alias of the certificate, so you can refer to it with a nickname. Like literally"Steve's Certificate". Cute, right? π«Ά-trustoutβ outputs a trusted certificate (this is the default if any trust settings are modified). You can feed in either an ordinary or a trusted certificate, but by default an ordinary certificate is output and any trust settings get yeeted into the void. ποΈ
β¨ The mini-CA era: x509 signing options
The x509 utility can be used to sign certificates and requests β so it can totally behave like a mini CA. It's giving main character energy, honestly. π
The following are x509 signing options:
-CA fileβ the CA certificate to be used for signing. When this option is present,x509behaves like a mini CA. The input file is signed by the CA using this option; that is, its issuer name is set to the subject name of the CA, and it is digitally signed using the CA's private key.
This option is normally combined with the -req option. Without the -req option, the input is a certificate which must be self-signed.
-CAcreateserialβ create the CA serial number file if it doesn't exist, instead of throwing an error. The file will contain the serial number02, and the certificate being signed will have1as its serial number. Math is mathing π₯-CAform der | pemβ the format of the CA certificate file. The default ispem.-CAkey fileβ set the CA private key to sign a certificate with. Otherwise it's assumed that the CA private key is present in the CA certificate file.-CAkeyform der | pemβ the format of the CA private key. The default ispem.-CAserial fileβ use the serial number in file to sign a certificate. The file should consist of one line containing an even number of hex digits with the serial number to use. After each use the serial number is incremented and written out to the file again. π
The default filename consists of the CA certificate file base name with .srl appended. For example, if the CA certificate file is called mycacert.pem, it expects to find a serial number file called mycacert.srl. iykyk π
-checkend argβ check whether the certificate expires in the next arg seconds. If so, exit with return value1; otherwise exit with return value0. It's a vibe check for expiry dates, honestly. β°-clrextβ delete any extensions from a certificate. This option is used when a certificate is being created from another certificate (for example with the-signkeyor the-CAoptions). Normally, all extensions are retained.-days argβ the number of days to make a certificate valid for. The default is30days. ποΈ-extensions sectionβ the section to add certificate extensions from. If this option is not specified, the extensions should either be contained in the unnamed (default) section, or the default section should contain a variable called"extensions"which contains the section to use.-extfile fileβ file containing certificate extensions to use. If not specified, no extensions are added to the certificate.-force_pubkey keyβ set the public key of the certificate to the public key contained in key.-keyform der | pemβ the format of the key file used in the-force_pubkeyand-signkeyoptions.-newβ generate a new certificate using the subject given by-set_subjectand signed by-signkey. If no public key is provided with-force_pubkey, the resulting certificate is self-signed. This option cannot be used with-inor-req. π ββοΈ-reqβ expect a certificate request on input instead of a certificate. This option cannot be used with-new.-set_issuer nameβ the issuer name to use. name must be formatted as/type0=value0/type1=value1/type2=...; characters may be escaped by\(backslash); no spaces are skipped. No cap, it's that literal. π―-set_serial nβ the serial number to use. This option can be used with either the-signkeyor-CAoptions. If used in conjunction with the-CAoption, the serial number file (as specified by the-CAserialor-CAcreateserialoptions) is not used.
The serial number can be decimal or hex (if preceded by 0x). Negative serial numbers can also be specified, but their use is not recommended. Don't do it bestie, it's giving bad idea energy π¨
-set_subject nameβ the subject name to use. name must be formatted as/type0=value0/type1=value1/type2=...; characters may be escaped by\(backslash); no spaces are skipped.-signkey fileβ self-sign file using the supplied private key.
If the input file is a certificate, it sets the issuer name to the subject name (i.e. makes it self-signed), changes the public key to the supplied value, and changes the start and end dates. The start date is set to the current time and the end date is set to a value determined by the -days option. Any certificate extensions are retained unless the -clrext option is supplied.
If the input is a certificate request, a self-signed certificate is created using the supplied private key using the subject name in the request. πͺ
-utf8β interpret field values read from a terminal or obtained from a configuration file as UTF-8 strings. By default, they are interpreted as ASCII.-x509toreqβ convert a certificate into a certificate request. The-signkeyoption is used to pass the required private key.
β¨ COMMON NOTATION β¨
okay so bestie, a bunch of these commands share the same β¨vibesβ¨ when it comes to syntax, and here's the tea π« β it's all laid out below.
Password arguments, usually dropped in via -passin and -passout for the input password and the output password respectively, let you grab a password from like... wherever. Both of these options take a single argument, described down below π. If you don't give a password argument and a password is needed, then the user gets prompted to type one in: this is normally read from the current terminal with echoing turned off (so nobody sees you typing, very sneaky, love that for you π).
pass:passwordβ the actual password is literallypassword. But uh, since the password is visible to utilities, only use this form when security is not important. it's giving "my password is password123" energy πenv:varβ grab the password from the environment variablevar. Since the environment of other processes is visible, use this one with caution, ngl.file:pathβ the first line ofpathis the password. Here's the cute part: if the samepathargument is given to both-passinand-passout, then the first line gets used for the input password and the next line gets used for the output password π. Andpathdoesn't even have to refer to a regular file β it could, for example, refer to a device or a named pipe. versatile icon β¨fd:numberβ read the password from the file descriptornumber. This can be used to send the data via a pipe, for example. main character file descriptor behavior πstdinβ read the password from standard input. simple, iconic, no notes.
Input/output formats, typically specified using -inform and -outform, tell you what format is being read from or written to. The argument is case insensitive (so go ahead and shout it, she doesn't mind π₯).
derβ Distinguished Encoding Rules (DER) is a binary format.netβ insecure legacy format. yes bestie, insecure. we said what we said πpemβ Privacy Enhanced Mail (PEM) is base64-encoded.pvkβ Private Key format.smimeβ an SMIME format message.txtβ plain ASCII text.
πΈ ENVIRONMENT πΈ
These environment variables affect how openssl runs, so like... keep them in mind, iykyk:
OPENSSL_CONFβ the location of the master configuration file. literally the blueprint of the whole operation π
π FILES π
the paths, the vibes, the lore:
/etc/ssl/β default config directory foropenssl./etc/ssl/lib/β unused. she's just there. sitting pretty. no purpose. mood honestly π/etc/ssl/private/β default private key directory./etc/ssl/openssl.cnfβ default configuration file foropenssl./etc/ssl/x509v3.cnfβ default configuration file forx509certificates.
π¦ SEE ALSO π¦
go read these next, bestie, they're all part of the extended universe:
acme-client(1), nc(1), openssl.cnf(5), x509v3.cnf(5), ssl(8), starttls(8)
π STANDARDS π
the receipts, the citations, the "we didn't make this up" section πβ¨:
- T. Dierks and C. Allen, The TLS Protocol Version 1.0, RFC 2246, January 1999.
- M. Wahl, S. Killie, and T. Howes, Lightweight Directory Access Protocol (v3): UTF-8 String Representation of Distinguished Names, RFC 2253, December 1997.
- B. Kaliski, PKCS #7: Cryptographic Message Syntax Version 1.5, RFC 2315, March 1998.
- R. Housley, W. Ford, W. Polk, and D. Solo, Internet X.509 Public Key Infrastructure Certificate and CRL Profile, RFC 2459, January 1999.
- M. Myers, R. Ankney, A. Malpani, S. Galperin, and C. Adams, X.509 Internet Public Key Infrastructure Online Certificate Status Protocol β OCSP, RFC 2560, June 1999.
- R. Housley, Cryptographic Message Syntax, RFC 2630, June 1999.
- P. Chown, Advanced Encryption Standard (AES) Ciphersuites for Transport Layer Security (TLS), RFC 3268, June 2002.
and that's a wrap on the whole OPENSSL(1) saga, bestie π«Άπ you made it to the end, I'm so proud of you. this page is from Debian, dated August 25, 2026, and it lives under the name OPENSSL(1) β go forth and encrypt things responsibly, mwah π
β¨π
π¦ where this page comes from
- arch rolling: libressl 4.4.0-1 Β· ISC AND custom:OpenSSL
- Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved
- Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms