crypto

package
v1.28.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt added in v1.20.0

func Decrypt(key Decrypter, data []byte) ([]byte, error)

func DecryptString added in v1.20.0

func DecryptString(key Decrypter, data string) (string, error)

func Encrypt added in v1.20.0

func Encrypt(key Encrypter, data []byte) ([]byte, error)

func EncryptString added in v1.20.0

func EncryptString(key Encrypter, data string) (string, error)

func Sign

func Sign(key Signer, data []byte) ([]byte, error)

func SignString

func SignString(key Signer, data string) (string, error)

func VerifySignature

func VerifySignature(key Verifier, data []byte, sig []byte) bool

func VerifySignatureString

func VerifySignatureString(key Verifier, data string, sig string) bool

Types

type Decrypter added in v1.20.0

type Decrypter interface {
	Decrypt(data []byte) ([]byte, error)
	DecryptString(data string) (string, error)
}

type Encrypter added in v1.20.0

type Encrypter interface {
	Encrypt(data []byte) ([]byte, error)
	EncryptString(data string) (string, error)
}

type Key

type Key interface {
	Signer
	Verifier

	PublicKeyString() string
	PrivateKeyString() string
}

type Signer

type Signer interface {
	Sign(data []byte) ([]byte, error)
	SignString(data string) (string, error)
}

type SymmetricKey added in v1.20.0

type SymmetricKey interface {
	Encrypter
	Decrypter

	Key() []byte
	KeyString() string
}

type Verifier

type Verifier interface {
	VerifySignature(data []byte, sig []byte) bool
	VerifySignatureString(data string, sig string) bool
}

Directories

Path Synopsis
aes

Jump to

Keyboard shortcuts

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