Documentation ¶
Index ¶
Constants ¶
const Scheme = "awskms"
Scheme is the scheme used in uris.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KMS ¶
type KMS struct {
// contains filtered or unexported fields
}
KMS implements a KMS using AWS Key Management Service.
func New ¶
New creates a new AWSKMS. By default, sessions will be created using the credentials in `~/.aws/credentials`, but this can be overridden using the CredentialsFile option, the Region and Profile can also be configured as options.
AWS sessions can also be configured with environment variables, see docs at https://docs.aws.amazon.com/sdk-for-go/api/aws/session/ for all the options.
func (*KMS) CreateKey ¶
func (k *KMS) CreateKey(req *apiv1.CreateKeyRequest) (*apiv1.CreateKeyResponse, error)
CreateKey generates a new key in KMS and returns the public key version of it.
func (*KMS) CreateSigner ¶
CreateSigner creates a new crypto.Signer with a previously configured key.
func (*KMS) GetPublicKey ¶
GetPublicKey returns a public key from KMS.
type KeyManagementClient ¶
type KeyManagementClient interface { GetPublicKeyWithContext(ctx aws.Context, input *kms.GetPublicKeyInput, opts ...request.Option) (*kms.GetPublicKeyOutput, error) CreateKeyWithContext(ctx aws.Context, input *kms.CreateKeyInput, opts ...request.Option) (*kms.CreateKeyOutput, error) CreateAliasWithContext(ctx aws.Context, input *kms.CreateAliasInput, opts ...request.Option) (*kms.CreateAliasOutput, error) SignWithContext(ctx aws.Context, input *kms.SignInput, opts ...request.Option) (*kms.SignOutput, error) }
KeyManagementClient defines the methods on KeyManagementClient that this package will use. This interface will be used for unit testing.
type Signer ¶
type Signer struct {
// contains filtered or unexported fields
}
Signer implements a crypto.Signer using the AWS KMS.
func NewSigner ¶
func NewSigner(svc KeyManagementClient, signingKey string) (*Signer, error)
NewSigner creates a new signer using a key in the AWS KMS.