Skip to main content
Version: v0.5.x

Aries Askar

Aries Askar provides secure, encrypted storage and cryptographic support for encrypting, decrypting, signing and verifying data. It also provides both the Wallet and StorageService implementations for the agent.

tip

If you're upgrading from the Indy SDK to Aries Askar, see Migrating from an Indy SDK Wallet to Aries Askar

Installing Aries Askar

When using Credo with Aries Askar, there are a few extra dependencies that need to be installed. We need to install the @credo-ts/askar package, which implements the needed interfaces for the agent. Secondly, we need to add native bindings for the specific platform @hyperledger/aries-askar-<platform>. Currently there are bindings for Node.js, as @hyperledger/aries-askar-nodejs, and React Native as @hyperlegder/aries-askar-react-native.

yarn add @credo-ts/askar@^0.5.3 @hyperledger/aries-askar-nodejs@^0.2.1

Adding Aries Askar to the Agent

After installing the dependencies, we can register the Askar Module on the agent.

import { Agent } from '@credo-ts/core'
import { agentDependencies } from '@credo-ts/node'
import { AskarModule } from '@credo-ts/askar'
import { ariesAskar } from '@hyperledger/aries-askar-nodejs'

const agent = new Agent({
config,
dependencies: agentDependencies,
modules: {
// Register the Askar module on the agent
askar: new AskarModule({
ariesAskar,
}),
},
})