Пример #1
0
 public function testDecryptWrongKey()
 {
     $this->pki->makeKeys();
     $encrypted = $this->pki->encrypt('testmessage');
     $newPki = new \Foundation\PKI();
     $newPki->makeKeys();
     $this->assertFalse($newPki->decrypt($encrypted));
 }
Пример #2
0
 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()));
 }