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.

50 lines (49 loc) 1.85 kB
/** * @license * Copyright 2023 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import * as keyManager from '../../../internal/key_manager'; import { PbKeyData, PbMessage } from '../../../internal/proto'; import * as util from '../../../internal/util'; import { HybridEncrypt } from '../hybrid_encrypt'; import { HpkeEncrypt } from './hpke_encrypt'; /** * This class corresponds to the 'HpkePrivateKeyFactory', but it does not * support key generation. The 'HpkePrivateKeyFactor'y' should be use to * generate new HPKE key pairs. * @final */ declare class HpkePublicKeyFactory implements keyManager.KeyFactory { newKey(keyFormat: PbMessage | Uint8Array): never; newKeyData(serializedKeyFormat: Uint8Array): never; } /** * Key manager that produces new instances of {@link HpkeEncrypt} primitives. * @final */ export declare class HpkePublicKeyManager implements keyManager.KeyManager<HybridEncrypt> { static KEY_TYPE: string; private static readonly SUPPORTED_PRIMITIVE; static VERSION: number; keyFactory: HpkePublicKeyFactory; /** * Constructs an instance of the 'HybridEncrypt' primitive for a given HPKE * public key. */ getPrimitive(primitiveType: util.Constructor<HybridEncrypt>, key: PbKeyData | PbMessage): Promise<HpkeEncrypt>; /** Returns true if this KeyManager supports 'HpkePublicKey' key type. */ doesSupport(keyType: string): boolean; /** Returns the URL which identifies the keys managed by this KeyManager. */ getKeyType(): string; /** * Returns the type of primitive which can be generated by this KeyManager, * i.e. 'HybridEncrypt' */ getPrimitiveType(): typeof HybridEncrypt; getVersion(): number; getKeyFactory(): HpkePublicKeyFactory; private static getKeyProto; private static getKeyProtoFromKeyData; } export {};