46 $this->certificates =
array();
47 $this->validators =
array();
55 $sig = Utils::validateElement(
$xml);
58 $this->certificates = $sig[
'Certificates'];
59 $this->validators[] =
array(
60 'Function' =>
array(
'\SAML2\Utils',
'validateSignature'),
81 $this->validators[] =
array(
100 if (count($this->validators) === 0) {
106 foreach ($this->validators as $validator) {
108 $data = $validator[
'Data'];
131 return $this->signatureKey;
143 $this->signatureKey = $signatureKey;
176 foreach ($this->certificates as $cert) {
179 $pemCert =
"-----BEGIN CERTIFICATE-----\n" .
180 chunk_split($cert, 64) .
181 "-----END CERTIFICATE-----\n";
185 $key->loadKey($pemCert);
189 if ($this->validate(
$key)) {
209 if ($this->signatureKey === null) {
215 Utils::insertSignature($this->signatureKey, $this->certificates, $root, $insertBefore);
addValidator($function, $data)
Add a method for validating this element.
getSignatureKey()
Retrieve the private key we should use to sign the message.
setCertificates(array $certificates)
Set the certificates that should be included in the message.
getValidatingCertificates()
Retrieve certificates that sign this element.
setSignatureKey(XMLSecurityKey $signatureKey=null)
Set the private key we should use to sign the message.
validate(XMLSecurityKey $key)
Validate this element against a public key.
getCertificates()
Retrieve the certificates that are included in the message.
Create styles array
The data for the language used.
signElement(\DOMElement $root, \DOMElement $insertBefore=null)
Sign the given XML element.
__construct(\DOMElement $xml=null)
Initialize the helper class.