Getting Started
On the page, you will learn about:
-
Getting Keychain Core
-
First Steps with Keychain Core using the Man-in-the-Middle, Chat, and Biomonitor samples
-
Getting started with Keychain Core for Linux
-
Getting started with Keychain Core for Android in Android Studio
-
Getting started with Keychain Core for .NET in Visual Studio
Getting Keychain Core
In general, you may find the Keychain Core library builds on the Keychain Jfrog public binary repositories at https://keychain.jfrog.io/artifactory/. Ultimately, all of the Keychain Core binaries will be hosted there. As of now, the following repos are publicly available:
Linux Keychain Core library binaries are found at https://keychain.jfrog.io/artifactory/keychain-core-release-generic/linux.
Android Keychain Core .aar library binaries are found at https://keychain.jfrog.io/artifactory/keychain-core-release-maven/android/io/keychain/libkeychain_android.
Windows Keychain Core .NET library binaries are found at https://keychain.jfrog.io/artifactory/keychain-core-release-generic/windows/win32/keychain-csharp
Keychain recently migrated to the JFrog platoform, and we are in the process of adding existing and in-progress targets. If there are any targets you need that are not found on the site, please contact us for information on the deployment schedule for your desired targets.
First Steps with Keychain Core using Samples
We recommend that you get familiar with the Keychain capabilities by downloading, building, and trying one or more samples from our private repos on Github. These sample projects illustrate simple use cases and highlight usage patterns of Keychain Core in multiple programming languages and environments (primarily Java and Python on Linux, Android Java, and C#.NET on Windows).
These sample projects are provided as-is, solely for informational/educational purposes and do not represent production-level code. |
Getting started with Keychain Core using the Man-in-the-Middle sample
The fastest way to get started with Keychain is to build and try the Man-in-the-Middle sample. This sample demonstrates persona creation, pairing with a trusted directory, and that data protected by Keychain has security benefits beyond that provided by HTTP/S. It defines a Java client and two Python (django) web servers, a frontend and a backend server. The sample sends data to the front server. The front server relays or modifies the received data and sends to the backend. If the client and servers were paired and the data Keychain-secured, then the backend server will be able to detect the front server’s attempt to change the data. Otherwise (using only HTTP/S), the backend server will be none the wiser.
Getting started with Keychain Core using the Chat sample
This repository contains a sample Chat program using Android Java on smart phones. Two or more phone may pair with QR Code and MQTT and thereafter may send end-to-end encrypted and digitally signed messages to each other.
Getting started with Keychain Core using the Biomonitor sample
This sample is similar to the Man-in-the-Middle sample, except that an Android Wear smartwatch application collects the wearer’s heart rate information and sends it to the server.
Getting Started with Keychain Core for Linux
Installing libkeychain for the Local User
1 Download the Linux package libkeychain-linux-x64.tar.gz from the distribution site.
2 Extract the contents.
tar -xvf libkeychain-linux-x64.tar.gz
3 Install the package for the local user.
cd keychain/scripts
./install.sh
This will create a directory structure in $HOME/.keychain
and copy the library files into $HOME/.keychain/lib
and the relevant header files into $HOME/.keychain/include
.
The installation of libkeychain is complete at this point.
Getting Started with Keychain Core for Android in Android Studio
Setting up the Keychain Gradle package feed
First set up your Android project to download Keychain’s packages from Keychain’s Jfrog repository. By doing this, the project will be able to automatically import versions of Keychain packages and control which packages and dependencies to integrate.
1. Add JFrog to the dependencies section of the project’s build.gradle file
2. Add the maven URL to the project’s build.gradle file
3. Import the latest release version of the Keychain Core for Android in the app’s build.gradle file
4. Synch gradle and rebuild your project.
See the gradle files in the sample https://github.com/keychain-io/keychain-sample-java-android for an example.
Getting Started with Keychain Core for .NET in Visual Studio
The fastest way to get started with the Keychain Client for .NET is to set up the sample console application project in the Windows repository. This section provides the steps to set that project up in your own environment.
Note that in future releases, this process will leverage the NuGet package system, potentially removing the need for the steps presented here.
1. Download and save the Keychain Core for .NET package and the sample console application project.
Save and extract the package in a folder in your general project workspace. You will use the chosen path later in setting up your project. The sample console application project should be put in your normal project workspace separate from the Keychain Core for .NET package.
2. Open the sample project in Visual Studio.
3. Update the Keychain reference with the path of the Keychain Core for .NET package.
In the Solution Explorer, navigate to ConsoleApp1→References. Delete the KeychainCli reference if one exists. Add a reference to the KeychainCli.dll located in the bin folder of the recently extracted Keychain Core for .NET package.
4. Set the project’s working directory.
In the form at ConsoleApp1→Properties→Debug, browse to and select the bin folder of the recently extracted Keychain Core for .NET package.
5. Add the reference to your search path.
For debugging, you need to tell the loader where it will find the Keychain Core libraries and dependencies. In our testing, the surest way to do that is to add the path of the Keychain Core package’s bin folder to your user’s PATH environment variable.
In the Windows search box on your tool bar (typically located at the bottom of your screen), type in 'environment'. Click the Settings:Environment Variable launcher. Under 'User variables', click 'Path' and then 'Edit'. Add the path to the environment variable.
6. Add you api key to the Keychain config file.
Open the keychain.cfg file in the bin folder of the package and replace the following
ApiKey: REPLACEME
with
ApiKey: <apikey>
where <apikey>
is the API key you have or will be given by Keychain.
A simple sample with .NET is here https://github.com/keychaingit/keychain-sample-dotnet-console.