Documentation ¶
Overview ¶
nolint
nolint
Index ¶
- func MarshalECPrivateKey(key *tjsm2.PrivateKey) ([]byte, error)
- func MarshalPKCS8PrivateKey(key interface{}) (der []byte, err error)
- func MarshalPrivateKey(key *tjsm2.PrivateKey, oid asn1.ObjectIdentifier) ([]byte, error)
- func New(keyType crypto.KeyType) (crypto.PrivateKey, error)
- func ParsePKCS8PrivateKey(der []byte) (key interface{}, err error)
- func SM2Sign(priv *tjsm2.PrivateKey, hash []byte) (r, s *big.Int, err error)
- type PrivateKey
- func (sk *PrivateKey) Bytes() ([]byte, error)
- func (sk *PrivateKey) Decrypt(ciphertext []byte) ([]byte, error)
- func (sk *PrivateKey) DecryptWithOpts(ciphertext []byte, opts *crypto.EncOpts) ([]byte, error)
- func (sk *PrivateKey) EncryptKey() crypto.EncryptKey
- func (sk *PrivateKey) PublicKey() crypto.PublicKey
- func (sk *PrivateKey) Sign(digest []byte) ([]byte, error)
- func (sk *PrivateKey) SignWithOpts(msg []byte, opts *crypto.SignOpts) ([]byte, error)
- func (sk *PrivateKey) String() (string, error)
- func (sk *PrivateKey) ToStandardKey() crypto2.PrivateKey
- func (sk *PrivateKey) Type() crypto.KeyType
- type PublicKey
- func (pk *PublicKey) Bytes() ([]byte, error)
- func (pk *PublicKey) Encrypt(data []byte) ([]byte, error)
- func (pk *PublicKey) EncryptWithOpts(data []byte, opts *crypto.EncOpts) ([]byte, error)
- func (pk *PublicKey) String() (string, error)
- func (pk *PublicKey) ToStandardKey() crypto2.PublicKey
- func (pk *PublicKey) Type() crypto.KeyType
- func (pk *PublicKey) Verify(digest []byte, sig []byte) (bool, error)
- func (pk *PublicKey) VerifyWithOpts(msg []byte, sig []byte, opts *crypto.SignOpts) (bool, error)
- type Sig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalECPrivateKey ¶
func MarshalECPrivateKey(key *tjsm2.PrivateKey) ([]byte, error)
MarshalECPrivateKey marshal an ec private key to der encoded
func MarshalPKCS8PrivateKey ¶
MarshalPKCS8PrivateKey marshal a pkcs8 private key to der encoded
func MarshalPrivateKey ¶
func MarshalPrivateKey(key *tjsm2.PrivateKey, oid asn1.ObjectIdentifier) ([]byte, error)
MarshalPrivateKey marshal an ec private key to der encoded with oid
func ParsePKCS8PrivateKey ¶
ParsePKCS8PrivateKey parse der encoded private key to crypto.PrivateKey
Types ¶
type PrivateKey ¶
type PrivateKey struct {
K *tjsm2.PrivateKey
}
func (*PrivateKey) Bytes ¶
func (sk *PrivateKey) Bytes() ([]byte, error)
func (*PrivateKey) Decrypt ¶
func (sk *PrivateKey) Decrypt(ciphertext []byte) ([]byte, error)
func (*PrivateKey) DecryptWithOpts ¶
func (*PrivateKey) EncryptKey ¶
func (sk *PrivateKey) EncryptKey() crypto.EncryptKey
func (*PrivateKey) PublicKey ¶
func (sk *PrivateKey) PublicKey() crypto.PublicKey
func (*PrivateKey) Sign ¶
func (sk *PrivateKey) Sign(digest []byte) ([]byte, error)
func (*PrivateKey) SignWithOpts ¶
func (*PrivateKey) String ¶
func (sk *PrivateKey) String() (string, error)
func (*PrivateKey) ToStandardKey ¶
func (sk *PrivateKey) ToStandardKey() crypto2.PrivateKey
func (*PrivateKey) Type ¶
func (sk *PrivateKey) Type() crypto.KeyType
Click to show internal directories.
Click to hide internal directories.