SimpleSAML_Metadata_SAMLParser::validateFingerprint PHP 메소드

validateFingerprint() 공개 메소드

This function checks if this EntityDescriptor was signed with a certificate with the given fingerprint.
public validateFingerprint ( string $fingerprint ) : boolean
$fingerprint string Fingerprint of the certificate which should have been used to sign this EntityDescriptor.
리턴 boolean True if it was signed with the certificate with the given fingerprint, false otherwise.
    public function validateFingerprint($fingerprint)
    {
        assert('is_string($fingerprint)');
        $fingerprint = strtolower(str_replace(":", "", $fingerprint));
        $candidates = array();
        foreach ($this->validators as $validator) {
            foreach ($validator->getValidatingCertificates() as $cert) {
                $fp = strtolower(sha1(base64_decode($cert)));
                $candidates[] = $fp;
                if ($fp === $fingerprint) {
                    return true;
                }
            }
        }
        SimpleSAML\Logger::debug('Fingerprint was [' . $fingerprint . '] not one of [' . join(', ', $candidates) . ']');
        return false;
    }