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'),
 
   64        } 
catch (\Exception $e) {
 
   81        $this->validators[] = array(
 
  100        if (count($this->validators) === 0) {
 
  106        foreach ($this->validators as $validator) {
 
  108            $data = $validator[
'Data'];
 
  115            } 
catch (\Exception $e) {
 
  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)) {
 
  192            } 
catch (\Exception $e) {
 
  207    protected function signElement(\DOMElement $root, \DOMElement $insertBefore = 
null)
 
  209        if ($this->signatureKey === 
null) {
 
  215        Utils::insertSignature($this->signatureKey, $this->certificates, $root, $insertBefore);
 
An exception for terminatinating execution or to throw for unit testing.
signElement(\DOMElement $root, \DOMElement $insertBefore=null)
Sign the given XML element.
setSignatureKey(XMLSecurityKey $signatureKey=null)
Set the private key we should use to sign the message.
addValidator($function, $data)
Add a method for validating this element.
setCertificates(array $certificates)
Set the certificates that should be included in the message.
getSignatureKey()
Retrieve the private key we should use to sign the message.
__construct(\DOMElement $xml=null)
Initialize the helper class.
validate(XMLSecurityKey $key)
Validate this element against a public key.
getCertificates()
Retrieve the certificates that are included in the message.
getValidatingCertificates()
Retrieve certificates that sign this element.