diff --git a/reference/openssl/functions/openssl-x509-parse.xml b/reference/openssl/functions/openssl-x509-parse.xml index 1b303ccdfb72..f31081c798ab 100644 --- a/reference/openssl/functions/openssl-x509-parse.xml +++ b/reference/openssl/functions/openssl-x509-parse.xml @@ -49,9 +49,226 @@ &reftitle.returnvalues; + + Returns an &array; of certificate fields on success, or &false; on failure. + + + alias is present only when the certificate has an alias. + criticalExtensions is present only when the certificate + has at least one critical extension. Every other key listed below is always + present. + - The structure of the returned data is (deliberately) not - yet documented, as it is still subject to change. + + Array returned by <function>openssl_x509_parse</function> + + + + Key + Type + &Description; + + + + + name + string + + Subject distinguished name as a single string, with components separated by slashes. + For example, /C=US/O=Example/CN=example.com. + + + + subject + array + + Subject distinguished name. Keys are short names such as + CN when short_names is + &true;, and long names such as commonName + otherwise. Each value is a UTF-8 &string;, or an &array; of UTF-8 + &string;s when that component occurs more than once. + + + + hash + string + + Lowercase hexadecimal hash of the subject name, as used to look up + a certificate in an OpenSSL CA directory. This is an 8-digit value. + It is not the certificate fingerprint; see + openssl_x509_fingerprint. + + + + issuer + array + + Issuer distinguished name, in the same form as + subject. + + + + version + int + + Raw version field stored in the certificate. This value is one less + than the certificate version usually displayed: a version 1 + certificate is 0, a version 2 certificate is + 1, and a version 3 certificate is + 2. + + + + serialNumber + string + + Decimal representation of the serial number. + + + + serialNumberHex + string + + Uppercase hexadecimal representation of the serial number. + + + + validFrom + string + + Not-before time in ASN.1 form, either UTCTime + (YYMMDDHHMMSSZ) or GeneralizedTime + (YYYYMMDDHHMMSSZ). + + + + validTo + string + + Not-after time, in the same form as validFrom. + + + + validFrom_time_t + int + + Not-before time as a Unix timestamp, or -1 if the + time could not be parsed. + + + + validTo_time_t + int + + Not-after time as a Unix timestamp, or -1 if the + time could not be parsed. + + + + alias + string + + Certificate alias (friendly name). Only present when one is set. + + + + signatureTypeSN + string + + Short name of the signature algorithm. + + + + signatureTypeLN + string + + Long name of the signature algorithm. + + + + signatureTypeNID + int + + Numeric signature-algorithm identifier (OpenSSL NID). + + + + purposes + array + + Purpose checks, indexed by purpose id. The ids are the + X509_PURPOSE_* + constants. Each value is an &array; described below. + + + + extensions + array + + Certificate extensions, indexed by short name (for example + subjectAltName) or by OID when the extension has + no short name. Each value is printable text describing that + extension. Which keys are present depends on the certificate. + This array does not follow short_names. + + + + criticalExtensions + array + + Numerically indexed list of extension names that are marked + critical, using the same names as the keys of + extensions. Only present when the certificate + has at least one critical extension. + + + + +
+
+ + Each element of purposes has the following keys: + + + + Purpose entry + + + + Key + Type + &Description; + + + + + 0 + bool + + &true; if the certificate can be used for this purpose as an + end-entity certificate. + + + + 1 + bool + + &true; if the certificate can be used for this purpose as a CA + certificate. + + + + 2 + string + + Purpose name. A short name such as sslclient + when short_names is &true;, and a long name + such as SSL client otherwise. + + + + +