encryption

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AgeEncryption = Encryption("age")
)
View Source
const (
	AgeIdentityProvider = "age"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Encryption

type Encryption string

type Identity

type Identity struct {
	Provider
	Recipient
	PrivateKey
}

type Manager

type Manager interface {
	// GenerateIdentity creates new identity
	GenerateIdentity(encryption Encryption) (Identity, error)
	// PrivateKey returns private key from host
	PrivateKey(key Recipient) (PrivateKey, error)
	EncryptService(encryption Encryption) (Service, error)

	ImportRawIdentity(provider Provider, data []byte) (Identity, error)
	ExportRawIdentity(identity Identity) ([]byte, error)
}

type PrivateKey

type PrivateKey []byte

func (PrivateKey) String

func (k PrivateKey) String() string

type Provider

type Provider string

type Recipient

type Recipient []byte

func (Recipient) String

func (k Recipient) String() string

type Service

type Service interface {
	Encrypt(data []byte, recipients []Recipient) ([]byte, error)
	Decrypt(data []byte, identities []Identity) ([]byte, error)
}

Jump to

Keyboard shortcuts

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