samlutilities
in package
Tags
Table of Contents
- castKey() : XMLSecurityKey
- checkSign() : bool
- decryptElement() : DOMElement
- desanitize_certificate() : mixed
- extractStrings() : mixed
- generateID() : mixed
- generateRandomAlphanumericValue() : mixed
- generateRandomBytes() : mixed
- generateTimestamp() : mixed
- getEncryptionAlgorithm() : mixed
- insertSignature() : mixed
- Insert a Signature-node.
- parseBoolean() : bool|mixed
- Parse a boolean attribute.
- parseNameId() : mixed
- processResponse() : bool
- sanitize_certificate() : mixed
- signXML() : mixed
- stringToHex() : mixed
- validateElement() : array<string|int, mixed>|bool
- validateSignature() : mixed
- xpQuery() : mixed
- xsDateTimeToTimestamp() : mixed
- doDecryptElement() : DOMElement
- Decrypt an encrypted element.
- findCertificate() : mixed
Methods
castKey()
public
static castKey(XMLSecurityKey $key, $algorithm[, string $type = 'public' ]) : XMLSecurityKey
Parameters
- $key : XMLSecurityKey
- $algorithm :
- $type : string = 'public'
Tags
Return values
XMLSecurityKey —checkSign()
public
static checkSign( $certFingerprint, $signatureData) : bool
Parameters
Tags
Return values
bool —decryptElement()
public
static decryptElement(DOMElement $encryptedData, XMLSecurityKey $inputKey[, array<string|int, mixed> $blacklist = array() ][, XMLSecurityKey|null $alternateKey = NULL ]) : DOMElement
Parameters
- $encryptedData : DOMElement
- $inputKey : XMLSecurityKey
- $blacklist : array<string|int, mixed> = array()
- $alternateKey : XMLSecurityKey|null = NULL
Tags
Return values
DOMElement —desanitize_certificate()
public
static desanitize_certificate(mixed $certificate) : mixed
Parameters
- $certificate : mixed
Return values
mixed —extractStrings()
public
static extractStrings(DOMElement $parent, mixed $namespaceURI, mixed $localName) : mixed
Parameters
- $parent : DOMElement
- $namespaceURI : mixed
- $localName : mixed
Return values
mixed —generateID()
public
static generateID() : mixed
Return values
mixed —generateRandomAlphanumericValue()
public
static generateRandomAlphanumericValue(mixed $length) : mixed
Parameters
- $length : mixed
Return values
mixed —generateRandomBytes()
public
static generateRandomBytes(mixed $length) : mixed
Parameters
- $length : mixed
Return values
mixed —generateTimestamp()
public
static generateTimestamp([mixed $instant = NULL ]) : mixed
Parameters
- $instant : mixed = NULL
Return values
mixed —getEncryptionAlgorithm()
public
static getEncryptionAlgorithm(mixed $method) : mixed
Parameters
- $method : mixed
Return values
mixed —insertSignature()
Insert a Signature-node.
public
static insertSignature(XMLSecurityKey $key, array<string|int, mixed> $certificates, DOMElement $root[, DomNode $insertBefore = NULL ]) : mixed
Parameters
- $key : XMLSecurityKey
-
The key we should use to sign the message.
- $certificates : array<string|int, mixed>
-
The certificates we should add to the signature node.
- $root : DOMElement
-
The XML node we should sign.
- $insertBefore : DomNode = NULL
-
The XML element we should insert the signature element before.
Return values
mixed —parseBoolean()
Parse a boolean attribute.
public
static parseBoolean(DOMElement $node, string $attributeName[, mixed $default = null ]) : bool|mixed
Parameters
- $node : DOMElement
-
The element we should fetch the attribute from.
- $attributeName : string
-
The name of the attribute.
- $default : mixed = null
-
The value that should be returned if the attribute doesn't exist.
Tags
Return values
bool|mixed —The value of the attribute, or $default if the attribute doesn't exist.
parseNameId()
public
static parseNameId(DOMElement $xml) : mixed
Parameters
- $xml : DOMElement
Return values
mixed —processResponse()
public
static processResponse( $certFingerprint, $signatureData) : bool
Parameters
Tags
Return values
bool —sanitize_certificate()
public
static sanitize_certificate(mixed $certificate) : mixed
Parameters
- $certificate : mixed
Return values
mixed —signXML()
public
static signXML(mixed $xml, mixed $publicCertificate, mixed $privateKey[, mixed $insertBeforeTagName = "" ]) : mixed
Parameters
- $xml : mixed
- $publicCertificate : mixed
- $privateKey : mixed
- $insertBeforeTagName : mixed = ""
Return values
mixed —stringToHex()
public
static stringToHex(mixed $bytes) : mixed
Parameters
- $bytes : mixed
Return values
mixed —validateElement()
public
static validateElement(DOMElement $root) : array<string|int, mixed>|bool
Parameters
- $root : DOMElement
Tags
Return values
array<string|int, mixed>|bool —validateSignature()
public
static validateSignature(array<string|int, mixed> $info, XMLSecurityKey $key) : mixed
Parameters
- $info : array<string|int, mixed>
- $key : XMLSecurityKey
Tags
Return values
mixed —xpQuery()
public
static xpQuery(DOMNode $node, mixed $query) : mixed
Parameters
- $node : DOMNode
- $query : mixed
Return values
mixed —xsDateTimeToTimestamp()
public
static xsDateTimeToTimestamp(mixed $time) : mixed
Parameters
- $time : mixed
Return values
mixed —doDecryptElement()
Decrypt an encrypted element.
private
static doDecryptElement(DOMElement $encryptedData, XMLSecurityKey $inputKey, array<string|int, mixed> &$blacklist) : DOMElement
This is an internal helper function.
Parameters
- $encryptedData : DOMElement
-
The encrypted data.
- $inputKey : XMLSecurityKey
-
The decryption key.
- $blacklist : array<string|int, mixed>
-
Blacklisted decryption algorithms.
Tags
Return values
DOMElement —The decrypted element.
findCertificate()
private
static findCertificate(array<string|int, mixed> $certFingerprints, array<string|int, mixed> $certificates) : mixed
Parameters
- $certFingerprints : array<string|int, mixed>
- $certificates : array<string|int, mixed>