Skip to content

Commit

Permalink
feat: add support for did:peer (#608)
Browse files Browse the repository at this point in the history
Signed-off-by: Timo Glastra <[email protected]>
  • Loading branch information
TimoGlastra authored Jan 27, 2022
1 parent 09950c7 commit c5c4172
Show file tree
Hide file tree
Showing 67 changed files with 1,976 additions and 669 deletions.
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ module.exports = {
devDependencies: false,
},
],
'no-restricted-imports': [
'error',
{
patterns: ['packages/*'],
},
],
},
overrides: [
{
Expand Down
7 changes: 7 additions & 0 deletions packages/core/src/crypto/KeyType.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export enum KeyType {
Ed25519 = 'ed25519',
Bls12381g1g2 = 'bls12381g1g2',
Bls12381g1 = 'bls12381g1',
Bls12381g2 = 'bls12381g2',
X25519 = 'x25519',
}
6 changes: 4 additions & 2 deletions packages/core/src/crypto/__tests__/JwsService.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import type { Wallet } from '@aries-framework/core'

import { getAgentConfig } from '../../../tests/helpers'
import { DidKey, KeyType } from '../../modules/dids'
import { DidKey, Key } from '../../modules/dids'
import { Buffer, JsonEncoder } from '../../utils'
import { IndyWallet } from '../../wallet/IndyWallet'
import { JwsService } from '../JwsService'
import { KeyType } from '../KeyType'

import * as didJwsz6Mkf from './__fixtures__/didJwsz6Mkf'
import * as didJwsz6Mkv from './__fixtures__/didJwsz6Mkv'
Expand All @@ -31,7 +32,8 @@ describe('JwsService', () => {
const { verkey } = await wallet.createDid({ seed: didJwsz6Mkf.SEED })

const payload = JsonEncoder.toBuffer(didJwsz6Mkf.DATA_JSON)
const kid = DidKey.fromPublicKeyBase58(verkey, KeyType.ED25519).did
const key = Key.fromPublicKeyBase58(verkey, KeyType.Ed25519)
const kid = new DidKey(key).did

const jws = await jwsService.createJws({
payload,
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/crypto/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { KeyType } from './KeyType'
63 changes: 0 additions & 63 deletions packages/core/src/modules/dids/__tests__/DidKeyBls12381G1.test.ts

This file was deleted.

100 changes: 0 additions & 100 deletions packages/core/src/modules/dids/__tests__/DidKeyBls12381G1G2.test.ts

This file was deleted.

65 changes: 0 additions & 65 deletions packages/core/src/modules/dids/__tests__/DidKeyBls12381G2.test.ts

This file was deleted.

63 changes: 0 additions & 63 deletions packages/core/src/modules/dids/__tests__/DidKeyEd25519.test.ts

This file was deleted.

Loading

0 comments on commit c5c4172

Please sign in to comment.