title: System.Security.Cryptography.CryptographicException: 'The key {00000000-0000-0000-0000-000000000000} was not found in the key ring.'
body: <p>I have deployed a <strong>webjob</strong> (.Net 4.6) which encrypts some url strings and sends it to customers via email. I used .NET Core's IDataProtector for the encrpytion and I had to manually reference the DLL since webjob .net 4.6 was not supporting its library.</p>
  
  <p>For example in webjob:</p>
  
  <pre><code>IDataProtector protector = provider.CreateProtector("myProtector")
  http://test.com/Email/Agreement?n=" + protector.Protect(name) + "&amp;a=" + protector.Protect(address)
  </code></pre>
  
  <p>which becomes a link</p>
  
  <pre><code>http://test.com/Email/Agreement?n=CfDJ8AAAAAAAAAAAAAAAAAAAAAD96g09022UwEG-GyVftzkm-n2JuL1hmvL5HLyghXliIgJ_N014EBqBFfWjmdA&amp;a=CfDJ8AAAAAAAAAAAAAAAAAAAAAALoq9IuMBZKozhzH3jRaHpyFE1wtXzQK3T_0RNuX9LsSVxPITWgU9ZR21jXLk3YGjt
  </code></pre>
  
  <p>in the email.</p>
  
  <p>when the customers click on the url link in their email, it would go to my <strong>client application</strong>'s (.Net Core 1.1) controller to decrypt the url string in order to pop up an agreement page. </p>
  
  <p>Ex: </p>
  
  <pre><code>public EmailController(IDataProtectionProvider provider)
  {         
      _protector = provider.CreateProtector("myProtector");
  }
  public IActionResult Agreement(string n, string a)
  {     
      var decryptName = _protector.Unprotect(n);
      var decryptAddress = _protector.Unprotect(a);
  }
  </code></pre>
  
  <p>However, I am getting a following error message when I tried to Unprotect them:</p>
  
  <blockquote>
    <p>System.Security.Cryptography.CryptographicException: 'The key {00000000-0000-0000-0000-000000000000} was not found in the key ring.'</p>
  </blockquote>
  
  <p>When I searched for an answer, I realized I can configure Data Protection to store the keys to Azure Blob Storage. This <a href="https://docs.microsoft.com/en-us/aspnet/core/security/data-protection/implementation/key-storage-providers#azure-and-redis" rel="nofollow noreferrer">link</a> shows me how to persist keys to azure blob storage. </p>
  
  <p>Questions:</p>
  
  <ol>
  <li>What is the best approach other than storing a key to azure blob storage?</li>
  <li>If I am on the right track, how do I store it?</li>
  <li>How do I configure the same setting for the webjob project as shown in the link which does not have Startup.cs for configuration?</li>
  </ol>
  
  <p>Help is much appreciated.</p>