Importing Virgil Key
This guide shows how to export a Virgil KeyThe Virgil Key is a wrapper of the user's secure Private Key more ... from a Base64 encoded string representation.
Set up your project environment before you begin to import a Virgil Key, with the getting started guide.
In order to import a Virgil Key, we need to:
- Initialize Virgil SDKThe SDK helps take tedious complexity out of coding by providing APIs for all of Virgil Services.
api, err := virgilapi.New("")
- Choose a Base64 encoded string
- Import the Virgil Key from the Base64 encoded string
// initialize a buffer from base64 encoded string
aliceKeyBuffer, err := virgilapi.BufferFromBase64String("[BASE64_ENCODED_VIRGIL_KEY]")
// import Virgil Key from buffer
aliceKey, err := api.Keys.Import(aliceKeyBuffer, "[OPTIONAL_KEY_PASSWORD]");