/** * * @see \CryptoUtil\PBE\PBEScheme::decryptWithKey() * @throws \UnexpectedValueException If decryption failed * @return string */ public function decryptWithKey($data, $key) { try { $str = $this->_crypto->decrypt($data, $key, $this->_cipher); return $this->_removePadding($str, $this->_cipher->blockSize()); } catch (\RuntimeException $e) { throw new \UnexpectedValueException("Decryption failed.", null, $e); } }
protected function _paramsASN1() { return new Sequence($this->_kdf->toASN1(), $this->_es->toASN1()); }