class NKEYS::KeyPair

Attributes

private_key[R]
public_key[R]
seed[R]

Public Class Methods

new(opts={}) click to toggle source
# File lib/nkeys/keypair.rb, line 31
def initialize(opts={})
  @seed = opts[:seed]
  @public_key = opts[:public_key]
  @private_key = opts[:private_key]
  @keys = opts[:keys]
end

Public Instance Methods

sign(input) click to toggle source

Sign will sign the input with KeyPair's private key. @param [String] input @return [String] signed raw data

# File lib/nkeys/keypair.rb, line 41
def sign(input)
  raise ::NKEYS::Error, "nkeys: Missing keys for signing" if @keys.nil?

  @keys.sign(input)
end
verify(input, sig) click to toggle source

Verify the input againt a signature utilizing the public key. @param [String] input @param [String] sig @return [Bool] the result of verifying the signed input.

# File lib/nkeys/keypair.rb, line 51
def verify(input, sig)
  # TODO
  return
end
wipe() click to toggle source
# File lib/nkeys/keypair.rb, line 83
def wipe
  @seed.clear if @seed
  @public_key.clear if @public_key
  @private_key.clear if @private_key
  @keys = nil
end
Also aliased as: wipe!
wipe!()
Alias for: wipe