Documentation
¶
Overview ¶
Package gcp implements a signer.Signer backed by Google Cloud KMS. It delegates signing to a remote KMS key and caches the public key locally.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KMSClient ¶
type KMSClient interface {
AsymmetricSign(ctx context.Context, req *kmspb.AsymmetricSignRequest) (*kmspb.AsymmetricSignResponse, error)
GetPublicKey(ctx context.Context, req *kmspb.GetPublicKeyRequest) (*kmspb.PublicKey, error)
}
KMSClient is the subset of the Google Cloud KMS client API that KmsSigner needs. This allows mocking in tests.
type KmsSigner ¶
type KmsSigner struct {
// contains filtered or unexported fields
}
KmsSigner implements the signer.Signer interface using Google Cloud KMS.
func NewKmsSigner ¶
NewKmsSigner creates a new Signer backed by a Google Cloud KMS Ed25519 key version. It uses Application Default Credentials unless opts.CredentialsFile is provided.
func (*KmsSigner) GetAddress ¶
GetAddress returns the cached address derived from the public key.
type Options ¶
type Options struct {
// CredentialsFile is an optional path to a Google credentials JSON file.
// If empty, Application Default Credentials are used.
CredentialsFile string
// Timeout for individual KMS Sign API calls. Default: 1s.
Timeout time.Duration
// MaxRetries for transient KMS failures during Sign. Default: 3.
MaxRetries int
}
Options configures optional KmsSigner behavior.
Click to show internal directories.
Click to hide internal directories.