Managing the private keys of two different environments is a critical aspect of devops. In this example, we'll demonstrate how to use Locker Secrets Manager to securely store and retrieve private keys of 2 environment (ex staging and product)
Follow these steps to store and retrieve private keys of 2 environments using Locker:
-
Visit the Locker Secrets Manager and register for an account.
-
Log in and create a new project dedicated to your application.
-
Log in to your Locker account.
-
Navigate to the project created for your application.
-
Click on the "Environments" section.
-
Create 2 environments for storing the private key of your application. Name the environment appropriately, such as
stagingandproduct. -
Click on the "Secrets" section.
-
Create secret for each environment.
-
Install the SDK
1.1. Install for .NET project
Using the .NET Core command-line interface tools
dotnet add package lockerpm
Using NuGet command-line interface
nuget install lockerpm
1.2. Install for Java Project
Maven users
<dependency> <groupId>io.locker</groupId> <artifactId>lockerpm</artifactId> <version>0.0.3</version> </dependency>
Gradle users
implementation 'io.locker:lockerpm:0.0.3' -
Integrate the SDK into your code by using .net or java examples