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.
70 lines (69 loc) • 2.05 kB
TypeScript
/**
* @license
* Copyright 2020 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { PbKeyTemplate } from '../internal/proto';
/**
* Pre-generated KeyTemplates for Aead keys.
*
* One can use these templates to generate new Keyset with
* KeysetHandle.generateNew method. To generate a new keyset that contains a
* single AesCtrHmacAeadKey, one can do:
*
* AeadConfig.Register();
* KeysetHandle handle =
* KeysetHandle.generateNew(AeadKeyTemplates.aes128CtrHmacSha256());
*
* @final
*/
export declare class AeadKeyTemplates {
/**
* Returns a KeyTemplate that generates new instances of AesCtrHmacAeadKey
* with the following parameters:
* AES key size: 16 bytes
* AES IV size: 16 bytes
* HMAC key size: 32 bytes
* HMAC tag size: 16 bytes
* HMAC hash function: SHA256
* OutputPrefixType: TINK
*
*/
static aes128CtrHmacSha256(): PbKeyTemplate;
/**
* Returns a KeyTemplate that generates new instances of AesCtrHmacAeadKey
* with the following parameters:
* AES key size: 32 bytes
* AES IV size: 16 bytes
* HMAC key size: 32 bytes
* HMAC tag size: 32 bytes
* HMAC hash function: SHA256
* OutputPrefixType: TINK
*
*/
static aes256CtrHmacSha256(): PbKeyTemplate;
/**
* Returns a KeyTemplate that generates new instances of AesGcmKey
* with the following parameters:
* key size: 16 bytes
* OutputPrefixType: TINK
*
*/
static aes128Gcm(): PbKeyTemplate;
/**
* Returns a KeyTemplate that generates new instances of AesGcmKey
* with the following parameters:
* key size: 32 bytes
* OutputPrefixType: TINK
*
*/
static aes256Gcm(): PbKeyTemplate;
/**
* Returns a KeyTemplate that generates new instances of AesGcmKey
* with the following parameters:
* key size: 32 bytes
* OutputPrefixType: RAW
*
*/
static aes256GcmNoPrefix(): PbKeyTemplate;
}