tencentcloudkms

package
v0.0.0-...-8ad0a2a Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MODE_DIGEST = "DIGEST"
	MODE_RAW    = "RAW"

	KEY_TYPE_SM2_SIGNATURE = "ASYMMETRIC_SIGN_VERIFY_SM2"

	ALGORITHM_TYPE_SM2_SIGNATURE = "SM2DSA"
)

Variables

This section is empty.

Functions

func CreateConnection

func CreateConnection(kmsConfig *KMSConfig) (*kms.Client, error)

func ExportPublicKeyFromKMS

func ExportPublicKeyFromKMS(keyId string, client *kms.Client) (bccrypto.PublicKey, error)

func GenerateKeyPairFromKMS

func GenerateKeyPairFromKMS(client *kms.Client, keyAlias, keyType string) (bccrypto.PrivateKey, error)

func LoadPrivateKey

func LoadPrivateKey(client *kms.Client, skInfo []byte) (bccrypto.PrivateKey, error)

func NewPrivateKey

func NewPrivateKey(client *kms.Client, keyConfig *KMSPrivateKeyConfig) (bccrypto.PrivateKey, error)

Types

type KMSConfig

type KMSConfig struct {
	SecretId      string
	SecretKey     string
	ServerAddress string
	ServerRegion  string
}

type KMSPrivateKeyConfig

type KMSPrivateKeyConfig struct {
	KeyType  string
	KeyId    string
	KeyAlias string
}

type PrivateKey

type PrivateKey struct {
	// contains filtered or unexported fields
}

func (*PrivateKey) Bytes

func (sk *PrivateKey) Bytes() ([]byte, error)

func (*PrivateKey) PublicKey

func (sk *PrivateKey) PublicKey() bccrypto.PublicKey

func (*PrivateKey) Sign

func (sk *PrivateKey) Sign(data []byte) ([]byte, error)

func (*PrivateKey) SignWithOpts

func (sk *PrivateKey) SignWithOpts(msg []byte, opts *bccrypto.SignOpts) ([]byte, error)

func (*PrivateKey) String

func (sk *PrivateKey) String() (string, error)

func (*PrivateKey) ToStandardKey

func (sk *PrivateKey) ToStandardKey() crypto.PrivateKey

func (*PrivateKey) Type

func (sk *PrivateKey) Type() bccrypto.KeyType

type Signer

type Signer struct {
	// contains filtered or unexported fields
}

func (*Signer) Public

func (signer *Signer) Public() crypto.PublicKey

func (*Signer) Sign

func (signer *Signer) Sign(rand io.Reader, digest []byte, opts crypto.SignerOpts) (signature []byte, err error)

Jump to

Keyboard shortcuts

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