Class: Ksef::Crypto::Encryptor::Sealed

Inherits:
Data
  • Object
show all
Defined in:
lib/ksef/crypto/encryptor.rb

Overview

What #seal produces: the ciphertext to send, plus the integrity metadata for both forms of the document. Bundled together because §11.1 requires the hash and size of the plaintext and of the ciphertext, and hashing the wrong one of the two is a silent error that only the server can detect.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ciphertext ⇒ Object (readonly)

Returns the value of attribute ciphertext

Returns:

  • (Object) —

    the current value of ciphertext



29
30
31
# File 'lib/ksef/crypto/encryptor.rb', line 29

def ciphertext
  @ciphertext
end

#ciphertext_digest ⇒ Object (readonly)

Returns the value of attribute ciphertext_digest

Returns:

  • (Object) —

    the current value of ciphertext_digest



29
30
31
# File 'lib/ksef/crypto/encryptor.rb', line 29

def ciphertext_digest
  @ciphertext_digest
end

#plaintext_digest ⇒ Object (readonly)

Returns the value of attribute plaintext_digest

Returns:

  • (Object) —

    the current value of plaintext_digest



29
30
31
# File 'lib/ksef/crypto/encryptor.rb', line 29

def plaintext_digest
  @plaintext_digest
end

Instance Method Details

#content ⇒ String

Returns base64 ciphertext, the wire form.

Returns:

  • (String) —

    base64 ciphertext, the wire form



31
# File 'lib/ksef/crypto/encryptor.rb', line 31

def content = Crypto.encode(ciphertext)