class Binance::Authentication

Authentication response to API key and signature

def hmac_sign(data)

def hmac_sign(data)
  OpenSSL::HMAC.hexdigest(
    OpenSSL::Digest.new('sha256'), secret, data
  )
end

def initialize(key, secret, private_key = nil, private_key_pass_phrase = nil)

def initialize(key, secret, private_key = nil, private_key_pass_phrase = nil)
  @key = key
  @secret = secret
  @private_key = private_key
  @private_key_pass_phrase = private_key_pass_phrase
end

def provide_private_key?

def provide_private_key?
  private_key
end

def rsa_sign(data)

def rsa_sign(data)
  pkey = OpenSSL::PKey::RSA.new(private_key, private_key_pass_phrase)
  Base64.encode64(pkey.sign('SHA256', data))
end