bgkey

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 11, 2023 License: BSD-3-Clause Imports: 8 Imported by: 4

Documentation

Index

Constants

View Source
const StructureIDManifest = "__KEYM__"

StructureIDManifest is the StructureID (in terms of the document #575623) of element 'Manifest'.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manifest

type Manifest struct {
	bg.StructInfo   `id:"__KEYM__" version:"0x10"`
	KMVersion       uint8            `json:"kmVersion"`
	KMSVN           bg.SVN           `json:"kmSVN"`
	KMID            uint8            `json:"kmID"`
	BPKey           bg.HashStructure `json:"kmBPKey"`
	KeyAndSignature bg.KeySignature  `json:"kmKeySignature"`
}

PrettyString: BG Key Manifest

func NewManifest

func NewManifest() *Manifest

NewManifest returns a new instance of Manifest with all default values set.

func (*Manifest) BPKeyOffset

func (s *Manifest) BPKeyOffset() uint64

BPKeyOffset returns the offset in bytes of field BPKey

func (*Manifest) BPKeyTotalSize

func (s *Manifest) BPKeyTotalSize() uint64

BPKeySize returns the size in bytes of the value of field BPKey

func (*Manifest) GetStructInfo

func (s *Manifest) GetStructInfo() bg.StructInfo

GetStructInfo returns current value of StructInfo of the structure.

StructInfo is a set of standard fields with presented in any element ("element" in terms of document #575623).

func (*Manifest) KMIDOffset

func (s *Manifest) KMIDOffset() uint64

KMIDOffset returns the offset in bytes of field KMID

func (*Manifest) KMIDTotalSize

func (s *Manifest) KMIDTotalSize() uint64

KMIDSize returns the size in bytes of the value of field KMID

func (*Manifest) KMSVNOffset

func (s *Manifest) KMSVNOffset() uint64

KMSVNOffset returns the offset in bytes of field KMSVN

func (*Manifest) KMSVNTotalSize

func (s *Manifest) KMSVNTotalSize() uint64

KMSVNSize returns the size in bytes of the value of field KMSVN

func (*Manifest) KMVersionOffset

func (s *Manifest) KMVersionOffset() uint64

KMVersionOffset returns the offset in bytes of field KMVersion

func (*Manifest) KMVersionTotalSize

func (s *Manifest) KMVersionTotalSize() uint64

KMVersionSize returns the size in bytes of the value of field KMVersion

func (*Manifest) KeyAndSignatureOffset

func (s *Manifest) KeyAndSignatureOffset() uint64

KeyAndSignatureOffset returns the offset in bytes of field KeyAndSignature

func (*Manifest) KeyAndSignatureTotalSize

func (s *Manifest) KeyAndSignatureTotalSize() uint64

KeyAndSignatureSize returns the size in bytes of the value of field KeyAndSignature

func (*Manifest) PrettyString

func (s *Manifest) PrettyString(depth uint, withHeader bool, opts ...pretty.Option) string

PrettyString returns the content of the structure in an easy-to-read format.

func (*Manifest) Print

func (m *Manifest) Print()

Print prints the Key Manifest.

func (*Manifest) ReadDataFrom

func (s *Manifest) ReadDataFrom(r io.Reader) (int64, error)

ReadDataFrom reads the Manifest from 'r' excluding StructInfo, in format defined in the document #575623.

func (*Manifest) ReadFrom

func (s *Manifest) ReadFrom(r io.Reader) (int64, error)

ReadFrom reads the Manifest from 'r' in format defined in the document #575623.

func (*Manifest) Rehash

func (s *Manifest) Rehash()

Rehash sets values which are calculated automatically depending on the rest data. It is usually about the total size field of an element.

func (*Manifest) RehashRecursive

func (s *Manifest) RehashRecursive()

RehashRecursive calls Rehash (see below) recursively.

func (*Manifest) SetSignature

func (m *Manifest) SetSignature(
	algo bg.Algorithm,
	privKey crypto.Signer,
	signedData []byte,
) error

func (*Manifest) SetStructInfo

func (s *Manifest) SetStructInfo(newStructInfo bg.StructInfo)

SetStructInfo sets new value of StructInfo to the structure.

StructInfo is a set of standard fields with presented in any element ("element" in terms of document #575623).

func (*Manifest) StructInfoOffset

func (s *Manifest) StructInfoOffset() uint64

StructInfoOffset returns the offset in bytes of field StructInfo

func (*Manifest) StructInfoTotalSize

func (s *Manifest) StructInfoTotalSize() uint64

StructInfoSize returns the size in bytes of the value of field StructInfo

func (*Manifest) TotalSize

func (s *Manifest) TotalSize() uint64

Size returns the total size of the Manifest.

func (*Manifest) Validate

func (s *Manifest) Validate() error

Validate (recursively) checks the structure if there are any unexpected values. It returns an error if so.

func (*Manifest) ValidateBPMKey

func (m *Manifest) ValidateBPMKey(bpmKS bg.KeySignature) error

func (*Manifest) WriteTo

func (s *Manifest) WriteTo(w io.Writer) (int64, error)

WriteTo writes the Manifest into 'w' in format defined in the document #575623.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL