Documentation
¶
Index ¶
- Variables
- func BytesToPrivKey(b []byte) (*sm2.PrivateKey, error)
- func BytesToPubKey(b []byte) (*sm2.PublicKey, error)
- func Decrypt(priv *sm2.PrivateKey, cipherBytes []byte) ([]byte, error)
- func Encrypt(pub *sm2.PublicKey, plainBytes []byte) ([]byte, error)
- func GenerateKeyPair() (*sm2.PrivateKey, *sm2.PublicKey, error)
- func GenerateKeyPairWithSeed(seed []byte) (*sm2.PrivateKey, *sm2.PublicKey, error)
- func PrivKeyToBytes(priv *sm2.PrivateKey) []byte
- func PubKeyToBytes(pub *sm2.PublicKey) []byte
- func RawBytesToPubKey(b []byte) (*sm2.PublicKey, error)
- func RetrievePubKey(priv *sm2.PrivateKey) *sm2.PublicKey
- func Sign(priv *sm2.PrivateKey, plainBytes []byte) ([]byte, error)
- func Verify(pub *sm2.PublicKey, plainBytes, cipherBytes []byte) bool
Constants ¶
This section is empty.
Variables ¶
View Source
var DEFAULT_UID = []byte("1234567812345678")
Functions ¶
func BytesToPrivKey ¶
func BytesToPrivKey(b []byte) (*sm2.PrivateKey, error)
func GenerateKeyPair ¶
func GenerateKeyPair() (*sm2.PrivateKey, *sm2.PublicKey, error)
func GenerateKeyPairWithSeed ¶
func PrivKeyToBytes ¶
func PrivKeyToBytes(priv *sm2.PrivateKey) []byte
func PubKeyToBytes ¶
func RetrievePubKey ¶
func RetrievePubKey(priv *sm2.PrivateKey) *sm2.PublicKey
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.