Method | Description | |
---|---|---|
aesDecrypt ( string $ciphertext ) : string | Decrypt data using AES-256-CBC and the system-wide secret salt as key. | |
aesEncrypt ( string $data ) : string | Encrypt data using AES-256-CBC and the system-wide secret salt as key. | |
loadPrivateKey ( SimpleSAML_Configuration $metadata, boolean $required = false, string $prefix = '' ) : array | null | Load a private key from metadata. | |
loadPublicKey ( SimpleSAML_Configuration $metadata, boolean $required = false, string $prefix = '' ) : array | null | Get public key or certificate from metadata. | |
pwHash ( string $password, string $algorithm, string $salt = null ) : string | This function hashes a password with a given algorithm. | |
pwValid ( string $hash, string $password ) : boolean | This function checks if a password is valid |
Method | Description | |
---|---|---|
_aesDecrypt ( string $ciphertext, string $secret ) : string | Decrypt data using AES-256-CBC and the key provided as a parameter. | |
_aesEncrypt ( string $data, string $secret ) : string | Encrypt data using AES-256-CBC and the key provided as a parameter. |
public static aesDecrypt ( string $ciphertext ) : string | ||
$ciphertext | string | The IV used and the encrypted data, concatenated. |
return | string | The decrypted data. |
public static aesEncrypt ( string $data ) : string | ||
$data | string | The data to encrypt. |
return | string | The IV and encrypted data concatenated. |
public static loadPrivateKey ( SimpleSAML_Configuration $metadata, boolean $required = false, string $prefix = '' ) : array | null | ||
$metadata | SimpleSAML_Configuration | The metadata array the private key should be loaded from. |
$required | boolean | Whether the private key is required. If this is true, a missing key will cause an exception. Defaults to false. |
$prefix | string | The prefix which should be used when reading from the metadata array. Defaults to ''. |
return | array | null | Extracted private key, or NULL if no private key is present. |
public static loadPublicKey ( SimpleSAML_Configuration $metadata, boolean $required = false, string $prefix = '' ) : array | null | ||
$metadata | SimpleSAML_Configuration | The metadata. |
$required | boolean | Whether the private key is required. If this is TRUE, a missing key will cause an exception. Default is FALSE. |
$prefix | string | The prefix which should be used when reading from the metadata array. Defaults to ''. |
return | array | null | Public key or certificate data, or NULL if no public key or certificate was found. |
public static pwHash ( string $password, string $algorithm, string $salt = null ) : string | ||
$password | string | The password to hash. |
$algorithm | string | The hashing algorithm, uppercase, optionally prepended with 'S' (salted). See hash_algos() for a complete list of hashing algorithms. |
$salt | string | An optional salt to use. |
return | string | The hashed password. |