Class: PQCrypto::Signature::Keypair

Inherits:
Object
  • Object
show all
Defined in:
lib/pq_crypto/signature.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(public_key, secret_key) ⇒ Keypair

Returns a new instance of Keypair.



171
172
173
174
175
176
177
178
# File 'lib/pq_crypto/signature.rb', line 171

def initialize(public_key, secret_key)
  @public_key = public_key
  @secret_key = secret_key

  unless @public_key.algorithm == @secret_key.algorithm
    raise InvalidKeyError, "Signature keypair algorithms do not match"
  end
end

Instance Attribute Details

#public_keyObject (readonly)

Returns the value of attribute public_key.



169
170
171
# File 'lib/pq_crypto/signature.rb', line 169

def public_key
  @public_key
end

#secret_keyObject (readonly)

Returns the value of attribute secret_key.



169
170
171
# File 'lib/pq_crypto/signature.rb', line 169

def secret_key
  @secret_key
end

Instance Method Details

#algorithmObject



180
181
182
# File 'lib/pq_crypto/signature.rb', line 180

def algorithm
  @public_key.algorithm
end