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.



235
236
237
238
239
240
241
242
# File 'lib/pq_crypto/signature.rb', line 235

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.



233
234
235
# File 'lib/pq_crypto/signature.rb', line 233

def public_key
  @public_key
end

#secret_keyObject (readonly)

Returns the value of attribute secret_key.



233
234
235
# File 'lib/pq_crypto/signature.rb', line 233

def secret_key
  @secret_key
end

Instance Method Details

#algorithmObject



244
245
246
# File 'lib/pq_crypto/signature.rb', line 244

def algorithm
  @public_key.algorithm
end