Class: Melos::Struct::GroupInfo

Inherits:
Base
  • Object
show all
Defined in:
lib/melos/struct/structs.rb

Overview

12.4.3

Constant Summary collapse

STRUCT =
[
  [:group_context, :class, Melos::Struct::GroupContext],
  [:extensions, :classes, Melos::Struct::Extension],
  [:confirmation_tag, :vec], # MAC = opaque <V>
  [:signer, :uint32],
  [:signature, :vec]
]

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#deserialize_select_elem_with_context, #initialize, #raw

Constructor Details

This class inherits a constructor from Melos::Struct::Base

Instance Attribute Details

#confirmation_tagObject (readonly)

Returns the value of attribute confirmation_tag.



479
480
481
# File 'lib/melos/struct/structs.rb', line 479

def confirmation_tag
  @confirmation_tag
end

#extensionsObject (readonly)

Returns the value of attribute extensions.



479
480
481
# File 'lib/melos/struct/structs.rb', line 479

def extensions
  @extensions
end

#group_contextObject (readonly)

Returns the value of attribute group_context.



479
480
481
# File 'lib/melos/struct/structs.rb', line 479

def group_context
  @group_context
end

#signatureObject (readonly)

Returns the value of attribute signature.



479
480
481
# File 'lib/melos/struct/structs.rb', line 479

def signature
  @signature
end

#signerObject (readonly)

Returns the value of attribute signer.



479
480
481
# File 'lib/melos/struct/structs.rb', line 479

def signer
  @signer
end

Instance Method Details

#group_info_tbsObject



488
489
490
491
492
493
494
495
# File 'lib/melos/struct/structs.rb', line 488

def group_info_tbs
  Melos::Struct::GroupInfoTBS.create(
    group_context:,
    extensions:,
    confirmation_tag:,
    signer:
  )
end

#sign(suite, signer_private) ⇒ Object



497
498
499
# File 'lib/melos/struct/structs.rb', line 497

def sign(suite, signer_private)
  Melos::Crypto.sign_with_label(suite, signer_private_key, "GroupInfoTBS", group_info_tbs.raw)
end

#verify(suite, signer_public_key) ⇒ Object



501
502
503
# File 'lib/melos/struct/structs.rb', line 501

def verify(suite, signer_public_key)
  Melos::Crypto.verify_with_label(suite, signer_public_key, "GroupInfoTBS", group_info_tbs.raw, signature)
end