diff --git a/packages/core/src/crypto/signing-provider/Bls12381g2SigningProvider.ts b/packages/core/src/crypto/signing-provider/Bls12381g2SigningProvider.ts index c2d79990bc..02998c007f 100644 --- a/packages/core/src/crypto/signing-provider/Bls12381g2SigningProvider.ts +++ b/packages/core/src/crypto/signing-provider/Bls12381g2SigningProvider.ts @@ -1,4 +1,4 @@ -import type { SigningProvider, CreateKeyOptions, SignOptions, VerifyOptions, KeyPair } from './SigningProvider' +import type { SigningProvider, CreateKeyPairOptions, SignOptions, VerifyOptions, KeyPair } from './SigningProvider' import { bls12381toBbs, verify, sign, generateBls12381G2KeyPair } from '@mattrglobal/bbs-signatures' @@ -21,7 +21,7 @@ export class Bls12381g2SigningProvider implements SigningProvider { * * @throws {SigningProviderError} When a key could not be created */ - public async createKey({ seed }: CreateKeyOptions): Promise { + public async createKeyPair({ seed }: CreateKeyPairOptions): Promise { // Generate bytes from the seed as required by the bbs-signatures libraries const seedBytes = seed ? TypedArrayEncoder.fromString(seed) : undefined diff --git a/packages/core/src/crypto/signing-provider/SigningProvider.ts b/packages/core/src/crypto/signing-provider/SigningProvider.ts index 17c4dc7e30..2f2c31e701 100644 --- a/packages/core/src/crypto/signing-provider/SigningProvider.ts +++ b/packages/core/src/crypto/signing-provider/SigningProvider.ts @@ -19,14 +19,14 @@ export interface VerifyOptions { signature: Buffer } -export interface CreateKeyOptions { +export interface CreateKeyPairOptions { seed?: string } export interface SigningProvider { readonly keyType: KeyType - createKey(options: CreateKeyOptions): Promise + createKeyPair(options: CreateKeyPairOptions): Promise sign(options: SignOptions): Promise verify(options: VerifyOptions): Promise } diff --git a/packages/core/src/crypto/signing-provider/__tests__/SigningProviderRegistry.test.ts b/packages/core/src/crypto/signing-provider/__tests__/SigningProviderRegistry.test.ts index f4881a2230..315b76f80a 100644 --- a/packages/core/src/crypto/signing-provider/__tests__/SigningProviderRegistry.test.ts +++ b/packages/core/src/crypto/signing-provider/__tests__/SigningProviderRegistry.test.ts @@ -7,7 +7,7 @@ import { SigningProviderRegistry } from '../SigningProviderRegistry' class SigningProviderMock implements SigningProvider { public readonly keyType = KeyType.Bls12381g2 - public async createKey(): Promise { + public async createKeyPair(): Promise { throw new Error('Method not implemented.') } public async sign(): Promise {