Documentation ¶
Index ¶
- func GenerateEncKeyPair(keyType crypto.KeyType) (crypto.DecryptKey, error)
- func GenerateKeyPair(keyType crypto.KeyType) (crypto.PrivateKey, error)
- func GenerateKeyPairBytes(keyType crypto.KeyType) (sk, pk []byte, err error)
- func GenerateKeyPairPEM(keyType crypto.KeyType) (sk string, pk string, err error)
- func ParsePrivateKey(der []byte) (crypto2.PrivateKey, error)
- func ParsePublicKey(der []byte) (crypto2.PublicKey, error)
- func ParseSM2PublicKey(asn1Data []byte) (*sm2.PublicKey, error)
- func PrivateKeyFromDER(der []byte) (crypto.PrivateKey, error)
- func PrivateKeyFromPEM(raw []byte, pwd []byte) (crypto.PrivateKey, error)
- func PublicKeyFromDER(der []byte) (crypto.PublicKey, error)
- func PublicKeyFromPEM(raw []byte) (crypto.PublicKey, error)
- func Sign(sk interface{}, data []byte) ([]byte, error)
- func Verify(pk interface{}, data, sig []byte) (bool, error)
- func WriteFile(keyType crypto.KeyType, filePath string) error
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 GenerateKeyPairPEM ¶
func ParsePrivateKey ¶
func ParsePrivateKey(der []byte) (crypto2.PrivateKey, error)
ParsePrivateKey parse bytes to a private key.
func PrivateKeyFromDER ¶
func PrivateKeyFromDER(der []byte) (crypto.PrivateKey, error)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.