Ejemplo n.º 1
0
 public function decryptObject(ReadableEncryptedContent $object)
 {
     $passphrase = $this->getPassphrase();
     $data = $object->getContent($passphrase);
     if (!$object->isChecksumValid($data, $passphrase)) {
         $this->flash->warning('<strong>Warning:</strong> Checksum did not match data');
     }
     return $data;
 }
Ejemplo n.º 2
0
 protected function decryptContent(ReadableEncryptedContent $object)
 {
     $user = Security::getCurrentUser();
     if ($object->getKeyId() === $user->accountKey_id) {
         $keyService = new \Stecman\Passnote\AccountKeyService();
         return $keyService->decryptObject($object);
     } else {
         // Prompt for decryption passphrase
     }
 }