sm

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KMS_RSA_2048 = "RSA_2048"
	KMS_RSA_3072 = "RSA_3072"
	KMS_RSA_4096 = "RSA_4096"
	KMS_EC_P256  = "EC_P256"
	//sign algorithm supported by KMS
	KMS_ALG_RSA_PSS_SHA_256   = "RSA_PSS_SHA_256"
	KMS_ALG_RSA_PKCS1_SHA_256 = "RSA_PKCS1_SHA_256"

	NOTATION_CN    = "notation"
	SignerCertName = "signer.crt"
)

Variables

This section is empty.

Functions

func CertDataOutput added in v0.1.2

func CertDataOutput(certData []byte, dir string) error

CertDataOutput perisist certificate data to file

func GetCertDataFromKey

func GetCertDataFromKey(dkmsClient *dedicatedkmssdk.Client, pub *rsa.PublicKey, keyId string) ([]byte, error)

func GetClientKey

func GetClientKey() string

func GetDkmsClientByClientKeyFile

func GetDkmsClientByClientKeyFile(clientKeyPath, password, endpoint string) (*dedicatedkmssdk.Client, error)

func GetInstanceEndpoint

func GetInstanceEndpoint() string

func GetKMSCAFile

func GetKMSCAFile() string

func GetKMSPassword

func GetKMSPassword() string

func GetKMSRegionId

func GetKMSRegionId() string

func GetPublicKey

func GetPublicKey(client *dedicatedkmssdk.Client, keyId string) (*rsa.PublicKey, error)

func ParseCertificates

func ParseCertificates(keyStr string) ([]*x509.Certificate, error)

func SwitchKeySpec

func SwitchKeySpec(kmsKeySpec string) (plugin.KeySpec, error)

Types

type KmsPrivateKeySigner

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

func (*KmsPrivateKeySigner) Public

func (ks *KmsPrivateKeySigner) Public() crypto.PublicKey

func (*KmsPrivateKeySigner) Sign

func (ks *KmsPrivateKeySigner) 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