Wrep\Notificato\Apns\Certificate::getFingerprint PHP Method

getFingerprint() public method

Get a unique hash of the certificate this can be used to check if two Apns\Certificate objects are the same
public getFingerprint ( ) : string
return string
    public function getFingerprint()
    {
        // Calculate fingerprint if unknown
        if (null == $this->fingerprint) {
            $this->fingerprint = sha1($this->endpointEnv . sha1_file($this->getPemFile()));
        }
        return $this->fingerprint;
    }

Usage Example

Example #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];
 }
All Usage Examples Of Wrep\Notificato\Apns\Certificate::getFingerprint