getCertificateFingerprints() 공개 메소드

Returns an array or \Traversable where each element represents a certificate fingerprint. A certificate fingerprint is a string containing the certificate fingerprint.
사용 중단: Please use getCertifiateFile() or getCertificateData()
예제 #1
0
 public function canValidate(SignedElement $signedElement, CertificateProvider $configuration)
 {
     if ($configuration->getCertificateFingerprints() === null) {
         $this->logger->debug('Configuration does not have "certFingerprint" value, cannot validate signature with fingerprint');
         return false;
     }
     // use internal cache to prevent doing certificate extraction twice.
     $this->certificates = $signedElement->getCertificates();
     if (empty($this->certificates)) {
         $this->logger->debug('Signed element does not have certificates, cannot validate signature with fingerprint');
         return false;
     }
     return true;
 }
예제 #2
0
 /**
  * Loads the fingerprints from a configurationValue
  *
  * @param \SAML2\Configuration\CertificateProvider $configuration
  *
  * @return \SAML2\Certificate\FingerprintCollection
  *
  * @deprecated
  */
 public function loadFingerprints(CertificateProvider $configuration)
 {
     $fingerprints = $configuration->getCertificateFingerprints();
     if (!is_array($fingerprints) && !$fingerprints instanceof \Traversable) {
         throw InvalidArgumentException::invalidType('array or instanceof \\Traversable', $fingerprints);
     }
     $collection = new FingerprintCollection();
     foreach ($fingerprints as $fingerprint) {
         if (!is_string($fingerprint) && !(is_object($fingerprint) && method_exists($fingerprint, '__toString'))) {
             throw InvalidArgumentException::invalidType('fingerprint as string or object that can be casted to string', $fingerprint);
         }
         $collection->add(new Fingerprint((string) $fingerprint));
     }
     return $collection;
 }