= 5.6.0, PHP 7, PHP 8)openssl_x509_fingerprint — 計(jì)算一個(gè)給定的x.509證書的指紋或摘要說明openssl_x509_fingerprint(mixed $x509, string $h">

openssl_x509_fingerprint

(PHP 5 >= 5.6.0, PHP 7, PHP 8)

openssl_x509_fingerprint計(jì)算一個(gè)給定的x.509證書的指紋或摘要

說明

openssl_x509_fingerprint(mixed $x509, string $hash_algorithm = "sha1", bool $raw_output = false): string

openssl_x509_fingerprint() 返回x509的字符串類型的摘要。

參數(shù)

x509

參見密鑰/證書參數(shù)以獲取有效值列表。

hash_algorithm

使用的摘要方法或散列算法,比如, "sha256", openssl_get_md_methods()摘要算法之一。

raw_output

設(shè)置為 true時(shí),輸出原始二進(jìn)制數(shù)據(jù)。設(shè)置為 false時(shí),輸出小寫的16進(jìn)制字符串。

返回值

將包含計(jì)算的證書指紋的字符串返回為小寫16進(jìn)制格式,除非將raw_output設(shè)置為TRUE,在這種情況下會(huì)返回消息摘要的原始二進(jìn)制表示形式。

失敗則返回 false .