= 4.0.6, PHP 5, PHP 7, PHP 8)openssl_x509_parse — 解析一個(gè)X509證書(shū)并作為一個(gè)數(shù)組返回信息說(shuō)明openssl_x509_parse(mixed $x509cert, bool $shortname">

openssl_x509_parse

(PHP 4 >= 4.0.6, PHP 5, PHP 7, PHP 8)

openssl_x509_parse解析一個(gè)X509證書(shū)并作為一個(gè)數(shù)組返回信息

說(shuō)明

openssl_x509_parse(mixed $x509cert, bool $shortnames = true): array

openssl_x509_parse() 返回提供的 x509cert 證書(shū)的信息, 包括主題名稱(chēng)、發(fā)行方名稱(chēng)、目的、有效日期等字段。

參數(shù)

x509cert

shortnames

shortnames 控制數(shù)據(jù)在數(shù)組中的索引 - 如果 shortnamestrue (默認(rèn)) 字段將以短名稱(chēng)的形式被索引, 否則將會(huì)使用長(zhǎng)名稱(chēng)的形式 - 比如: CN 就是commonName的短名稱(chēng)格式。

返回值

返回的數(shù)據(jù)的結(jié)構(gòu)是(故意的)還沒(méi)有文檔化,因?yàn)樗匀粫?huì)發(fā)生變化。