format

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BodyFrame added in v0.3.0

type BodyFrame interface {
	Serializable
	IsFinal() bool
	SequenceNumber() int
	IV() []byte
	EncryptedContent() []byte
	AuthenticationTag() []byte
}

type Deserializer added in v0.3.0

type Deserializer interface {
	DeserializeHeader(buf *bytes.Buffer, maxEncryptedDataKeys int) (MessageHeader, MessageHeaderAuth, error)
	DeserializeBody(buf *bytes.Buffer, algorithm *suite.AlgorithmSuite, frameLen int) (MessageBody, error)
	DeserializeFooter(alg *suite.AlgorithmSuite, buf *bytes.Buffer) (MessageFooter, error)
}

type HeaderParams added in v0.3.0

type HeaderParams struct {
	AlgorithmSuite     *suite.AlgorithmSuite
	MessageID          []byte
	EncryptionContext  suite.EncryptionContext
	EncryptedDataKeys  []MessageEDK
	ContentType        suite.ContentType
	FrameLength        int
	AlgorithmSuiteData []byte
}

type MessageAAD

type MessageAAD interface {
	Serializable
	EncryptionContext() suite.EncryptionContext
}

type MessageBody added in v0.3.0

type MessageBody interface {
	Serializable
	Frames() []BodyFrame
	AddFrame(final bool, seqNum int, IV []byte, contentLength int, ciphertext, authTag []byte) error
}

type MessageEDK

type MessageEDK interface {
	Serializable
	ProviderID() string
	ProviderInfo() string
	EncryptedDataKey() []byte
}

type MessageFooter added in v0.3.0

type MessageFooter interface {
	Serializable
	SignLen() int
	Signature() []byte
}

type MessageHeader

type MessageHeader interface {
	Serializable

	Type() suite.MessageType    // present only in V1
	Reserved() []byte           // present only in V1
	IVLength() int              // present only in V1
	AlgorithmSuiteData() []byte // present only in V2
	// contains filtered or unexported methods
}

type MessageHeaderAuth

type MessageHeaderAuth interface {
	Serializable
	AuthData() []byte
	IV() []byte // present only in V1
}

type Serializable

type Serializable interface {
	Len() int
	Bytes() []byte
}

type Serializer added in v0.3.0

type Serializer interface {
	SerializeHeader(p HeaderParams) (MessageHeader, error)
	SerializeHeaderAuth(v suite.MessageFormatVersion, iv, authData []byte) (MessageHeaderAuth, error)
	SerializeBody(alg *suite.AlgorithmSuite, frameLength int) (MessageBody, error)
	SerializeFooter(alg *suite.AlgorithmSuite, signature []byte) (MessageFooter, error)
}

Jump to

Keyboard shortcuts

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