Class: KStor::Crypto::ArmoredValue
- Inherits:
-
Object
- Object
- KStor::Crypto::ArmoredValue
show all
- Defined in:
- lib/kstor/crypto/keys.rb
Overview
Wrapper class for an ASCII-armored value.
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of ArmoredValue.
44
45
46
|
# File 'lib/kstor/crypto/keys.rb', line 44
def initialize(value)
@value = value
end
|
Class Method Details
.from_binary(bin_str) ⇒ Object
57
58
59
|
# File 'lib/kstor/crypto/keys.rb', line 57
def self.from_binary(bin_str)
new(ASCIIArmor.encode(bin_str))
end
|
Instance Method Details
#to_ascii ⇒ Object
Also known as:
to_s
48
49
50
|
# File 'lib/kstor/crypto/keys.rb', line 48
def to_ascii
@value
end
|
#to_binary ⇒ Object
53
54
55
|
# File 'lib/kstor/crypto/keys.rb', line 53
def to_binary
ASCIIArmor.decode(@value)
end
|