ion-sdk
ion-sdk copied to clipboard
How to allow a existing key for a new purpose
In my did document, the initial key created was authorized for authentication
.
I would like the key to also be valid for assertion
, so I was curious how I would go about to update the document to add the key into the assertionMethod
array?
If I look at this: https://github.com/decentralized-identity/ion-tools#generateoperationtype-contents-commit-async, I could use an update
event, but after that I am confused if I should use the addPublicKeys
object, where I would just use the same id (hence overwriting?) and specifying the purposes ( ['authentication', 'assertion']
?),
or should I use updatePublicKey
via this interface: https://github.com/decentralized-identity/ion-tools/blob/9c6572daf91cc59f4bd489eb51da261d2483c0be/ion.js/lib.js#L172. Is the shape of the key object the same in both cases? How do I configure to pass through this object path: op.previous.update.publicJwk
?
Thanks