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.
30 lines (29 loc) • 996 B
TypeScript
/**
* @license
* Copyright 2023 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { PbHpkePublicKey } from '../../../internal/proto';
import { HybridEncrypt } from '../hybrid_encrypt';
import { HpkeAead } from './hpke_aead';
import { HpkeKdf } from './hpke_kdf';
import { HpkeKem } from './hpke_kem';
/**
* Hybrid Public Key Encryption (HPKE) encryption.
*
* @final
*/
export declare class HpkeEncrypt extends HybridEncrypt {
private static readonly EMPTY_ASSOCIATED_DATA;
private readonly recipientPublicKey;
private readonly kem;
private readonly kdf;
private readonly aead;
constructor(recipientPublicKey: PbHpkePublicKey, kem: HpkeKem, kdf: HpkeKdf, aead: HpkeAead);
/**
* Returns an HPKE encryption primitive created from a given
* recipient public key.
*/
static createHpkeEncrypt(recipientPublicKey: PbHpkePublicKey): Promise<HpkeEncrypt>;
encrypt(plaintext: Uint8Array, contextInfo?: Uint8Array): Promise<Uint8Array>;
}