(PHP 5 >= 5.6.0, PHP 7, PHP 8)
openssl_x509_fingerprint — 計算一個(gè)給定的x.509證書(shū)的指紋或摘要
$x509
, string $hash_algorithm
= "sha1", bool $raw_output
= false
): string
openssl_x509_fingerprint() 返回x509
的字符串類(lèi)型的摘要。
x509
參見(jiàn)密鑰/證書(shū)參數以獲取有效值列表。
hash_algorithm
使用的摘要方法或散列算法,比如, "sha256", openssl_get_md_methods()摘要算法之一。
raw_output
設置為 true
時(shí),輸出原始二進(jìn)制數據。設置為 false
時(shí),輸出小寫(xiě)的16進(jìn)制字符串。
將包含計算的證書(shū)指紋的字符串返回為小寫(xiě)16進(jìn)制格式,除非將raw_output
設置為T(mén)RUE,在這種情況下會(huì )返回消息摘要的原始二進(jìn)制表示形式。
失敗則返回 false
.