Class: Linzer::RSAPSS::Key

Inherits:
Key
  • Object
show all
Defined in:
lib/linzer/rsa_pss.rb

Instance Attribute Summary

Attributes inherited from Key

#material

Instance Method Summary collapse

Methods inherited from Key

#initialize, #key_id

Constructor Details

This class inherits a constructor from Linzer::Key

Instance Method Details

#sign(data) ⇒ Object



13
14
15
16
# File 'lib/linzer/rsa_pss.rb', line 13

def sign(data)
  # XXX: should check if the key is usable for signing
  @material.sign(@params[:digest], data, signature_options)
end

#validateObject



8
9
10
11
# File 'lib/linzer/rsa_pss.rb', line 8

def validate
  super
  validate_digest
end

#verify(signature, data) ⇒ Object



18
19
20
21
22
23
24
25
26
27
# File 'lib/linzer/rsa_pss.rb', line 18

def verify(signature, data)
  # XXX: should check if the key is usable for verifying
  return true if @material.verify(
    @params[:digest],
    signature,
    data,
    signature_options
  )
  false
end