Shuttle.Core.Encryption
21.0.1-beta
Prefix Reserved
This is a prerelease version of Shuttle.Core.Encryption.
dotnet add package Shuttle.Core.Encryption --version 21.0.1-beta
NuGet\Install-Package Shuttle.Core.Encryption -Version 21.0.1-beta
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Shuttle.Core.Encryption" Version="21.0.1-beta" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Shuttle.Core.Encryption" Version="21.0.1-beta" />
<PackageReference Include="Shuttle.Core.Encryption" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Shuttle.Core.Encryption --version 21.0.1-beta
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Shuttle.Core.Encryption, 21.0.1-beta"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Shuttle.Core.Encryption@21.0.1-beta
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Shuttle.Core.Encryption&version=21.0.1-beta&prerelease
#tool nuget:?package=Shuttle.Core.Encryption&version=21.0.1-beta&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Shuttle.Core.Encryption
Provides an encryption adapter through the IEncryptionAlgorithm interface.
Implementations available in this package:
TripleDesEncryptionAlgorithm(name '3DES')NullEncryptionAlgorithm(name 'nukk')
There is also an IEncryptionService that acts as a central container for all registered IEncryptionAlgorithm implementations.
Installation
dotnet add package Shuttle.Core.Encryption
Configuration
services.AddEncryption(builder => {
builder.AddTripleDes(options => {
options.Key = "your-secret-key-here";
});
});
JSON Configuration
The default JSON settings structure reads from your app configuration:
{
"Shuttle": {
"TripleDes": {
"Key": "triple-des-key"
}
}
}
Usage
Basic Usage
// Get the encryption service via dependency injection
var encryptionService = serviceProvider.GetRequiredService<IEncryptionService>();
// Get a specific encryption algorithm by name
var algorithm = encryptionService.Get("3DES");
// Encrypt data
var plainData = Encoding.UTF8.GetBytes("some data");
var encrypted = await algorithm.EncryptAsync(plainData);
// Decrypt data
var decrypted = await algorithm.DecryptAsync(encrypted);
var decryptedText = Encoding.UTF8.GetString(decrypted);
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Microsoft.Extensions.Configuration (>= 10.0.1)
- Microsoft.Extensions.DependencyInjection (>= 10.0.1)
- Microsoft.Extensions.Options (>= 10.0.1)
- Shuttle.Core.Contract (>= 21.0.1-beta)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Shuttle.Core.Encryption:
| Package | Downloads |
|---|---|
|
Shuttle.Esb
Contains the core Shuttle.Esb assembly that should always be referenced when building Shuttle.Esb solutions. |
|
|
Shuttle.Recall
Event sourcing mechanism. |
GitHub repositories
This package is not used by any popular GitHub repositories.