Documentation ¶
Overview ¶
Package cloudkms provides a Google Cloud Key Management Service (KMS) implementation of the crypto.Signer interface.
The documentation for Google Cloud KMS can be found here: https://cloud.google.com/kms/docs
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseHashAlgorithm ¶ added in v0.25.0
func ParseHashAlgorithm(algo kmspb.CryptoKeyVersion_CryptoKeyVersionAlgorithm) crypto.HashAlgorithm
ParseHashAlgorithm returns the `HashAlgorithm` corresponding to the input KMS key type.
func ParseSignatureAlgorithm ¶ added in v0.25.0
func ParseSignatureAlgorithm(algo kmspb.CryptoKeyVersion_CryptoKeyVersionAlgorithm) crypto.SignatureAlgorithm
ParseSignatureAlgorithm returns the `SignatureAlgorithm` corresponding to the input KMS key type.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a client for interacting with the Google Cloud KMS API using types native to the Flow Go SDK.
func (*Client) GetPublicKey ¶
func (c *Client) GetPublicKey(ctx context.Context, key Key) (crypto.PublicKey, crypto.HashAlgorithm, error)
GetPublicKey fetches the public key portion of a KMS asymmetric signing key version.
KMS keys of the type `CryptoKeyVersion_EC_SIGN_P256_SHA256` and `CryptoKeyVersion_EC_SIGN_SECP256K1_SHA256` are the only keys supported by the SDK.
func (*Client) KMSClient ¶ added in v0.25.0
func (c *Client) KMSClient() *kms.KeyManagementClient
KMSClient gives access to the KeyManagementClient, e.g. for closing the connection to the Google KMS API
type Key ¶
type Key struct { ProjectID string `json:"projectId"` LocationID string `json:"locationId"` KeyRingID string `json:"keyRingId"` KeyID string `json:"keyId"` KeyVersion string `json:"keyVersion"` }
Key is a reference to a Google Cloud KMS asymmetric signing key version.
Ref: https://cloud.google.com/kms/docs/creating-asymmetric-keys#create_an_asymmetric_signing_key
func KeyFromResourceID ¶
KeyFromResourceID returns a `Key` from a resource ID.
func (Key) ResourceID ¶
ResourceID returns the resource ID for this KMS key version.