I followed the Spring Cloud GCP documentation to import credentials with spring.cloud.gcp.credentials.encoded-key
and I tried to call KeyManagementServiceClient.asymmetricSign
to sign some data
but there's an error that happens:
com.google.api.gax.rpc.PermissionDeniedException: io.grpc.StatusRuntimeException: PERMISSION_DENIED: Permission 'cloudkms.cryptoKeyVersions.useToSign' denied on resource 'projects/xxx/locations/xxx/keyRings/xxx/cryptoKeys/xxx' (or it may not exist).
I'm pretty sure the credentials and KMS key are OK.
When I use GOOGLE_APPLICATION_CREDENTIALS
with JSON path to import the credentials, everything is fine.
But it fails when I change the implementation to use Spring Cloud GCP Core to import the credentials.
For some reason, I must have to use GCP Core to import the credentials.