Versions in this module Expand all Collapse all v1 v1.0.0 Jan 21, 2025 Changes in this version + var ErrInvalidSigningAlgorithmError = errors.New("invalid signing algorithm choice") + var ErrKeyNotEncryptDecryptError = errors.New("key usage is not ENCRYPT_DECRYPT") + var ErrKeyNotSignVerifyError = errors.New("key usage is not SIGN_VERIFY") + var ErrNoAwsClientError = errors.New("no aws client initialized, use WithAwsConfig or WithAwsClient") + var ErrUnsupportedDecryptionError = errors.New("unsupported decryption options") + func NewRandom(ctx context.Context, optFns ...OptionFunc) (io.Reader, error) + type Key struct + func NewKey(ctx context.Context, keyArn string, opts ...OptionFunc) (*Key, error) + func (k *Key) Decrypt(_ io.Reader, msg []byte, opts crypto.DecrypterOpts) ([]byte, error) + func (k *Key) Encrypt(hsh hash.Hash, rand io.Reader, msg []byte) ([]byte, error) + func (k *Key) Equal(x crypto.PrivateKey) bool + func (k *Key) KeyARN() string + func (k *Key) KeySpec() kmsTypes.KeySpec + func (k *Key) Public() crypto.PublicKey + func (k *Key) Sign(_ io.Reader, digest []byte, opts crypto.SignerOpts) ([]byte, error) + func (k *Key) SubjectPublicKeyInfo() []byte + type OptionFunc = func(*kcsOption) error + func WithAwsClient(client kmsClienter) OptionFunc + func WithAwsConfig(cfg aws.Config, fns ...func(*kms.Options)) OptionFunc + func WithCustomKeyStoreId(v string) OptionFunc + func WithGrantTokens(tokens []string) OptionFunc + func WithMaxConcurrency(conc int) OptionFunc + func WithSigningAlgorithm(alg kmsTypes.SigningAlgorithmSpec) OptionFunc