Method | Description | |
---|---|---|
addSign ( string | DomDocument $xml, string $key, string $cert, string $signAlgorithm = XMLSecurityKey::RSA_SHA1 ) : string | Adds signature key and senders certificate to an element (Message or Assertion). | |
calculateX509Fingerprint ( string $x509cert, $alg = 'sha1' ) : null | string | Calculates the fingerprint of a x509cert. | |
castKey ( XMLSecurityKey $key, string $algorithm, string $type = 'public' ) : XMLSecurityKey | Converts a XMLSecurityKey to the correct algorithm. | |
decryptElement ( DOMElement $encryptedData, XMLSecurityKey $inputKey ) : DOMElement | Decrypts an encrypted element. | |
deleteLocalSession ( ) | Deletes the local session. | |
extractOriginalQueryParam ( string $name ) : string | Extract a query param - as it was sent - from $_SERVER[QUERY_STRING] | |
formatCert ( string $cert, boolean $heads = true ) : string | Returns a x509 cert (adding header & footer if required). | |
formatFingerPrint ( string $fingerprint ) : string | Formates a fingerprint. | |
formatPrivateKey ( string $key, boolean $heads = true ) : string | Returns a private key (adding header & footer if required). | |
generateNameId ( string $value, string $spnq, string $format, string | null $cert = null ) : string | Generates a nameID. | |
generateUniqueID ( ) : string | Generates an unique string (used for example as ID for assertions). | |
getBaseURLPath ( ) | return string The baseurlpath to be used when constructing URLs | |
getExpireTime ( string $cacheDuration = null, string $validUntil = null ) : integer | Compares 2 dates and returns the earliest. | |
getProxyVars ( ) | return bool | |
getSelfHost ( ) : string | Returns the current host. | |
getSelfPort ( ) : null | string | ||
getSelfProtocol ( ) : string | ||
getSelfRoutedURLNoQuery ( ) : string | Returns the routed URL of the current host + current view. | |
getSelfURL ( ) : string | Returns the URL of the current host + current view + query. | |
getSelfURLNoQuery ( ) : string | Returns the URL of the current host + current view. | |
getSelfURLhost ( ) : string | Returns the protocol + the current host + the port (if different than common ports). | |
getStatus ( DOMDocument $dom ) : array | Gets Status from a Response. | |
get_string_between ( string $str, string $start, string $end ) : string | Extracts a substring between 2 marks | |
isHTTPS ( ) : boolean | Checks if https or http. | |
isSessionStarted ( ) : boolean | Checks if the session is started or not. | |
loadXML ( DOMDocument $dom, string $xml ) : DOMDocument | This function load an XML string in a save way. | |
parseDuration ( string $duration, integer | null $timestamp = null ) : integer | null | Interprets a ISO8601 duration value relative to a given timestamp. | |
parseSAML2Time ( string $time ) : integer | Converts a SAML2 timestamp on the form yyyy-mm-ddThh:mm:ss(\.s+)?Z to a UNIX timestamp. The sub-second part is ignored. | |
parseTime2SAML ( string $time ) : string | Converts a UNIX timestamp to SAML2 timestamp on the form yyyy-mm-ddThh:mm:ss(\.s+)?Z. | |
query ( DOMDocument $dom, string $query, DomElement $context = null ) : DOMNodeList | Extracts nodes from the DOMDocument. | |
redirect ( string $url, array $parameters = [], boolean $stay = false ) : string | null | Executes a redirection to the provided url (or return the target url). | |
setBaseURL ( $baseurl ) | ||
setBaseURLPath ( $baseurlpath ) | ||
setProxyVars ( $proxyVars ) | ||
setSelfHost ( $host ) | ||
setSelfPort ( $port ) | ||
setSelfProtocol ( $protocol ) | ||
t ( string $msg, array | null $args = [] ) : string | Translates any string. Accepts args | |
validateSign ( string | DomNode $xml, string | null $cert = null, string | null $fingerprint = null, string | null $fingerprintalg = 'sha1', string | null $xpath = null ) : boolean | Validates a signature (Message or Assertion). | |
validateXML ( string | DOMDocument $xml, string $schema, boolean $debug = false ) : string | DOMDocument | This function attempts to validate an XML string against the specified schema. |
Method | Description | |
---|---|---|
buildWithBaseURLPath ( $info ) : string | Returns the part of the URL with the BaseURLPath. | |
getRawHost ( ) : string |
public static addSign ( string | DomDocument $xml, string $key, string $cert, string $signAlgorithm = XMLSecurityKey::RSA_SHA1 ) : string | ||
$xml | string | DomDocument | The element we should sign |
$key | string | The private key |
$cert | string | The public |
$signAlgorithm | string | Signature algorithm method |
return | string |
protected static buildWithBaseURLPath ( $info ) : string | ||
return | string |
public static decryptElement ( DOMElement $encryptedData, XMLSecurityKey $inputKey ) : DOMElement | ||
$encryptedData | DOMElement | The encrypted data. |
$inputKey | XMLSecurityKey | The decryption key. |
return | DOMElement | The decrypted element. |
public static deleteLocalSession ( ) |
public static extractOriginalQueryParam ( string $name ) : string | ||
$name | string | The param to-be extracted |
return | string |
public static formatFingerPrint ( string $fingerprint ) : string | ||
$fingerprint | string | fingerprint |
return | string | Formatted fingerprint |
public static generateNameId ( string $value, string $spnq, string $format, string | null $cert = null ) : string | ||
$value | string | fingerprint |
$spnq | string | SP Name Qualifier |
$format | string | SP Format |
$cert | string | null | IdP Public cert to encrypt the nameID |
return | string | $nameIDElement DOMElement | XMLSec nameID |
public static generateUniqueID ( ) : string | ||
return | string | A unique string |
public static getBaseURLPath ( ) |
protected static getRawHost ( ) : string | ||
return | string | The raw host name |
public static getSelfHost ( ) : string | ||
return | string | $currentHost The current host |
public static getSelfPort ( ) : null | string | ||
return | null | string | The port number used for the request |
public static getSelfProtocol ( ) : string | ||
return | string | http|https |
public static getSelfRoutedURLNoQuery ( ) : string | ||
return | string |
public static getSelfURL ( ) : string | ||
return | string |
public static getSelfURLNoQuery ( ) : string | ||
return | string |
public static getSelfURLhost ( ) : string | ||
return | string | $url |
public static isSessionStarted ( ) : boolean | ||
return | boolean | true if the sessÃon is started |
public static parseDuration ( string $duration, integer | null $timestamp = null ) : integer | null | ||
$duration | string | The duration, as a string. |
$timestamp | integer | null | The unix timestamp we should apply the duration to. Optional, default to the current time. |
return | integer | null | The new timestamp, after the duration is applied. |
public static parseSAML2Time ( string $time ) : integer | ||
$time | string | The time we should convert (SAML Timestamp). |
return | integer | $timestamp Converted to a unix timestamp. |
public static parseTime2SAML ( string $time ) : string | ||
$time | string | The time we should convert (DateTime). |
return | string | $timestamp SAML2 timestamp. |
public static redirect ( string $url, array $parameters = [], boolean $stay = false ) : string | null | ||
$url | string | The target url |
$parameters | array | Extra parameters to be passed as part of the url |
$stay | boolean | True if we want to stay (returns the url string) False to redirect |
return | string | null | $url |
public static setBaseURL ( $baseurl ) | ||
$baseurl | string The base url to be used when constructing URLs |
public static setBaseURLPath ( $baseurlpath ) | ||
$baseurlpath | string The baseurl path to use when constructing URLs |
public static setProxyVars ( $proxyVars ) | ||
$proxyVars | bool Whether to use `X-Forwarded-*` headers to determine port/domain/protocol |
public static setSelfHost ( $host ) | ||
$host | string The host to use when constructing URLs |
public static setSelfPort ( $port ) | ||
$port | int The port number to use when constructing URLs |
public static setSelfProtocol ( $protocol ) | ||
$protocol | string The protocol to identify as using, usually http or https |
public static validateSign ( string | DomNode $xml, string | null $cert = null, string | null $fingerprint = null, string | null $fingerprintalg = 'sha1', string | null $xpath = null ) : boolean | ||
$xml | string | DomNode | The element we should validate |
$cert | string | null | The pubic cert |
$fingerprint | string | null | The fingerprint of the public cert |
$fingerprintalg | string | null | The algorithm used to get the fingerprint |
$xpath | string | null | The xpath of the signed element |
return | boolean |
public static validateXML ( string | DOMDocument $xml, string $schema, boolean $debug = false ) : string | DOMDocument | ||
$xml | string | DOMDocument | The XML string or document which should be validated. |
$schema | string | The schema filename which should be used. |
$debug | boolean | To disable/enable the debug mode |
return | string | DOMDocument | $dom string that explains the problem or the DOMDocument |