PHP Класс SAML2\Message

Implements what is common between the samlp:RequestAbstractType and samlp:StatusResponseType element types.
Наследование: implements saml2\SignedElement
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$document DOMDocument This variable is used while generating XML from this message. It holds the \DOMDocument of the XML we are generating.
$extensions array Request extensions.
$messageContainedSignatureUponConstruction boolean

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

Метод Описание
addValidator ( callback $function, mixed $data ) Add a method for validating this message.
fromXML ( DOMElement $xml ) : Message Convert an XML element into a message.
getCertificates ( ) : array Retrieve the certificates that are included in the message.
getConsent ( ) : string Set the given consent for this message.
getDestination ( ) : string | null Retrieve the destination of this message.
getExtensions ( ) : SAML2\XML\samlp\Extensions Retrieve the Extensions.
getId ( ) : string Retrieve the identifier of this message.
getIssueInstant ( ) : integer Retrieve the issue timestamp of this message.
getIssuer ( ) : string | Issuer | null Retrieve the issuer if this message.
getRelayState ( ) : string | null Retrieve the RelayState associated with this message.
getSignatureKey ( ) : XMLSecurityKey | null Retrieve the private key we should use to sign the message.
getSignatureMethod ( ) : null | string
isMessageConstructedWithSignature ( ) : boolean Query whether or not the message contained a signature at the root level when the object was constructed.
setCertificates ( array $certificates ) Set the certificates that should be included in the message.
setConsent ( string $consent ) Set the given consent for this message.
setDestination ( string | null $destination ) Set the destination of this message.
setExtensions ( array | null $extensions ) Set the Extensions.
setId ( string $id ) Set the identifier of this message.
setIssueInstant ( integer $issueInstant ) Set the issue timestamp of this message.
setIssuer ( string | Issuer | null $issuer ) Set the issuer of this message.
setRelayState ( string | null $relayState ) Set the RelayState associated with this message.
setSignatureKey ( XMLsecurityKey $signatureKey = null ) Set the private key we should use to sign the message.
toSignedXML ( ) : DOMElement Convert this message to a signed XML document.
toUnsignedXML ( ) : DOMElement Convert this message to an unsigned XML document.
validate ( XMLSecurityKey $key ) : boolean Validate this message against a public key.

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

Метод Описание
__construct ( string $tagName, DOMElement $xml = null ) Initialize a message.

Приватные методы

Метод Описание
validateSignature ( DOMElement $xml ) Validate the signature element of a SAML message, and configure this object appropriately to perform the signature verification afterwards.

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

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

This constructor takes an optional parameter with a \DOMElement. If this parameter is given, the message will be initialized with data from that XML element. If no XML element is given, the message is initialized with suitable default values.
protected __construct ( string $tagName, DOMElement $xml = null )
$tagName string The tag name of the root element
$xml DOMElement The input message

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

This function is used by the HTTP-Redirect binding, to make it possible to check the signature against the one included in the query string.
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

fromXML() публичный статический метод

Convert an XML element into a message.
public static fromXML ( DOMElement $xml ) : Message
$xml DOMElement The root XML element
Результат Message The message

getCertificates() публичный метод

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

getConsent() публичный метод

Most likely (though not required) a value of rn:oasis:names:tc:SAML:2.0:consent.
См. также: SAML2\Constants
public getConsent ( ) : string
Результат string Consent

getDestination() публичный метод

Retrieve the destination of this message.
public getDestination ( ) : string | null
Результат string | null The destination of this message, or NULL if no destination is given

getExtensions() публичный метод

Retrieve the Extensions.
public getExtensions ( ) : SAML2\XML\samlp\Extensions
Результат SAML2\XML\samlp\Extensions

getId() публичный метод

Retrieve the identifier of this message.
public getId ( ) : string
Результат string The identifier of this message

getIssueInstant() публичный метод

Retrieve the issue timestamp of this message.
public getIssueInstant ( ) : integer
Результат integer The issue timestamp of this message, as an UNIX timestamp

getIssuer() публичный метод

Retrieve the issuer if this message.
public getIssuer ( ) : string | Issuer | null
Результат string | SAML2\XML\saml\Issuer | null The issuer of this message, or NULL if no issuer is given

getRelayState() публичный метод

Retrieve the RelayState associated with this message.
public getRelayState ( ) : string | null
Результат string | null The RelayState, or NULL if no RelayState is given

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

getSignatureMethod() публичный метод

public getSignatureMethod ( ) : null | string
Результат null | string

isMessageConstructedWithSignature() публичный метод

Query whether or not the message contained a signature at the root level when the object was constructed.
public isMessageConstructedWithSignature ( ) : boolean
Результат boolean

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

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

setConsent() публичный метод

Most likely (though not required) a value of rn:oasis:names:tc:SAML:2.0:consent.
См. также: SAML2\Constants
public setConsent ( string $consent )
$consent string

setDestination() публичный метод

Set the destination of this message.
public setDestination ( string | null $destination )
$destination string | null The new destination of this message

setExtensions() публичный метод

Set the Extensions.
public setExtensions ( array | null $extensions )
$extensions array | null The Extensions

setId() публичный метод

Set the identifier of this message.
public setId ( string $id )
$id string The new identifier of this message

setIssueInstant() публичный метод

Set the issue timestamp of this message.
public setIssueInstant ( integer $issueInstant )
$issueInstant integer The new issue timestamp of this message, as an UNIX timestamp

setIssuer() публичный метод

Set the issuer of this message.
public setIssuer ( string | Issuer | null $issuer )
$issuer string | SAML2\XML\saml\Issuer | null The new issuer of this message

setRelayState() публичный метод

Set the RelayState associated with this message.
public setRelayState ( string | null $relayState )
$relayState string | null The new RelayState

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

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

toSignedXML() публичный метод

This method sign the resulting XML document if the private key for the signature is set.
public toSignedXML ( ) : DOMElement
Результат DOMElement The root element of the DOM tree

toUnsignedXML() публичный метод

This method does not sign the resulting XML document.
public toUnsignedXML ( ) : DOMElement
Результат DOMElement The root element of the DOM tree

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

Описание свойств

$document защищенное свойство

This variable is used while generating XML from this message. It holds the \DOMDocument of the XML we are generating.
protected DOMDocument $document
Результат DOMDocument

$extensions защищенное свойство

Request extensions.
protected array $extensions
Результат array

$messageContainedSignatureUponConstruction защищенное свойство

protected bool $messageContainedSignatureUponConstruction
Результат boolean