Skip to content

Importing an Identifier #589

Answered by mirceanis
atz3n asked this question in Q&A
Jun 25, 2021 · 1 comments · 7 replies
Discussion options

You must be logged in to vote

Great question!

The identifiers retrieved by agent.didManager*() methods list the keys as they appear in the database. In your case, you are likely using a SecretBox with your KeyManager in your setup, which means your keys are encrypted (as they should be!).

You can get the decrypted key by something like const fullKey = await agent.keyManagerGet({kid: createdIdentifier.keys[0].kid})
and then do createdIdentifier.keys[0] = fullKey before you call agent.didManager.import(createdIdentifier)

Important note

This works because the current implementation of @veramo/key-manager and @veramo/kms-local allow keys to be exported.
This functionality will likely be removed at some point from them.
Ot…

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@atz3n
Comment options

@mirceanis
Comment options

@atz3n
Comment options

@mirceanis
Comment options

@atz3n
Comment options

Answer selected by atz3n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants