Utils of OneLogin PHP Toolkit
Defines several often used methods
t(string $msg, array $args = array()) : string
stringMessage to be translated
arrayArguments
string$translatedMsg Translated text
validateXML(string $xml, string $schema, boolean $debug = false) : string
It will parse the string into a DOM document and validate this document against the schema.
stringThe XML string or document which should be validated.
stringThe schema filename which should be used.
booleanTo disable/enable the debug mode
string| DOMDocument $dom string that explains the problem or the DOMDocument
formatCert(string $cert, boolean $heads = true) : string
stringA x509 unformated cert
booleanTrue if we want to include head and footer
string$x509 Formated cert
formatPrivateKey(string $key, boolean $heads = true) : string
stringA private key
booleanTrue if we want to include head and footer
string$rsaKey Formated private key
redirect(string $url, array $parameters = array(), boolean $stay = false) : string
stringThe target url
arrayExtra parameters to be passed as part of the url
booleanTrue if we want to stay (returns the url string) False to redirect
string$url
getSelfURLhost() : string
string$url
getSelfHost() : string
string$currentHost The current host
isHTTPS() : boolean
boolean$isHttps False if https is not active
getSelfURLNoQuery() : string
string
                                                                    getSelfURL() : string
string
                                                                    generateUniqueID() : string
stringA unique string
parseTime2SAML(string $time) : \$timestamp
stringThe time we should convert (DateTime).
\$timestampSAML2 timestamp.
parseSAML2Time(string $time) : \$timestamp
stringThe time we should convert (SAML Timestamp).
\$timestampConverted to a unix timestamp.
parseDuration(string $duration, int $timestamp = null) : int
stringThe duration, as a string.
intThe unix timestamp we should apply the
                     duration to. Optional, default to the
                     current time.intThe new timestamp, after the duration is applied.
getExpireTime(string $cacheDuration = null, string $validUntil = null) : int
stringThe duration, as a string.
stringThe valid until date, as a string or as a timestamp
int$expireTime The expiration time.
query(\DOMDocument $dom, string $query, \DomElement $context = null) : \DOMNodeList
\DOMDocumentThe DOMDocument
stringXpath Expresion
\DomElementContext Node (DomElement)
\DOMNodeListThe queried nodes
isSessionStarted() : boolean
booleantrue if the sessíon is started
deleteLocalSession()
calculateX509Fingerprint(string $x509cert) : string
stringx509 cert
stringFormated fingerprint
formatFingerPrint(string $fingerprint) : string
stringfingerprint
stringFormated fingerprint
generateNameId(string $value, string $spnq, string $format, string $key = null) : string
stringfingerprint
stringSP Name Qualifier
stringSP Format
stringSP Key to encrypt the nameID
string$nameIDElement DOMElement | XMLSec nameID
getStatus(\DomElement $dom) : array
\DomElementThe Response as XML
array$status The Status, an array with the code and a message.
decryptElement(\DOMElement $encryptedData, \XMLSecurityKey $inputKey) : \DOMElement
\DOMElementThe encrypted data.
\XMLSecurityKeyThe decryption key.
\DOMElementThe decrypted element.
castKey(XMLSecurityKey $key, $algorithm, $type = 'public')
XMLSecurityKeyThe key
stringThe desired algorithm
stringPublic or private key, defaults to public.
addSign(string|\DomDocument $xml, string $key, string $cert)
string|\DomDocumentThe element we should sign
stringThe private key
stringThe public
validateSign(string|\DomDocument $xml, string|null $cert = null, string|null $fingerprint = null)
string|\DomDocumentThe element we should validate
string|nullThe pubic cert
string|nullThe fingerprint of the public cert