Class: Virgil::SDK::Cryptography::Hashes::Fingerprint
- Inherits:
-
Object
- Object
- Virgil::SDK::Cryptography::Hashes::Fingerprint
- Defined in:
- lib/virgil/sdk/cryptography/hashes/fingerprint.rb
Overview
Fingerprint container class.
Class provides methods for importing and exporting fingerprints.
Class Method Summary collapse
-
.from_hex(fingerprint_hex) ⇒ FingerPrint
Creates new Fingerprint from hex.
Instance Method Summary collapse
-
#initialize(fingerprint_bytes) ⇒ Fingerprint
constructor
A new instance of Fingerprint.
-
#to_hex ⇒ String
Fingerprint data in hexadecimal.
-
#value ⇒ Crypto::Bytes
Raw fingerprint value.
Constructor Details
#initialize(fingerprint_bytes) ⇒ Fingerprint
Returns a new instance of Fingerprint
43 44 45 |
# File 'lib/virgil/sdk/cryptography/hashes/fingerprint.rb', line 43 def initialize(fingerprint_bytes) @fingerprint_bytes = fingerprint_bytes end |
Class Method Details
.from_hex(fingerprint_hex) ⇒ FingerPrint
Creates new Fingerprint from hex.
50 51 52 53 |
# File 'lib/virgil/sdk/cryptography/hashes/fingerprint.rb', line 50 def self.from_hex(fingerprint_hex) data = Crypto::Native::VirgilByteArrayUtils.hex_to_bytes(fingerprint_hex) return self.new(data) end |
Instance Method Details
#to_hex ⇒ String
Fingerprint data in hexadecimal.
63 64 65 66 |
# File 'lib/virgil/sdk/cryptography/hashes/fingerprint.rb', line 63 def to_hex hex_data = Crypto::Native::VirgilByteArrayUtils.bytes_to_hex(value) return hex_data end |
#value ⇒ Crypto::Bytes
Raw fingerprint value.
57 58 59 |
# File 'lib/virgil/sdk/cryptography/hashes/fingerprint.rb', line 57 def value @fingerprint_bytes end |