I have set the key rotation duration to 1 day in my google service account and I want to decrypt the older ciphertext with the latest generated key. But how can I get the latest key details? Please help here.
If you have a ciphertext encrypted with KMS and pass it to the Decrypt API for the appropriate key, the correct key version is embedded inside the ciphertext data structure, so KMS will automatically use the appropriate key material for decryption, if that key version is still available. You don't need to keep track of the version for decryption to work.