private function XMLSecurityKey::signOpenSSL in SAML SP 2.0 Single Sign On (SSO) - SAML Service Provider 8
Signs the given data (string) using the openssl-extension
Parameters
string $data:
Return value
string
Throws
Exception
1 call to XMLSecurityKey::signOpenSSL()
- XMLSecurityKey::signData in src/
XMLSecurityKey.php - Signs the data (string) using the extension assigned to the type in the constructor.
File
- src/
XMLSecurityKey.php, line 465
Class
Namespace
Drupal\miniorange_samlCode
private function signOpenSSL($data) {
$algo = OPENSSL_ALGO_SHA1;
if (!empty($this->cryptParams['digest'])) {
$algo = $this->cryptParams['digest'];
}
if (!openssl_sign($data, $signature, $this->key, $algo)) {
throw new Exception('Failure Signing Data: ' . openssl_error_string() . ' - ' . $algo);
}
return $signature;
}