ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
|
Public Member Functions | |
__construct ($xmlNode, $idAttribute=null, $publickey=false) | |
This function initializes the validator. More... | |
getX509Certificate () | |
Retrieve the X509 certificate which was used to sign the XML. More... | |
validateFingerprint ($fingerprints) | |
Validate the fingerprint of the certificate which was used to sign this document. More... | |
isNodeValidated ($node) | |
This function checks if the given XML node was signed. More... | |
validateCA ($caFile) | |
Validate the certificate used to sign the XML against a CA file. More... | |
Static Public Member Functions | |
static | validateCertificate ($certificate, $caFile) |
Validate the certificate used to sign the XML against a CA file. More... | |
Static Private Member Functions | |
static | calculateX509Fingerprint ($x509cert) |
Calculates the fingerprint of an X509 certificate. More... | |
static | validateCertificateFingerprint ($certificate, $fingerprints) |
Helper function for validating the fingerprint. More... | |
static | validateCABuiltIn ($certificate, $caFile) |
Validate a certificate against a CA file, by using the builtin openssl_x509_checkpurpose function. More... | |
static | validateCAExec ($certificate, $caFile) |
Validate the certificate used to sign the XML against a CA file, by using the "openssl verify" command. More... | |
Private Attributes | |
$x509Certificate | |
$validNodes = null | |
Definition at line 16 of file Validator.php.
SimpleSAML\XML\Validator::__construct | ( | $xmlNode, | |
$idAttribute = null , |
|||
$publickey = false |
|||
) |
This function initializes the validator.
This function accepts an optional parameter $publickey, which is the public key or certificate which should be used to validate the signature. This parameter can take the following values:
\DOMNode | $xmlNode | The XML node which contains the Signature element. |
string | array | $idAttribute | The ID attribute which is used in node references. If this attribute is NULL (the default), then we will use whatever is the default ID. Can be eigther a string with one value, or an array with multiple ID attrbute names. |
array | bool | $publickey | The public key / certificate which should be used to validate the XML node. |
Definition at line 49 of file Validator.php.
References $certificate, array, and RobRichards\XMLSecLibs\XMLSecEnc\staticLocateKeyInfo().
|
staticprivate |
Calculates the fingerprint of an X509 certificate.
string | $x509cert | The certificate as a base64-encoded string. The string may optionally be framed with '--—BEGIN CERTIFICATE--—' and '--—END CERTIFICATE--—'. |
Definition at line 163 of file Validator.php.
References $data.
SimpleSAML\XML\Validator::getX509Certificate | ( | ) |
Retrieve the X509 certificate which was used to sign the XML.
This function will return the certificate as a PEM-encoded string. If the XML wasn't signed by an X509 certificate, NULL will be returned.
Definition at line 149 of file Validator.php.
References SimpleSAML\XML\Validator\$x509Certificate.
SimpleSAML\XML\Validator::isNodeValidated | ( | $node | ) |
This function checks if the given XML node was signed.
\DOMNode | $node | The XML node which we should verify that was signed. |
Definition at line 275 of file Validator.php.
SimpleSAML\XML\Validator::validateCA | ( | $caFile | ) |
Validate the certificate used to sign the XML against a CA file.
This function throws an exception if unable to validate against the given CA file.
string | $caFile | File with trusted certificates, in PEM-format. |
Definition at line 302 of file Validator.php.
|
staticprivate |
Validate a certificate against a CA file, by using the builtin openssl_x509_checkpurpose function.
string | $certificate | The certificate, in PEM format. |
string | $caFile | File with trusted certificates, in PEM-format. |
Definition at line 322 of file Validator.php.
References $certificate, $error, $errors, $res, and array.
|
staticprivate |
Validate the certificate used to sign the XML against a CA file, by using the "openssl verify" command.
This function uses the openssl verify command to verify a certificate, to work around limitations on the openssl_x509_checkpurpose function. That function will not work on certificates without a purpose set.
string | $certificate | The certificate, in PEM format. |
string | $caFile | File with trusted certificates, in PEM-format. |
Definition at line 359 of file Validator.php.
References $certificate, $out, and array.
|
static |
Validate the certificate used to sign the XML against a CA file.
This function throws an exception if unable to validate against the given CA file.
string | $certificate | The certificate, in PEM format. |
string | $caFile | File with trusted certificates, in PEM-format. |
Definition at line 418 of file Validator.php.
References $certificate, and SimpleSAML\Logger\debug().
Referenced by SimpleSAML_Utilities\validateCA().
|
staticprivate |
Helper function for validating the fingerprint.
Checks the fingerprint of a certificate against an array of valid fingerprints. Will throw an exception if none of the fingerprints matches.
string | $certificate | The X509 certificate we should validate. |
array | $fingerprints | The valid fingerprints. |
Definition at line 206 of file Validator.php.
References $certificate.
SimpleSAML\XML\Validator::validateFingerprint | ( | $fingerprints | ) |
Validate the fingerprint of the certificate which was used to sign this document.
This function accepts either a string, or an array of strings as a parameter. If this is an array, then any string (certificate) in the array can match. If this is a string, then that string must match,
string | array | $fingerprints | The fingerprints which should match. This can be a single string, or an array of fingerprints. |
Definition at line 244 of file Validator.php.
References array.
|
private |
Definition at line 28 of file Validator.php.
|
private |
Definition at line 23 of file Validator.php.
Referenced by SimpleSAML\XML\Validator\getX509Certificate().