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 :nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(str) ⇒ KeyMaterial

Returns a new instance of KeyMaterial.



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

def initialize(str)
  @str = str
end

Instance Method Details

#inspectObject



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

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