encryption

package
v0.0.0-...-9ca1d99 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2025 License: Unlicense Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CipherType

type CipherType struct {
	// contains filtered or unexported fields
}

func (CipherType) MarshalText

func (ct CipherType) MarshalText() ([]byte, error)

func (*CipherType) UnmarshalText

func (ct *CipherType) UnmarshalText(text []byte) error

type Content

type Content struct {
	CipherType CipherType `json:"cipherType"`
	DigestType DigestType `json:"digestType"`
	IV         []byte     `json:"iv"`
	Digest     []byte     `json:"digest"`
	Content    []byte     `json:"content"`
}

func EncryptContent

func EncryptContent(key []byte, content []byte) (Content, error)

func (*Content) Decrypt

func (c *Content) Decrypt(key []byte) ([]byte, error)

type DecryptedMessage

type DecryptedMessage struct {
	Message Message

	Content []byte
	// contains filtered or unexported fields
}

func NewDecryptedMessage

func NewDecryptedMessage(passphrase []byte) (DecryptedMessage, error)

func (*DecryptedMessage) WithContent

func (dm *DecryptedMessage) WithContent(content []byte) (DecryptedMessage, error)

type DigestType

type DigestType struct {
	// contains filtered or unexported fields
}

func (DigestType) MarshalText

func (dt DigestType) MarshalText() ([]byte, error)

func (*DigestType) UnmarshalText

func (dt *DigestType) UnmarshalText(text []byte) error

type Key

type Key struct {
	Label   KeyLabel `json:"label"`
	Content Content  `json:"content"`
}

type KeyLabel

type KeyLabel struct {
	Value KeyLabelImpl
}

func (KeyLabel) MarshalText

func (l KeyLabel) MarshalText() ([]byte, error)

func (*KeyLabel) UnmarshalText

func (l *KeyLabel) UnmarshalText(text []byte) error

type KeyLabelBiometric

type KeyLabelBiometric struct {
	// contains filtered or unexported fields
}

func (KeyLabelBiometric) MarshalText

func (l KeyLabelBiometric) MarshalText() ([]byte, error)

func (*KeyLabelBiometric) UnmarshalText

func (l *KeyLabelBiometric) UnmarshalText(text []byte) error

type KeyLabelImpl

type KeyLabelImpl interface {
	encoding.TextMarshaler
	encoding.TextUnmarshaler
	// contains filtered or unexported methods
}

type KeyLabelPassphrase

type KeyLabelPassphrase struct {
	// contains filtered or unexported fields
}

func NewKeyLabelPassphrase

func NewKeyLabelPassphrase() KeyLabelPassphrase

func (*KeyLabelPassphrase) Digest

func (l *KeyLabelPassphrase) Digest(passphrase []byte) ([]byte, error)

func (KeyLabelPassphrase) MarshalText

func (l KeyLabelPassphrase) MarshalText() ([]byte, error)

func (*KeyLabelPassphrase) UnmarshalText

func (l *KeyLabelPassphrase) UnmarshalText(text []byte) error

type Message

type Message struct {
	Keys    []Key   `json:"keys"`
	Content Content `json:"content"`
}

func (*Message) Decrypt

func (m *Message) Decrypt(key Key, keyValue []byte) (DecryptedMessage, error)

func (*Message) DecryptPassphrase

func (m *Message) DecryptPassphrase(passphrase []byte) (DecryptedMessage, error)

func (*Message) WithContent

func (m *Message) WithContent(content Content) Message

Jump to

Keyboard shortcuts

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