コード例 #1
0
        public async Task <string> Decrypt(string encryptedData, string serviceAccountId)
        {
            var safeId        = KeyIdCreator.Create(serviceAccountId);
            var cryptoKeyName =
                new CryptoKeyName(mProjectName, mKeyringLocation, mKeyringName, safeId);
            var result =
                await mKmsService.DecryptAsync(
                    cryptoKeyName,
                    ByteString.FromBase64(encryptedData));

            return(result.Plaintext.ToBase64());
        }