crypto

package
v0.0.0-...-9415ce5 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateSHA1

func CalculateSHA1(data []byte) []byte

func CalculateSHA512

func CalculateSHA512(data []byte) []byte

func CalculateSHA512Str

func CalculateSHA512Str(data []byte) string

func EcdsaSign

func EcdsaSign(data []byte, privateKey string) (string, error)

EcdsaSign Ecdsa 签名

func EcdsaSignRow

func EcdsaSignRow(data []byte, privateKey string) ([]byte, error)

func EcdsaVerify

func EcdsaVerify(data []byte, base64Sig, publicKey string) error

EcdsaVerify 验证 Ecdsa 签名

func EcdsaVerifyRow

func EcdsaVerifyRow(data []byte, sign []byte, publicKey string) error

func RSASign

func RSASign(data []byte, privateKey string) (string, error)

RSASign RSA 签名

func RSAVerify

func RSAVerify(data []byte, base64Sig, publicKey string) error

RSAVerify 验证 RSA 签名

func ReadPrivateKey

func ReadPrivateKey[T any](privateKey string) *T

ReadPrivateKey 读取私钥

func ReadPublicKey

func ReadPublicKey[T any](publicKey string) *T

ReadPublicKey 读取公钥

func ReadSshPublicKey

func ReadSshPublicKey[T any](publicKey string) *T

ReadSshPublicKey 读取 ssh 格式的公钥

func Sha256Checksum

func Sha256Checksum(filename string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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