Add KeyPair type for asym primitives
This commit is contained in:
+2
-1
@@ -2,6 +2,7 @@ import {Result} from 'result'
|
||||
|
||||
export type PrivKey = CryptoKey
|
||||
export type PubKey = CryptoKey
|
||||
export type KeyPair = [PrivKey, PubKey]
|
||||
|
||||
const algorithm: EcdsaParams = {
|
||||
name: "ECDSA",
|
||||
@@ -13,7 +14,7 @@ const algorithm: EcdsaParams = {
|
||||
* @param extractable if the keys must be extractable or not
|
||||
* @return [privkey, pubkey] keys
|
||||
*/
|
||||
export async function gen_keypair(extractable: boolean = false) : Promise<[PrivKey, PubKey]> {
|
||||
export async function gen_keypair(extractable: boolean = false) : Promise<KeyPair> {
|
||||
let key = await window.crypto.subtle.generateKey(
|
||||
{
|
||||
name: "ECDSA",
|
||||
|
||||
Reference in New Issue
Block a user