Commit Graph

146 Commits

Author SHA1 Message Date
Nate McMaster 9941fb825f
Update TFM to .NET Core 3.0 (#324) 2018-09-06 08:23:55 -07:00
Nate McMaster 7520ffa0ef
Fix up service scoping in the EF Core xml repository and update package version to 2.2 2018-08-30 16:22:43 -07:00
dan.s.ward 8f7d995508 Added Entity Framework Core backed IXmlRepository with tests and sample (#303) 2018-08-29 14:04:37 -07:00
Nate McMaster e0235b1e21
Fix aspnet/Home#3379 - add a functional test for Redis storage provider to ensure keys round-trip (#321) 2018-08-10 15:20:09 -07:00
Nate McMaster 2af13658fc
Unprotect key material with the local cache of certificates before checking the cert store
In some cases, private keys for certificates is not completely available. When attempting to decrypt key material,
this can cause 'CryptographicException: Keyset does not exist'. This changes the order in which key material
decryption looks up private keys to first key the certificate options provided explicitly to the API, and then
falling back to the cert store for decryption keys.
2018-07-05 11:31:46 -07:00
Nate McMaster 3f3bfe05ec
Add a test condition for skipping tests when the default keychain is missing for macOS 2018-06-08 14:44:30 -07:00
Ryan Brandenburg 15ff22bc5c Upgrade to netcoreapp22 2018-05-08 10:50:10 -07:00
Nate McMaster fb2f89ed51
Factor out internal interface for default directory testing
Create an internal abstraction for finding the default directories for key storage. This allows us to run tests without squashing on keys on the developer machine. It also allows us to isolate test runs from reach other.
2018-05-01 14:22:42 -07:00
Nate McMaster fb948aea7d
Fix flaky test: System_NoKeysDirectoryProvided_UsesDefaultKeysDirectory (#305) 2018-04-17 08:38:59 -07:00
Nate McMaster e552b5861a
Switch default implementation of Pbkdf2 on Linux/macOS to Rfc2898DeriveBytes (#301)
Requires adding .NET Core 2.0 target framework to the package because only SHA1 is supported in .NET Standard 2.0
2018-03-06 09:31:03 -08:00
Nate McMaster 70dcbf6ed6
Add UnprotectKeysWithAnyCertificate 2018-02-22 08:50:03 -08:00
Nate McMaster eea8c1a146
Support decrypting keys with X509Certificate that is not in the X509Store
The default implementation of EncryptedXml doesn't support using the RSA
key from X509Certificate to decrypt xml unless that cert is in the X509
CurrentUser\My or Localmachine\My store. This adds support for
decrypting with the X509Certificate directly. This is useful for Linux
(often Docker) scenarios, where the user already has a .pfx file, but
may not have added it to X509Store.
2018-02-16 12:11:20 -08:00
Pranav K f0fef3f20d Update samples and tests to target netcoreapp2.1 2017-11-13 15:27:54 -08:00
Nate McMaster 49b2e22ab3 Pin tool and package versions to make builds more repeatable 2017-11-01 09:09:28 -07:00
Nate McMaster cf85862db3 Merge branch 'rel/2.0.1' into dev 2017-09-21 10:08:02 -07:00
Nate McMaster ed827c0012 Fix bug in test data 2017-09-21 10:04:58 -07:00
Pavel Krymets ee009982dc Add KeyVault encryption to DataProtection (#273) 2017-09-11 08:51:56 -07:00
Nate McMaster 9b45e7f118 Use PackageLineup to manage PackageReference versions 2017-08-29 09:16:24 -07:00
Nate McMaster 28acde451e Use Directory.Build.props/targets 2017-08-29 09:14:03 -07:00
Nate McMaster 8ed38f5dcf Upgrade to xunit 2.3.0-beta4 2017-08-22 15:01:11 -07:00
Pranav K 5d6330e6b1 Pinning versions for 2.0.0 2017-08-17 14:59:12 -07:00
Ryan Brandenburg b61244dac9 Remove AssetTargetFallback 2017-06-30 12:18:59 -07:00
Kiran Challa 4a4960f2c8 Merge branch 'rel/2.0.0-preview2' into dev-gate 2017-06-15 03:40:51 -07:00
Kiran Challa 6134a11c28 Changed all references of PackageTargetFallback to AssetTargetFallback 2017-06-14 14:30:53 -07:00
Nate McMaster 5d1a523682 Make ILoggerFactory an optional service on any DI-injected services 2017-06-13 15:15:19 -07:00
Nate McMaster abf05e2856 Docker: add warning when FileSystemXmlRepository saves a key to non-volume mounted folder 2017-06-13 11:04:52 -07:00
Nate McMaster fe83e69b1a Add a startup filter which initializes the key ring before the server starts 2017-06-02 11:31:16 -07:00
Nate McMaster 285b973a5c Use IHostingEnvironment to determine application identifier
Reverses changes made in #230
2017-06-02 11:27:25 -07:00
Nate McMaster b706a75e03 Target .NET Standard 2.0
This retargets all data protection libraries to ns2.0. This means .NET
Framework applications will need to upgrade to .NET Framework 4.6.1.
This upgrade makes available API to .NET Core that was previously only
available on .NET Framework, such as encrypting keys at rest with
certificates.

New API for .NET Core users:
- IDataProtectionBuilder.ProtectKeysWithCertificate(string thumbprint)
- CertificateXmlEncryptor
- ICertificateResolver
- DataProtectionProvider
  - .Create(string applicationName, X509Certificate2 certificate)
  - .Create(DirectoryInfo keyDirectory, X509Certificate2 certificate)
  - .Create(DirectoryInfo keyDirectory, Action<IDataProtectionBuilder>
  setupAction, X509Certificate2 certificate

Other minor changes in this commit:
- Fixed samples that were using obsolete logging API
- Remove calls to api-sets, instead using kernel32. .NET Core 2.0 no
longer requires using api-sets as Nano Server now forwards kernel32
calls
- Made minor improvements to the TypeForwardingActivator
- Remove dead code an unused api baselines
- Enable more tests on macOS/Linux that previously only ran on Windows
2017-05-24 09:47:10 -07:00
Nate McMaster f70e17c138 Upgrade test framework versions 2017-05-15 16:02:04 -07:00
Chris R 129edaec7c Remove IHostingEnvironment dependency (#230) 2017-05-05 17:03:33 -07:00
Nate McMaster 4dad47eeab Ignore assembly version when activating DataProtection types from string name (#223) 2017-04-25 14:29:26 -07:00
Ajay Bhargav Baaskaran c959795a64 Creating one IAuthenticatedEncryptor per IKey 2017-04-24 10:46:33 -07:00
Ajay Bhargav Baaskaran 697745c490 [Fixes #218] Set IXmlRepository using ConfigureOptions 2017-04-05 16:08:18 -07:00
Pranav K 91406009d3 Remove net451 as a cross-compile target 2017-03-23 17:20:12 -07:00
Kiran Challa bb7b58321c Converted samples and test projects to run on netcoreapp2.0 2017-03-23 17:05:16 -07:00
Nate McMaster 6a61e10a4b Unify dependency versions and remove workarounds 2017-03-15 10:47:41 -07:00
Ajay Bhargav Baaskaran cde3b96aa7 [Fixes #134] Refactored DI support
- Refactored builder extensions and service collection extensions
- Refactored Settings/Configuration/Descriptor
- Removed ConfigurationCommon/AuthenticatedEncryptorConfigurationExtensions
- Added IAuthenticatedEncryptorFactory and implementations
- Refactored IKey to have Descriptor instead of CreateEncryptorInstance()
- Handled Repository/Encryptor special logic
- Added samples
- Updated tests
2017-03-14 19:58:46 -07:00
Doug Bunting a2a3d35852 Bump test projects up to .NET 4.5.2
- aspnet/Testing#248
- xUnit no longer supports .NET 4.5.1
- build tests for desktop .NET only on Windows
2017-02-14 09:05:16 -08:00
Nate McMaster ab33b6afe8 Remove usage of conditional multi-targeting 2017-02-01 12:35:44 -08:00
Nate McMaster 0668a2a52e Upgrade to VS 2017 2017-01-31 16:51:24 -08:00
Nate McMaster 0e45531eb7 Remove the .Sources package from the solution file and remove the 'shared' project within the test folder 2017-01-04 17:17:33 -08:00
Pranav K b3afbc79d2 Updating to 4.4 CoreFx packages 2016-12-14 14:47:27 -08:00
Pranav K 8e4ab2c6ff Updating versions to 1.2.0-* 2016-11-09 14:17:00 -08:00
Pranav K f3a6083c9c Updating to netcoreapp1.1 2016-10-13 11:13:21 -07:00
Pranav K 01e9377eff Revert "Updating to netcoreapp1.1"
This reverts commit a2a214f698.
2016-10-12 16:08:10 -07:00
Pranav K a2a214f698 Updating to netcoreapp1.1 2016-10-12 13:44:59 -07:00
Pavel Krymets 6eacfd2679 Rename Azure.Storage to AzureStorage (#183) 2016-10-04 11:51:50 -07:00
Pranav K 3d3d6a3fba Updating partner package versions 2016-10-03 12:06:50 -07:00
Pavel Krymets 7a3fd8af33 Rename DataProtection.Azure.Blob to DataProtection.Azure.Storage (#180) 2016-09-29 15:23:42 -07:00