class Virgil::SDK::Client::RequestSigner
Class used for signing high_level requests.
Attributes
crypto[R]
Public Class Methods
new(crypto)
click to toggle source
Constructs new RequestSigner
object
# File lib/virgil/sdk/client/request_signer.rb, line 43 def initialize(crypto) @crypto = crypto end
Public Instance Methods
self_sign(signable_request, private_key)
click to toggle source
Sign passed request with private key.
Args:
signable_request: request for signing. private_key: private key to sign with.
# File lib/virgil/sdk/client/request_signer.rb, line 52 def self_sign(signable_request, private_key) fingerprint = self.crypto.calculate_fingerprint( signable_request.snapshot ) signature = self.crypto.sign( fingerprint.value, private_key ) signable_request.sign_with( fingerprint.to_hex, signature ) end