-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Wow you have done a lot of work! Amazing to see everything implemented!
I am running my tests and this is slow. Just want to make sure that is intentional?
✓ XID Document Lifecycle > 7. Private Key Options > should encrypt private keys with password [1675.06ms]
it('should encrypt private keys with password', async function () {
const password = new TextEncoder().encode('test_password')
const envelope = await xid.toEnvelope({
document: aliceDoc,
privateKeyOptions: { type: XIDPrivateKeyOptions.Encrypt, password },
})
// Without password - no private key
const docNoPassword = await xid.fromEnvelope({ envelope })
const keyNoPassword = await xid.getInceptionKey({ document: docNoPassword })
expect(keyNoPassword.hasPrivateKeys()).toBe(false)
// With password - private key restored
const docWithPassword = await xid.fromEnvelope({ envelope, password })
const keyWithPassword = await xid.getInceptionKey({ document: docWithPassword })
expect(keyWithPassword.hasPrivateKeys()).toBe(true)
}, { timeout: 60_000 })
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels