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