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.
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
.
- Node.js
- React Native
yarn add @credo-ts/askar@^0.5.3 @hyperledger/aries-askar-nodejs@^0.2.1
yarn add @credo-ts/askar@^0.5.3 @hyperledger/aries-askar-react-native@^0.2.1
Adding Aries Askar to the Agent
After installing the dependencies, we can register the Askar Module on the agent.
- Node.js
- React Native
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,
}),
},
})
import { Agent } from '@credo-ts/core'
import { agentDependencies } from '@credo-ts/react-native'
import { AskarModule } from '@credo-ts/askar'
import { ariesAskar } from '@hyperledger/aries-askar-react-native'
const agent = new Agent({
config,
dependencies: agentDependencies,
modules: {
// Register the Askar module on the agent
askar: new AskarModule({
ariesAskar,
}),
},
})