aspnet/DataProtection

AzureSample uses FileXmlRepository even after PersistKeysToAzureBlobStorage is called

pakrym opened this issue · 0 comments

I verified that it worked as expected in 1.0 release.

Output:

Expected:

dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18]
      Found key {f0146984-4a7a-4a28-bfc0-cd3283e1b1a3}.
dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13]
      Considering key {f0146984-4a7a-4a28-bfc0-cd3283e1b1a3} with expiration date 2017-07-04 17:24:35Z as default key.
dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.CngCbcAuthenticatedEncryptorDescriptor[4]
      Opening CNG algorithm 'AES' from provider '(null)' with chaining mode CBC.
dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.CngCbcAuthenticatedEncryptorDescriptor[3]
      Opening CNG algorithm 'SHA256' from provider '(null)' with HMAC.
dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2]
      Using key {f0146984-4a7a-4a28-bfc0-cd3283e1b1a3} as the default key.
trce: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector[31]
      Performing protect operation to key {f0146984-4a7a-4a28-bfc0-cd3283e1b1a3} with purposes ('sample-purpose').
CfDJ8IRpFPB6SihKv8DNMoPhsaN-ljs8dzZGN6D9MsYXlZesolbDKUgHLzkDaTQ6ppjkx6ke9jity-ZI_XtiXpl0w57yJFghk0Qlq_Wvf-XG-x4c7f8VnOUzDbgUmY4VOumZTA

Actual (note all FileSystemXmlRepository lines)

info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0]
      User profile is available. Using 'C:\Users\pakrym\AppData\Local\ASP.NET\DataProtection-Keys' as key repository and Windows DPAPI to encrypt keys at rest.
dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37]
      Reading data from file 'C:\Users\pakrym\AppData\Local\ASP.NET\DataProtection-Keys\key-0656f71b-d11c-4c2a-b7e3-056b3aff13f4.xml'.
dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37]
      Reading data from file 'C:\Users\pakrym\AppData\Local\ASP.NET\DataProtection-Keys\key-7694830d-b867-4420-b35a-0274f8940deb.xml'.
dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37]
      Reading data from file 'C:\Users\pakrym\AppData\Local\ASP.NET\DataProtection-Keys\key-b7dfc96e-5d3c-4d65-bb8d-0dd0c181e190.xml'.
dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37]
      Reading data from file 'C:\Users\pakrym\AppData\Local\ASP.NET\DataProtection-Keys\key-d9c15325-1a91-4616-bbc3-9203a2b3313c.xml'.
dbug: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[37]
      Reading data from file 'C:\Users\pakrym\AppData\Local\ASP.NET\DataProtection-Keys\key-ff4b5cb5-1d2c-4e0e-9d31-a857cf5eb6de.xml'.
dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18]
      Found key {0656f71b-d11c-4c2a-b7e3-056b3aff13f4}.
dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18]
      Found key {7694830d-b867-4420-b35a-0274f8940deb}.
dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18]
      Found key {b7dfc96e-5d3c-4d65-bb8d-0dd0c181e190}.
dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18]
      Found key {d9c15325-1a91-4616-bbc3-9203a2b3313c}.
dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[18]
      Found key {ff4b5cb5-1d2c-4e0e-9d31-a857cf5eb6de}.
dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.DefaultKeyResolver[13]
      Considering key {7694830d-b867-4420-b35a-0274f8940deb} with expiration date 2017-06-14 18:58:39Z as default key.
dbug: Microsoft.AspNetCore.DataProtection.XmlEncryption.DpapiXmlDecryptor[51]
      Decrypting secret element using Windows DPAPI.
dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.CngCbcAuthenticatedEncryptorFactory[4]
      Opening CNG algorithm 'AES' from provider '(null)' with chaining mode CBC.
dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.CngCbcAuthenticatedEncryptorFactory[3]
      Opening CNG algorithm 'SHA256' from provider '(null)' with HMAC.
dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.CngCbcAuthenticatedEncryptorFactory[4]
      Opening CNG algorithm 'AES' from provider '(null)' with chaining mode CBC.
dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.CngCbcAuthenticatedEncryptorFactory[3]
      Opening CNG algorithm 'SHA256' from provider '(null)' with HMAC.
dbug: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider[2]
      Using key {7694830d-b867-4420-b35a-0274f8940deb} as the default key.
dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.CngCbcAuthenticatedEncryptorFactory[4]
      Opening CNG algorithm 'AES' from provider '(null)' with chaining mode CBC.
dbug: Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.CngCbcAuthenticatedEncryptorFactory[3]
      Opening CNG algorithm 'SHA256' from provider '(null)' with HMAC.
trce: Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector[31]
      Performing protect operation to key {7694830d-b867-4420-b35a-0274f8940deb} with purposes ('sample-purpose').
CfDJ8A2DlHZnuCBEs1oCdPiUDesKcvJN35iTEbTeb552iGYcSIe5nQiUMr9tXY3L6U-U_VOWQTcmWPqvQiAah2l683VfAFh98AtHrxTxne-consyC2qSK_OFk1nWdv46dMoycw