获取错误消息“解码OAEP填充时发生错误”同时尝试从Azure Table Storage中检索实体 [英] Getting an error message "Error occurred while decoding OAEP padding" while trying to retrieve the entities from Azure Table Storage

查看:445
本文介绍了获取错误消息“解码OAEP填充时发生错误”同时尝试从Azure Table Storage中检索实体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以下列方式加密表:

public TableRequestOptions EncryptTableStorage()
    {
        // Create the IKey used for encryption.
        var key = new RsaKey("mykey");

        var policy = new TableEncryptionPolicy(key, null);

        TableRequestOptions options = new TableRequestOptions()
        {
            EncryptionPolicy = policy
        };


        return options;

    }

我的加密实体

 [EncryptProperty]
 public string ConsumerId { get; set; }

在检索时,我使用以下代码

While retrieving, I am using the following code

var query = new TableQuery<CloudModelDetail>().Where(TableQuery.GenerateFilterCondition("PartitionKey", QueryComparisons.Equal, cloudModelDetail.PartitionKey));
foreach (var entity in azureStorageAccount.VerifyCloudTable.ExecuteQuery(query, azureStorageAccount.EncryptTableStorage()))
{
  Console.WriteLine("{0}, {1}\t{2}\t{3}", entity.PartitionKey, entity.RowKey,
                    entity.ConsumerId, entity.ScoreVariables);
}

我收到一个解密错误的错误。内部异常说解码OAEP填充时发生错误。

I am getting an error saying decryption error. The inner exception says "Error occurred while decoding OAEP padding."

推荐答案

更新:原来这不行;我无意中改变了禁用加密功能的东西。

Update: It turns out this didn't work; I inadvertently changed something that had disabled the encryption.

我正在获得Execute和ExecuteQuerySegmented的异常。对于我来说,解决方案原来是设置密钥的激活日期(以前未设置 - 该复选框未被选中)。

这篇关于获取错误消息“解码OAEP填充时发生错误”同时尝试从Azure Table Storage中检索实体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆