class COSE::SecurityMessage::Headers

Constants

HEADER_LABEL_ALG
HEADER_LABEL_KID

Attributes

protected_bucket[R]
unprotected_bucket[R]

Public Class Methods

new(protected_bucket, unprotected_bucket) click to toggle source
# File lib/cose/security_message/headers.rb, line 11
def initialize(protected_bucket, unprotected_bucket)
  @protected_bucket = protected_bucket
  @unprotected_bucket = unprotected_bucket
end

Public Instance Methods

alg() click to toggle source
# File lib/cose/security_message/headers.rb, line 16
def alg
  header(HEADER_LABEL_ALG)
end
kid() click to toggle source
# File lib/cose/security_message/headers.rb, line 20
def kid
  header(HEADER_LABEL_KID)
end

Private Instance Methods

header(label) click to toggle source
# File lib/cose/security_message/headers.rb, line 26
def header(label)
  protected_bucket[label] || unprotected_bucket[label]
end