Versions in this module Expand all Collapse all v2 v2.3.3 Oct 19, 2023 Changes in this version + func MarshalPrivateKey(key *PrivateKey) ([]byte, error) + func MarshalPublicKey(key *PublicKey) ([]byte, error) + func PrivateKeyDerToPEM(der []byte) (string, error) + func PrivateKeyToPEM(key *PrivateKey) (string, error) + func PublicKeyDerToPEM(der []byte) (string, error) + func PublicKeyToPEM(key *PublicKey) (string, error) + type PrivateKey struct + Pub PublicKey + func GenerateKeyPair() (*PrivateKey, error) + func PrivateKeyFromPEM(skPEM string, pass string) (*PrivateKey, error) + func UnmarshalPrivateKey(der []byte) (*PrivateKey, error) + func UnmarshalPrivateKeyWithCurve(namedCurveOID *asn1.ObjectIdentifier, der []byte) (*PrivateKey, error) + func (sk *PrivateKey) Bytes() ([]byte, error) + func (sk *PrivateKey) Decrypt(ciphertext []byte) ([]byte, error) + func (sk *PrivateKey) DecryptWithOpts(ciphertext []byte, opts *bccrypto.EncOpts) ([]byte, error) + func (sk *PrivateKey) EncryptKey() bccrypto.EncryptKey + func (sk *PrivateKey) PublicKey() bccrypto.PublicKey + func (sk *PrivateKey) Sign(msg []byte) ([]byte, error) + func (sk *PrivateKey) SignWithOpts(msg []byte, opts *bccrypto.SignOpts) ([]byte, error) + func (sk *PrivateKey) String() (string, error) + func (sk *PrivateKey) ToStandardKey() crypto2.PrivateKey + func (sk *PrivateKey) Type() bccrypto.KeyType + type PublicKey struct + func PublicKeyFromPEM(pkPEM string) (*PublicKey, error) + func UnmarshalPublicKey(der []byte) (*PublicKey, error) + func (pk *PublicKey) Bytes() ([]byte, error) + func (pk *PublicKey) CalSM2Digest(uid string, msg []byte) ([]byte, error) + func (pk *PublicKey) Encrypt(plaintext []byte) ([]byte, error) + func (pk *PublicKey) EncryptWithOpts(data []byte, opts *bccrypto.EncOpts) ([]byte, error) + func (pk *PublicKey) String() (string, error) + func (pk *PublicKey) ToStandardKey() crypto.PublicKey + func (pk *PublicKey) Type() bccrypto.KeyType + func (pk *PublicKey) Verify(msg []byte, sig []byte) (bool, error) + func (pk *PublicKey) VerifyWithOpts(msg []byte, sig []byte, opts *bccrypto.SignOpts) (bool, error)