Class: BlockCipherKit::KeyMaterial

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/block_cipher_kit/key_material.rb

Overview

Allows a string with key material (like IV and key) to be concealed when an object holding it gets printed or show via #inspect

Instance Method Summary collapse

Constructor Details

#initialize(str) ⇒ KeyMaterial

Returns a new instance of KeyMaterial.



9
10
11
# File 'lib/block_cipher_kit/key_material.rb', line 9

def initialize(str)
  @str = str
end

Instance Method Details

#inspectObject



13
14
15
# File 'lib/block_cipher_kit/key_material.rb', line 13

def inspect
  "[SENSITIVE(#{@str.bytesize * 8} bits)]"
end