Class Nanite::EncryptedDocument
In: lib/nanite/security/encrypted_document.rb
Parent: Object

Represents a signed an encrypted document that can be later decrypted using the right private key and whose signature can be verified using the right cert. This class can be used both to encrypt and sign data and to then check the signature and decrypt an encrypted document.

Methods

Public Class methods

Initialize from encrypted data.

Encrypt and sign data using certificate and key pair.

Arguments:

 - 'data':   Data to be encrypted
 - 'certs':  Recipient certificates (certificates corresponding to private
             keys that may be used to decrypt data)
 - 'cipher': Cipher used for encryption, AES 256 CBC by default

Public Instance methods

Decrypted data

Arguments:

  - 'key':  Key used for decryption
  - 'cert': Certificate to use for decryption

Encrypted data using DER format

[Validate]