class Izokatu::Rbnacl::PublicKey::Decrypter
RbNaCl public key decrypter
Attributes
private_key[R]
@return [RbNaCl::Boxes::Curve25519XSalsa20Poly1305::PrivateKey] private key
public_key[R]
@return [RbNaCl::Boxes::Curve25519XSalsa20Poly1305::PublicKey] public key
Public Class Methods
new(public_key:, private_key:, encrypted_data:, nonce:)
click to toggle source
Initializing option for decryption
@param encrypted_data (encrypted_data
) @param nonce (nonce
) @param public_key
(public_key
) @param private_key
(private_key
)
@since 0.1.0
Calls superclass method
Izokatu::Rbnacl::Decrypter::new
# File lib/izokatu/rbnacl/public_key/decrypter.rb, line 23 def initialize(public_key:, private_key:, encrypted_data:, nonce:) @public_key = public_key @private_key = private_key super(encrypted_data: encrypted_data, nonce: nonce) end
Public Instance Methods
create_decrypter!()
click to toggle source
Initializing decrypter instance
@return [RbNaCl::Boxes::Curve25519XSalsa20Poly1305] decrypter instance
@since 0.1.0
# File lib/izokatu/rbnacl/public_key/decrypter.rb, line 35 def create_decrypter! @decrypter = RbNaCl::Box.new(public_key, private_key) end
decrypt_data!()
click to toggle source
Decrypting data
@return [Hash] decrypted data
@since 0.1.0
# File lib/izokatu/rbnacl/public_key/decrypter.rb, line 45 def decrypt_data! { decrypted_data_string: decrypter.decrypt(nonce, encrypted_data) } end