You are here

public function XMLSecEnc::decryptKey in SAML SP 2.0 Single Sign On (SSO) - SAML Service Provider 8

Parameters

XMLSecurityKey $encKey:

Return value

DOMElement|string

Throws

Exception

File

src/XMLSecurityKey.php, line 2113

Class

XMLSecEnc

Namespace

Drupal\miniorange_saml

Code

public function decryptKey($encKey) {
  if (!$encKey->isEncrypted) {
    throw new Exception("Key is not Encrypted");
  }
  if (empty($encKey->key)) {
    throw new Exception("Key is missing data to perform the decryption");
  }
  return $this
    ->decryptNode($encKey, false);
}