42 $keyLoader =
new self();
44 return $keyLoader->loadKeysFromConfiguration($config, $usage, $required);
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);
static invalidType($expected, $parameter)
getKeys()
Returns an array or of keys, where each element represents a configured key.
static getFileContents($file)
CertificateProvider interface.
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 ...
static extractPublicKeys(CertificateProvider $config, $usage=null, $required=false)
Extracts the public keys given by the configuration.
if(@file_exists(dirname(__FILE__).'/lang/eng.php')) $certificate
Simple DTO wrapper for (X509) keys.
static hasValidStructure($certificate)
static createFromCertificateData($certificateContents)
getCertificateData()
Returns the contents of an X509 pem certificate, without the '--—BEGIN CERTIFICATE--—' and '--—END...
loadKeysFromConfiguration(CertificateProvider $config, $usage=null, $required=false)
Simple collection object for transporting keys.
Named Exception for what the name describes.
const CERTIFICATE_PATTERN
The pattern that the contents of a certificate should adhere to.
getCertificateFile()
Returns the full path to the (local) file that contains the X509 pem certificate. ...
loadCertificateData($certificateData)
Attempts to load a key based on the given certificateData.