protocol

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IProtocol

type IProtocol interface {
	GetKey() []byte
	GetIV() []byte
	GetMessage() []byte
	GetVersion() []byte
	GetVersionString() string
	ToByteArray() []byte
	ToBase64() string
	IsVersionValid() bool
}

IProtocol represents a protocol interface.

func CreateProtocol

func CreateProtocol(key, iv, message []byte) (IProtocol, error)

CreateProtocol creates a new protocol instance with the given key, iv, and message. If the key is not provided, a random key will be generated. If the iv is not provided, a random iv will be generated. An error is returned if the key or iv length is invalid.

func ImportProtocol

func ImportProtocol(data []byte) (IProtocol, error)

ImportProtocol is a function that imports a protocol from the given data.

func ImportProtocolBase64

func ImportProtocolBase64(data string) (IProtocol, error)

ImportProtocolBase64 decodes a base64-encoded string and imports the protocol. It returns the imported protocol and any error encountered during decoding or importing.

Jump to

Keyboard shortcuts

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