Class: A2A::AgentCard::Signature
- Inherits:
-
Object
- Object
- A2A::AgentCard::Signature
- Defined in:
- lib/a2a/agent_card/signature.rb
Overview
§8.4.2 — JWS signature attached to an AgentCard. ‘protected` is the base64url-encoded JWS Protected Header. `signature` is the base64url-encoded signature value. `header` is the optional JWS Unprotected Header (plain JSON object, not encoded).
Instance Attribute Summary collapse
-
#header ⇒ Object
readonly
Returns the value of attribute header.
-
#protected_header ⇒ Object
readonly
Returns the value of attribute protected_header.
-
#signature ⇒ Object
readonly
Returns the value of attribute signature.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(protected_header:, signature:, header: nil) ⇒ Signature
constructor
A new instance of Signature.
- #to_h ⇒ Object
Constructor Details
#initialize(protected_header:, signature:, header: nil) ⇒ Signature
Returns a new instance of Signature.
12 13 14 15 16 |
# File 'lib/a2a/agent_card/signature.rb', line 12 def initialize(protected_header:, signature:, header: nil) @protected_header = protected_header @signature = signature @header = header end |
Instance Attribute Details
#header ⇒ Object (readonly)
Returns the value of attribute header.
10 11 12 |
# File 'lib/a2a/agent_card/signature.rb', line 10 def header @header end |
#protected_header ⇒ Object (readonly)
Returns the value of attribute protected_header.
10 11 12 |
# File 'lib/a2a/agent_card/signature.rb', line 10 def protected_header @protected_header end |
#signature ⇒ Object (readonly)
Returns the value of attribute signature.
10 11 12 |
# File 'lib/a2a/agent_card/signature.rb', line 10 def signature @signature end |
Class Method Details
.from_h(hash) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/a2a/agent_card/signature.rb', line 18 def self.from_h(hash) new( protected_header: hash.fetch("protected"), signature: hash.fetch("signature"), header: hash["header"] ) end |
Instance Method Details
#to_h ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/a2a/agent_card/signature.rb', line 26 def to_h { "protected" => protected_header, "signature" => signature, "header" => header }.compact end |