Class: HealthCards::PublicKey

Inherits:
Key
  • Object
show all
Defined in:
lib/health_cards/public_key.rb

Overview

A key used for verifying JWS

Constant Summary

Constants inherited from Key

Key::BASE, Key::DIGEST

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Key

#coordinates, enforce_valid_key_type!, from_jwk, #group, #initialize, #kid, #public_coordinates, #to_json, #to_jwk

Constructor Details

This class inherits a constructor from HealthCards::Key

Class Method Details

.from_json(json) ⇒ Object



6
7
8
# File 'lib/health_cards/public_key.rb', line 6

def self.from_json(json)
  # TODO
end

Instance Method Details

#verify(payload, signature) ⇒ Object



10
11
12
# File 'lib/health_cards/public_key.rb', line 10

def verify(payload, signature)
  @key.verify(OpenSSL::Digest.new('SHA256'), raw_to_asn1(signature, self), payload)
end