Importing Virgil Key
This guide shows how to export a 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:
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]");