class RSAPKCS1Algorithm

Attributes

hash_function[R]

Public Class Methods

new(*args, hash_function:) click to toggle source
Calls superclass method
# File lib/cose/rsapkcs1_algorithm.rb, line 12
def initialize(*args, hash_function:)
  super(*args)

  @hash_function = hash_function
end

Private Instance Methods

signature_algorithm_class() click to toggle source
# File lib/cose/rsapkcs1_algorithm.rb, line 20
def signature_algorithm_class
  OpenSSL::SignatureAlgorithm::RSAPKCS1
end
to_pkey(key) click to toggle source
# File lib/cose/rsapkcs1_algorithm.rb, line 28
def to_pkey(key)
  case key
  when COSE::Key::RSA
    key.to_pkey
  when OpenSSL::PKey::RSA
    key
  else
    raise(COSE::Error, "Incompatible key for algorithm")
  end
end
valid_key?(key) click to toggle source
# File lib/cose/rsapkcs1_algorithm.rb, line 24
def valid_key?(key)
  to_cose_key(key).is_a?(COSE::Key::RSA)
end