Skip to content

Commit

Permalink
refactor: Added missing notBefore and notAfter properties to options
Browse files Browse the repository at this point in the history
  • Loading branch information
Maikel Maas committed Apr 17, 2024
1 parent 1d2e04d commit 35f1f6b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
19 changes: 16 additions & 3 deletions packages/did-provider-ebsi/src/EbsiDidProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,18 @@ export class EbsiDidProvider extends AbstractIdentifierProvider {
throw new Error(`Options must be provided ${JSON.stringify(options)}`)
}

await this.createEbsiDid({ identifier, secp256k1ManagedKeyInfo, secp256r1ManagedKeyInfo, id, from: options.from }, context)
await this.createEbsiDid(
{
identifier,
secp256k1ManagedKeyInfo,
secp256r1ManagedKeyInfo,
id,
from: options.from,
notBefore: options.notBefore,
notAfter: options.notAfter,
},
context
)

debug('Created', identifier.did)
return identifier
Expand All @@ -80,6 +91,8 @@ export class EbsiDidProvider extends AbstractIdentifierProvider {
id: number
from: string
baseDocument?: string
notBefore: number
notAfter: number
},
context: IContext
): Promise<void> {
Expand All @@ -93,8 +106,8 @@ export class EbsiDidProvider extends AbstractIdentifierProvider {
vMethoddId: await calculateJwkThumbprint(toJwk(args.secp256k1ManagedKeyInfo.publicKeyHex, 'Secp256k1')),
isSecp256k1: true,
publicKey: formatEbsiPublicKey({ key: args.secp256k1ManagedKeyInfo, type: 'Secp256k1' }),
notBefore: 1,
notAfter: 1,
notBefore: args.notBefore,
notAfter: args.notAfter,
},
],
id: args.id,
Expand Down
2 changes: 2 additions & 0 deletions packages/did-provider-ebsi/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ export interface ICreateIdentifierArgs {
secp256r1Key?: IKeyOpts
from: string
baseDocument?: string
notBefore: number
notAfter: number
}
}

Expand Down

0 comments on commit 35f1f6b

Please sign in to comment.