RobRichards\XMLSecLibs\XMLSecurityKey::decryptOpenSSL PHP Method

decryptOpenSSL() private method

Decrypts the given data (string) using the openssl-extension
private decryptOpenSSL ( string $data ) : string
$data string
return string
    private function decryptOpenSSL($data)
    {
        if ($this->cryptParams['type'] == 'public') {
            if (!openssl_public_decrypt($data, $decrypted, $this->key, $this->cryptParams['padding'])) {
                throw new Exception('Failure decrypting Data');
            }
        } else {
            if (!openssl_private_decrypt($data, $decrypted, $this->key, $this->cryptParams['padding'])) {
                throw new Exception('Failure decrypting Data');
            }
        }
        return $decrypted;
    }