PHP Class SAML2\SignedElementHelper

Can either be inherited from, or can be used by proxy.
Inheritance: implements saml2\SignedElement
Afficher le fichier Open project: simplesamlphp/saml2 Class Usage Examples

Méthodes publiques

Méthode Description
addValidator ( callback $function, mixed $data ) Add a method for validating this element.
getCertificates ( ) : array Retrieve the certificates that are included in the message.
getSignatureKey ( ) : XMLSecurityKey | null Retrieve the private key we should use to sign the message.
getValidatingCertificates ( ) : array Retrieve certificates that sign this element.
setCertificates ( array $certificates ) Set the certificates that should be included in the message.
setSignatureKey ( XMLsecurityKey $signatureKey = null ) Set the private key we should use to sign the message.
validate ( XMLSecurityKey $key ) : boolean Validate this element against a public key.

Méthodes protégées

Méthode Description
__construct ( DOMElement $xml = null ) Initialize the helper class.
signElement ( DOMElement $root, DOMElement $insertBefore = null ) : DOMElement | null Sign the given XML element.

Method Details

__construct() protected méthode

Initialize the helper class.
protected __construct ( DOMElement $xml = null )
$xml DOMElement The XML element which may be signed.

addValidator() public méthode

This function is used for custom validation extensions
public addValidator ( callback $function, mixed $data )
$function callback The function which should be called.
$data mixed The data that should be included as the first parameter to the function.

getCertificates() public méthode

Retrieve the certificates that are included in the message.
public getCertificates ( ) : array
Résultat array An array of certificates.

getSignatureKey() public méthode

Retrieve the private key we should use to sign the message.
public getSignatureKey ( ) : XMLSecurityKey | null
Résultat RobRichards\XMLSecLibs\XMLSecurityKey | null The key, or NULL if no key is specified.

getValidatingCertificates() public méthode

Retrieve certificates that sign this element.
public getValidatingCertificates ( ) : array
Résultat array Array with certificates.

setCertificates() public méthode

The certificates should be strings with the PEM encoded data.
public setCertificates ( array $certificates )
$certificates array An array of certificates.

setSignatureKey() public méthode

If the key is null, the message will be sent unsigned.
public setSignatureKey ( XMLsecurityKey $signatureKey = null )
$signatureKey XMLsecurityKey

signElement() protected méthode

Sign the given XML element.
protected signElement ( DOMElement $root, DOMElement $insertBefore = null ) : DOMElement | null
$root DOMElement The element we should sign.
$insertBefore DOMElement The element we should insert the signature node before.
Résultat DOMElement | null

validate() public méthode

true is returned on success, false is returned if we don't have any signature we can validate. An exception is thrown if the signature validation fails.
public validate ( XMLSecurityKey $key ) : boolean
$key RobRichards\XMLSecLibs\XMLSecurityKey The key we should check against.
Résultat boolean true on success, false when we don't have a signature.