/** * 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]; }
/** * @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.'); }