Class: Keyring::Key

Inherits:
Object
  • Object
show all
Defined in:
lib/keyring/key.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, key, key_size) ⇒ Key

Returns a new instance of Key.



5
6
7
8
9
# File 'lib/keyring/key.rb', line 5

def initialize(id, key, key_size)
  @id = Integer(id)
  @key_size = key_size
  @encryption_key, @signing_key = parse_key(key)
end

Instance Attribute Details

#encryption_keyObject (readonly)

Returns the value of attribute encryption_key.



3
4
5
# File 'lib/keyring/key.rb', line 3

def encryption_key
  @encryption_key
end

#idObject (readonly)

Returns the value of attribute id.



3
4
5
# File 'lib/keyring/key.rb', line 3

def id
  @id
end

#signing_keyObject (readonly)

Returns the value of attribute signing_key.



3
4
5
# File 'lib/keyring/key.rb', line 3

def signing_key
  @signing_key
end

Instance Method Details

#to_sObject Also known as: inspect



11
12
13
# File 'lib/keyring/key.rb', line 11

def to_s
  "#<Keyring::Key id=#{id.inspect}>"
end