|
|
@@ -141,6 +141,17 @@ func (k *CloudKMS) CreateSigner(req *apiv1.CreateSignerRequest) (crypto.Signer,
|
|
|
return nil, errors.New("signing key cannot be empty")
|
|
|
}
|
|
|
|
|
|
+ // Validate that the key exists
|
|
|
+ ctx, cancel := defaultContext()
|
|
|
+ defer cancel()
|
|
|
+
|
|
|
+ _, err := k.client.GetPublicKey(ctx, &kmspb.GetPublicKeyRequest{
|
|
|
+ Name: req.SigningKey,
|
|
|
+ })
|
|
|
+ if err != nil {
|
|
|
+ return nil, errors.Wrap(err, "cloudKMS GetPublicKey failed")
|
|
|
+ }
|
|
|
+
|
|
|
return NewSigner(k.client, req.SigningKey), nil
|
|
|
}
|
|
|
|