PHP Класс SAML2\SignedElementHelper

Can either be inherited from, or can be used by proxy.
Наследование: implements saml2\SignedElement
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
__construct ( DOMElement $xml = null ) Initialize the helper class.
signElement ( DOMElement $root, DOMElement $insertBefore = null ) : DOMElement | null Sign the given XML element.

Описание методов

__construct() защищенный Метод

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

addValidator() публичный Метод

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() публичный Метод

Retrieve the certificates that are included in the message.
public getCertificates ( ) : array
Результат array An array of certificates.

getSignatureKey() публичный Метод

Retrieve the private key we should use to sign the message.
public getSignatureKey ( ) : XMLSecurityKey | null
Результат RobRichards\XMLSecLibs\XMLSecurityKey | null The key, or NULL if no key is specified.

getValidatingCertificates() публичный Метод

Retrieve certificates that sign this element.
public getValidatingCertificates ( ) : array
Результат array Array with certificates.

setCertificates() публичный Метод

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

setSignatureKey() публичный Метод

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

signElement() защищенный Метод

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.
Результат DOMElement | null

validate() публичный Метод

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.
Результат boolean true on success, false when we don't have a signature.