Class: HttpSignatures::Signer
- Inherits:
-
Object
- Object
- HttpSignatures::Signer
- Defined in:
- lib/http_signatures/signer.rb
Constant Summary collapse
- AUTHORIZATION_SCHEME =
"Signature"
Instance Method Summary collapse
-
#initialize(key:, algorithm:, header_list:) ⇒ Signer
constructor
A new instance of Signer.
- #sign(message) ⇒ Object
Constructor Details
#initialize(key:, algorithm:, header_list:) ⇒ Signer
Returns a new instance of Signer.
6 7 8 9 10 |
# File 'lib/http_signatures/signer.rb', line 6 def initialize(key:, algorithm:, header_list:) @key = key @algorithm = algorithm @header_list = header_list end |
Instance Method Details
#sign(message) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/http_signatures/signer.rb', line 12 def sign() .tap do |m| m["Signature"] = [signature_parameters().to_str] m["Authorization"] = [AUTHORIZATION_SCHEME + " " + signature_parameters().to_str] end end |