asym

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2021 License: Apache-2.0 Imports: 25 Imported by: 28

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateEncKeyPair

func GenerateEncKeyPair(keyType crypto.KeyType) (crypto.DecryptKey, error)

Generate public-private key pair for encryption

func GenerateKeyPair

func GenerateKeyPair(keyType crypto.KeyType) (crypto.PrivateKey, error)

生成签名公私钥对

func GenerateKeyPairBytes

func GenerateKeyPairBytes(keyType crypto.KeyType) (sk, pk []byte, err error)

func GenerateKeyPairPEM

func GenerateKeyPairPEM(keyType crypto.KeyType) (sk string, pk string, err error)

func ParsePrivateKey

func ParsePrivateKey(der []byte) (crypto2.PrivateKey, error)

ParsePrivateKey parse bytes to a private key.

func ParsePublicKey

func ParsePublicKey(der []byte) (crypto2.PublicKey, error)

func ParseSM2PublicKey

func ParseSM2PublicKey(asn1Data []byte) (*tjsm2.PublicKey, error)

func PrivateKeyFromDER

func PrivateKeyFromDER(der []byte) (crypto.PrivateKey, error)

func PrivateKeyFromPEM

func PrivateKeyFromPEM(raw []byte, pwd []byte) (crypto.PrivateKey, error)

func PublicKeyFromDER

func PublicKeyFromDER(der []byte) (crypto.PublicKey, error)

func PublicKeyFromPEM

func PublicKeyFromPEM(raw []byte) (crypto.PublicKey, error)

func Sign

func Sign(sk interface{}, data []byte) ([]byte, error)

func Verify

func Verify(pk interface{}, data, sig []byte) (bool, error)

func WriteFile

func WriteFile(keyType crypto.KeyType, filePath string) error

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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