• 首页
  • vue
  • TypeScript
  • JavaScript
  • scss
  • css3
  • html5
  • php
  • MySQL
  • redis
  • jQuery
  • openssl_x509_fingerprint()

    (PHP 5 >= 5.6.0, PHP 7)

    计算一个给定的x.509证书的指纹或摘要

    说明

    openssl_x509_fingerprint(mixed $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时,输出小写的16进制字符串。

    返回值

    将包含计算的证书指纹的字符串返回为小写16进制格式,除非将$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).