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.76 kB
/** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import * as KeyManager from '../internal/key_manager'; import { PbEciesAeadHkdfPrivateKey, PbKeyData, PbMessage } from '../internal/proto'; import * as Util from '../internal/util'; import { HybridDecrypt } from './internal/hybrid_decrypt'; /** * @final */ declare class EciesAeadHkdfPrivateKeyFactory implements KeyManager.PrivateKeyFactory { /** */ newKey(keyFormat: PbMessage | Uint8Array): Promise<PbEciesAeadHkdfPrivateKey>; /** */ newKeyData(serializedKeyFormat: PbMessage | 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 EciesAeadHkdfKeyFormat-proto (otherwise). * */ private static getKeyFormatProto; private static deserializeKeyFormat; } /** * @final */ export declare class EciesAeadHkdfPrivateKeyManager implements KeyManager.KeyManager<HybridDecrypt> { private static readonly SUPPORTED_PRIMITIVE; static KEY_TYPE: string; keyFactory: EciesAeadHkdfPrivateKeyFactory; getPrimitive(primitiveType: Util.Constructor<HybridDecrypt>, key: PbKeyData | PbMessage): Promise<HybridDecrypt>; doesSupport(keyType: string): boolean; getKeyType(): string; getPrimitiveType(): typeof HybridDecrypt; getVersion(): number; getKeyFactory(): EciesAeadHkdfPrivateKeyFactory; private static getKeyProto; private static getKeyProtoFromKeyData; } export {};