You are here

private function XMLSecurityKey::signOpenSSL in SAML SP 2.0 Single Sign On (SSO) - SAML Service Provider 7

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 includes/XMLSecurityKey.php
Signs the data (string) using the extension assigned to the type in the constructor.

File

includes/XMLSecurityKey.php, line 498

Class

XMLSecurityKey

Code

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;
}