/**
* 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];
}