Class: Melos::Struct::KeyPackage

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

Overview

10

Constant Summary collapse

STRUCT =
[
  [:version, :uint16],
  [:cipher_suite, :uint16],
  [:init_key, :vec], # HPKEPublicKey
  [:leaf_node, :class, Melos::Struct::LeafNode],
  [:extensions, :classes, Melos::Struct::Extension],
  [:signature, :vec] # SignWithLabel(., "KeyPackageTBS", KeyPackageTBS)
]

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

#cipher_suiteObject (readonly)

Returns the value of attribute cipher_suite.



334
335
336
# File 'lib/melos/struct/structs.rb', line 334

def cipher_suite
  @cipher_suite
end

#extensionsObject (readonly)

Returns the value of attribute extensions.



334
335
336
# File 'lib/melos/struct/structs.rb', line 334

def extensions
  @extensions
end

#init_keyObject (readonly)

Returns the value of attribute init_key.



334
335
336
# File 'lib/melos/struct/structs.rb', line 334

def init_key
  @init_key
end

#leaf_nodeObject (readonly)

Returns the value of attribute leaf_node.



334
335
336
# File 'lib/melos/struct/structs.rb', line 334

def leaf_node
  @leaf_node
end

#signatureObject (readonly)

Returns the value of attribute signature.



334
335
336
# File 'lib/melos/struct/structs.rb', line 334

def signature
  @signature
end

#versionObject (readonly)

Returns the value of attribute version.



334
335
336
# File 'lib/melos/struct/structs.rb', line 334

def version
  @version
end

Instance Method Details

#ref(suite) ⇒ Object



344
345
346
# File 'lib/melos/struct/structs.rb', line 344

def ref(suite)
  Melos::Crypto.make_keypackage_ref(suite, self.raw)
end