42 $keyLoader =
new self();
44 return $keyLoader->loadKeysFromConfiguration(
$config, $usage, $required);
60 $certificateData =
$config->getCertificateData();
61 $certificateFile =
$config->getCertificateFile();
65 } elseif ($certificateData !==
null) {
67 } elseif ($certificateFile !==
null) {
71 if ($required && !$this->
hasKeys()) {
73 'No keys found in configured metadata, please ensure that either the "keys", "certData" or '
74 .
'"certificate" entries is available.'
88 public function loadKeys(array $configuredKeys, $usage)
90 foreach ($configuredKeys as $keyData) {
91 if (isset($keyData[
'X509Certificate'])) {
97 if ($usage && !
$key->canBeUsedFor($usage)) {
101 $this->loadedKeys->add(
$key);
112 if (!is_string($certificateData)) {
130 'Could not find PEM encoded certificate in "%s"',
153 return !!count($this->loadedKeys);
sprintf('%.4f', $callTime)
An exception for terminatinating execution or to throw for unit testing.
Named Exception for what the name describes.
Simple collection object for transporting keys.
loadCertificateFile($certificateFile)
Loads the certificate in the file given.
loadKeys(array $configuredKeys, $usage)
Loads the keys given, optionally excluding keys when a usage is given and they are not configured to ...
loadCertificateData($certificateData)
Attempts to load a key based on the given certificateData.
static extractPublicKeys(CertificateProvider $config, $usage=null, $required=false)
Extracts the public keys given by the configuration.
loadKeysFromConfiguration(CertificateProvider $config, $usage=null, $required=false)
Simple DTO wrapper for (X509) keys.
Specific Certificate Key.
static createFromCertificateData($certificateContents)
static invalidType($expected, $parameter)
Collection of Utility functions specifically for certificates.
static hasValidStructure($certificate)
const CERTIFICATE_PATTERN
The pattern that the contents of a certificate should adhere to.
static getFileContents($file)
if(@file_exists(dirname(__FILE__).'/lang/eng.php')) $certificate
CertificateProvider interface.