crypto_interface

package
v0.0.0-20240423 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cryptor

type Cryptor interface {
	Encrypt(dest, text []byte, opts ...EncryptOption) (*Packet, error)
	Decrypt(*Packet, ...DecryptOption) ([]byte, error)
}

type DecryptOption

type DecryptOption = option.ApplyOption

type EncryptOption

type EncryptOption = option.ApplyOption

type Marshaler

type Marshaler interface {
	Marshal(*Packet) ([]byte, error)
	Unmarshal([]byte) (*Packet, error)
}

type Packet

type Packet struct {
	Source      []byte `json:"source"`
	Destination []byte `json:"destination"`
	Nonce       []byte `json:"nonce"`
	CipherText  []byte `json:"cipherText"`
	Signature   []byte `json:"signature"`
}

type Signer

type Signer interface {
	Sign(*Packet) error
	Verify(*Packet) error
}

Jump to

Keyboard shortcuts

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