UNPKG

tink-crypto

Version:

A multi-language, cross-platform library that provides cryptographic APIs that are secure, easy to use correctly, and hard(er) to misuse.

52 lines (51 loc) 1.7 kB
/** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import * as KeyManager from '../internal/key_manager'; import { PbEcdsaPrivateKey, PbKeyData, PbMessage } from '../internal/proto'; import { Constructor } from '../internal/util'; import { PublicKeySign } from './internal/public_key_sign'; /** * @final */ declare class EcdsaPrivateKeyFactory implements KeyManager.PrivateKeyFactory { /** */ newKey(keyFormat: PbMessage | Uint8Array): Promise<PbEcdsaPrivateKey>; /** */ newKeyData(serializedKeyFormat: Uint8Array): Promise<PbKeyData>; getPublicKeyData(serializedPrivateKey: Uint8Array): any; /** * Creates a private key proto corresponding to given JSON key pair and with * the given params. * */ private static jsonToProtoKey; /** * The input keyFormat is either deserialized (in case that the input is * Uint8Array) or checked to be an EcdsaKeyFormat-proto (otherwise). * */ private static getKeyFormatProto; private static deserializeKeyFormat; } /** * @final */ export declare class EcdsaPrivateKeyManager implements KeyManager.KeyManager<PublicKeySign> { private static readonly SUPPORTED_PRIMITIVE; static KEY_TYPE: string; keyFactory: EcdsaPrivateKeyFactory; getPrimitive(primitiveType: Constructor<PublicKeySign>, key: PbKeyData | PbMessage): Promise<PublicKeySign>; doesSupport(keyType: string): boolean; getKeyType(): string; getPrimitiveType(): typeof PublicKeySign; getVersion(): number; getKeyFactory(): EcdsaPrivateKeyFactory; private static getKeyProto; private static getKeyProtoFromKeyData; } export {};