Skip to content

Commit

Permalink
fix(typescript): export generate key pair result interface
Browse files Browse the repository at this point in the history
  • Loading branch information
panva committed Jul 21, 2021
1 parent 1c8f74c commit 2b5cc28
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/util/generate_key_pair.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
import { generateKeyPair as generate } from '../runtime/generate.js'
import type { KeyLike } from '../types'

export interface GenerateKeyPairResult {
/**
* The generated Private Key.
*/
privateKey: KeyLike

/**
* Public Key corresponding to the generated Private Key.
*/
publicKey: KeyLike
}

export interface GenerateKeyPairOptions {
/**
* The EC "crv" (Curve) or OKP "crv" (Subtype of Key Pair) value to generate.
Expand Down Expand Up @@ -54,7 +66,7 @@ export interface GenerateKeyPairOptions {
async function generateKeyPair(
alg: string,
options?: GenerateKeyPairOptions,
): Promise<{ privateKey: KeyLike; publicKey: KeyLike }> {
): Promise<GenerateKeyPairResult> {
return generate(alg, options)
}

Expand Down

0 comments on commit 2b5cc28

Please sign in to comment.