Class: Izokatu::Rbnacl::Decrypter Abstract

Inherits:
Decrypter
  • Object
show all
Defined in:
lib/izokatu/rbnacl/decrypter.rb

Overview

This class is abstract.

Subclasses are containing implementation of #create_decrypter!

Abstract class for Rbnacl decrypters

Direct Known Subclasses

PrivateKey::Decrypter, PublicKey::Decrypter

Constant Summary collapse

RBNACL_KEY_CLASSES =

Classes of RbNaCl keys

[
  RbNaCl::Boxes::Curve25519XSalsa20Poly1305::PrivateKey,
  RbNaCl::Boxes::Curve25519XSalsa20Poly1305::PublicKey
].freeze

Instance Attribute Summary collapse

Attributes inherited from Decrypter

#decrypted_data, #decrypter, #encrypted_data

Instance Method Summary collapse

Methods inherited from Decrypter

#decrypt_data!, #import_encrypted_data!, #perform

Methods included from Callable

#call

Constructor Details

#initialize(encrypted_data:, nonce:) ⇒ Decrypter

Initializing option for decryption

Parameters:

Since:

  • 0.1.0



26
27
28
29
30
# File 'lib/izokatu/rbnacl/decrypter.rb', line 26

def initialize(encrypted_data:, nonce:)
  super(encrypted_data: encrypted_data)
  @nonce = nonce
  create_decrypter!
end

Instance Attribute Details

#nonceString (readonly)

Returns initialization vector for one-time use.

Returns:

  • (String)

    initialization vector for one-time use



11
12
13
# File 'lib/izokatu/rbnacl/decrypter.rb', line 11

def nonce
  @nonce
end

Instance Method Details

#create_decrypter!Object

Creating decrypter instance

Raises:

  • RuntimeError

Since:

  • 0.1.0



37
38
39
# File 'lib/izokatu/rbnacl/decrypter.rb', line 37

def create_decrypter!
  raise 'Not implemented!'
end