Skip to content

Commit

Permalink
fix: LTO DIDs use #sign for keys
Browse files Browse the repository at this point in the history
  • Loading branch information
nklomp committed Dec 14, 2021
1 parent 2a4c3ba commit 11daa98
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const PRIVATE_KEY_HEX =
'ea6aaeebe17557e0fe256bfce08e8224a412ea1e25a5ec8b5d69618a58bad89e89a4661e446b46401325a38d3b20582d1dd277eb448a3181012a671b7ae15837'
const PUBLIC_KEY_HEX = '89a4661e446b46401325a38d3b20582d1dd277eb448a3181012a671b7ae15837'
const LTO_DID = 'did:lto:3MzYSqyo8GBMsY8u8F2WEuoVXYuq6hnKzyj'
const LTO_KID = `${LTO_DID}#key`
const LTO_KID = `${LTO_DID}#sign`
const SPONSOR_PRIVATE_KEY_BASE58 = '5gqCU5NbwU4gc62be39LXDDALKj8opj1KZszx7ULJc2k33kk52prn8D1H2pPPwm6QVKvkuo72YJSoUhzzmAFmDH8'
const LTO_KEY = {
kid: LTO_KID,
Expand Down Expand Up @@ -120,7 +120,7 @@ describe('@sphereon/lto-did-provider', () => {
},
mockContext
)
).resolves.toEqual(`did:lto:${address}#key`)
).resolves.toEqual(`did:lto:${address}#sign`)

// jest.resetAllMocks();
})
Expand Down
8 changes: 4 additions & 4 deletions packages/lto-did-provider/src/lto-did-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ export class LtoDidProvider extends AbstractIdentifierProvider {
})
}

// The #key constant for the controller key is set in stone on the LTO Network
// The #sign constant for the controller key is set in stone on the LTO Network
const identifier: Omit<IIdentifier, 'provider'> = {
did,
controllerKeyId: `${did}#key`,
controllerKeyId: `${did}#sign`,
keys,
services: [],
}
Expand Down Expand Up @@ -149,7 +149,7 @@ export class LtoDidProvider extends AbstractIdentifierProvider {
verificationMethod: args.options.verificationMethod,
createVerificationDID: true,
})
.then((account) => `did:lto:${account.address}#key`)
.then((account) => `did:lto:${account.address}#sign`)
}

removeKey(args: { identifier: IIdentifier; kid: string; options?: any }, context: IAgentContext<IKeyManager>): Promise<any> {
Expand Down Expand Up @@ -179,7 +179,7 @@ export class LtoDidProvider extends AbstractIdentifierProvider {
? await context.agent.keyManagerImport({
kms: kms || this.defaultKms,
publicKeyHex: didAccount ? base58ToHex(didAccount.getPublicSignKey()) : undefined,
kid: didAccount ? `did:lto:${didAccount.address}#key` : undefined,
kid: didAccount ? `did:lto:${didAccount.address}#sign` : undefined,
type: keyType || 'Ed25519',
privateKeyHex,
})
Expand Down

0 comments on commit 11daa98

Please sign in to comment.