getFingerprint() 공개 메소드

Get a unique hash of the certificate this can be used to check if two Apns\Certificate objects are the same
public getFingerprint ( ) : string
리턴 string
예제 #1
0
 /**
  * Get/create the gateway associated with the given certificate
  *
  * @param Certificate The certificate to get the gateway conenction for
  * @return Gateway
  */
 private function getGatewayForCertificate(Certificate $certificate)
 {
     // Get the fingerprint of the certificate
     $fingerprint = $certificate->getFingerprint();
     // If no gateway is available for this certificate create one
     if (!isset($this->gatewayPool[$fingerprint])) {
         $this->gatewayPool[$fingerprint] = $this->getGatewayFactory()->createGateway($certificate);
         $this->gatewayPool[$fingerprint]->setLogger($this->logger);
     }
     // Return the gateway connection for this certificate
     return $this->gatewayPool[$fingerprint];
 }
예제 #2
0
 /**
  * @dataProvider correctConstructorArguments
  */
 public function testGetFingerprint($pemFile, $passphrase, $validate, $endpoint, $hasPassphrase, $fingerprint)
 {
     $certificate = new Certificate($pemFile, $passphrase, $validate, $endpoint);
     $this->assertEquals($fingerprint, $certificate->getFingerprint(), 'Got incorrect fingerprint of PEM file.');
 }