diff --git a/crypto/keypair.ts b/crypto/keypair.ts index 3784819..fd15669 100644 --- a/crypto/keypair.ts +++ b/crypto/keypair.ts @@ -28,13 +28,17 @@ export class BlahKeyPair { this.privateKey = privateKey; } - static async generate(): Promise { + static async generate( + extractable: boolean = true, + additionalUsage: KeyUsage[] = [], + ): Promise { const { publicKey, privateKey } = await crypto.subtle.generateKey( "Ed25519", - true, + extractable, [ "sign", "verify", + ...additionalUsage, ], ) as CryptoKeyPair; const publicIdentity = await BlahPublicKey.fromPublicKey(publicKey);