The manual is not constistent at this point. On one hand, it describes the return as digest/fingerprint of a cert, on the other hand it says:
bool openssl_x509_fingerprint( … )
On PHP 5.6.5, I only get the bool return (1 or 0).
(PHP 5 >= 5.6.0, PHP 7, PHP 8)
openssl_x509_fingerprint — 与えられた X.509 証明書のフィンガープリントあるいはダイジェストを計算する
$x509
, string $hash_algorithm
= "sha1"
, bool $raw_output
= false
) : string
openssl_x509_fingerprint() は
x509
のダイジェストを文字列で返します。
x509
使用できる値の一覧は キー/証明書パラメータ を参照ください。
hash_algorithm
"sha256" といったダイジェストメソッド、またはハッシュアルゴリズム。 有効な値の一覧は、openssl_get_md_methods() で得られます。
raw_output
true
が設定された場合、生のバイナリデータを出力します。false
では小文字の8進数を出力します。
raw_output
が true
に設定されていない場合、小文字の8進数として計算された証明書のフィンガープリントを含む文字列を返します。
raw_output
が true
に設定されている場合、メッセージダイジェストの生のバイナリ表現が返されます。
失敗したときは false
を返します。
The manual is not constistent at this point. On one hand, it describes the return as digest/fingerprint of a cert, on the other hand it says:
bool openssl_x509_fingerprint( … )
On PHP 5.6.5, I only get the bool return (1 or 0).