crypto

package
v0.0.48 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterDecryptor

func RegisterDecryptor(decryptor Decryptor)

RegisterDecryptor 注册解密器

func RegisterEncryptor

func RegisterEncryptor(encryptor Encryptor)

RegisterEncryptor 注册加密器

func RegisterSigner

func RegisterSigner(signer Signer)

RegisterSigner 注册签名器

func RegisterVerifier

func RegisterVerifier(verifier Verifier)

RegisterVerifier 注册验签器

Types

type Decryptor

type Decryptor interface {
	// Name 名称
	Name() string
	// Decrypt 解密
	Decrypt(data []byte) ([]byte, error)
}

func InvokeDecryptor

func InvokeDecryptor(name string) Decryptor

InvokeDecryptor 调用解密器

type Encryptor

type Encryptor interface {
	// Name 名称
	Name() string
	// Encrypt 加密
	Encrypt(data []byte) ([]byte, error)
}

func InvokeEncryptor

func InvokeEncryptor(name string) Encryptor

InvokeEncryptor 调用加密器

type Signer

type Signer interface {
	// Name 名称
	Name() string
	// Sign 签名
	Sign(data []byte) ([]byte, error)
}

func InvokeSigner

func InvokeSigner(name string) Signer

InvokeSigner 调用签名器

type Verifier

type Verifier interface {
	// Name 名称
	Name() string
	// Verify 验签
	Verify(data []byte, signature []byte) (bool, error)
}

func InvokeVerifier

func InvokeVerifier(name string) Verifier

InvokeVerifier 调用验签器

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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