Module: Linzer::Signer

Defined in:
lib/linzer/signer.rb

Constant Summary collapse

DEFAULT_LABEL =
"sig1"

Class Method Summary collapse

Class Method Details

.default_labelObject



20
21
22
# File 'lib/linzer/signer.rb', line 20

def default_label
  DEFAULT_LABEL
end

.sign(key, message, components, options = {}) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/linzer/signer.rb', line 8

def sign(key, message, components, options = {})
  validate key, message, components

  parameters = populate_parameters(key, options)
  signature_base = message.signature_base(components, parameters)

  signature = _sign(key, signature_base, options)
  label = options[:label] || DEFAULT_LABEL

  Linzer::Signature.build(serialize(signature, components, parameters, label))
end