public function testDecryptWrongKey() { $this->pki->makeKeys(); $encrypted = $this->pki->encrypt('testmessage'); $newPki = new \Foundation\PKI(); $newPki->makeKeys(); $this->assertFalse($newPki->decrypt($encrypted)); }
protected function setupPki() { $config = $this->_controller->getConfig(); if (!is_readable($config->getPublicKeyCertificatePath())) { throw new \Jazzee\Exception('Unable to read public key for EncryptedInput: ' . $config->getPublicKeyCertificatePath()); } $this->_pki = new \Foundation\PKI(); $this->_pki->setPublicKey(file_get_contents($config->getPublicKeyCertificatePath())); }