Migrate from KeySecureHeaderModule to CryptoHeaderModule
Prerequisites
CipherTrust Manager is up and running at a supported version. For more details, refer to CipherTrust Manager Deployment.
The CADP for .NET Core library is built on .NET standard 2.1. Click here to refer the supported .NET/.NET Core application versions.
Recommended version: .NET 6.0 or higher.
The supported version should be installed on your machine.
While updating your application to the supported version, ensure to:
Update all the Microsoft libraries used in the project
Update dependent projects and libraries to the supported version
Supported Versions
Current Setup
| Product | Version |
|---|---|
| KeySecureHeaderModule | 3.3.8 |
| KeySecure Classic | 8.5.0 or higher |
Target Setup
| Product | Version |
|---|---|
| CADP for .NET Core | 8.15.0 |
| CipherTrust Manager | 2.16 or higher |
Installation and Migration Steps
Back up the
ProtectAppForDotNet.propertiesfile. By default, this file is placed atC:\Program Files\SafeNet ProtectApp\DotNet\ProtectAppForDotNet.propertiesin Registry.Remove the old references of ProtectApp.NET library from your project.
In Visual Studio, go to Solution Explorer > References and remove the reference of
ingdnp.dllandKeySecureRSAHeader.dll.Comment out the
"using KeySecureHeaderModule;"line in your project. This will give build errors.
Add the
CipherTrust.CADP.NETCorepackage to your project. For details, refer to Adding NuGet Package to the Project. All the dependent libraries will be downloaded automatically to the default NuGet installation directoryC:\Users\%UserName%\.nuget\packages\ciphertrust.cadp.netcore\<product-version>\.After installing the package, explicitly add reference of CryptoHeaderModule.dll to the application. The CryptoHeaderModule.dll will be placed in the
C:\Users\user profile\.nuget\packages\ciphertrust.cadp.netcore\<latest version>\utilityfolder.Configure the
CADP.NETCore_Properties.xmlfile (placed atC:\Users\%UserName%\.nuget\packages\ciphertrust.cadp.netcore\<product-version>\content\) similar to the old properties file (backed-up in step 1). Refer to the properties file migration : Properties FileBack up the old
app.configfile, create a new app.config file, and update all the properties respectively.Refer to the following:
Parameter Mapping from KeySecureHeader Module to CryptoHeader Module
Parameters in app.config File
| KeySecureHeaderModule | CryptoHeaderModule | Default Value |
|---|---|---|
| KeySecureKeyNameList | CryptoHeaderKeyNameList | None |
| KeySecureKeyNameListFile | CryptoHeaderKeyNameListFile | None |
| LegacyKeyMode | Mode | ECB |
| LegacyKeyPading | Padding | PKCS7PADDING |
| LegacyKeyIV | IV | All zeros |
| LegacyKeyName | KeyName | Null |
Parameters in Properties File
| KeySecureHeaderModule | CryptoHeaderModule | Default Value |
|---|---|---|
| NAE_Username | Nae_Username | None |
| NAE_Password | Nae_Password | None |
APIs
| KeySecureHeaderModule | CryptoHeaderModule |
|---|---|
| EncryptLegacyData | EncryptWithoutHeader |
| DecryptLegacyData | DecryptWithoutHeader |