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.
82 lines (81 loc) • 2.65 kB
TypeScript
/**
* @license
* Copyright 2020 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { PbKeyTemplate } from '../internal/proto';
/**
* Pre-generated KeyTemplates for keys for digital signatures.
*
* One can use these templates to generate new Keyset with
* KeysetHandle.generateNew method. To generate a new keyset that contains a
* single EcdsaKey, one can do:
*
* SignatureConfig.Register();
* KeysetHandle handle = KeysetHandle.generateNew(
* SignatureKeyTemplates.ecdsaP256());
*
* @final
*/
export declare class SignatureKeyTemplates {
/**
* Returns a KeyTemplate that generates new instances of
* EcdsaPrivateKey with the following parameters:
* Hash function: SHA256
* Curve: NIST P-256
* Signature encoding: DER (this is the encoding that Java uses)
* OutputPrefixType: TINK
*
*/
static ecdsaP256(): PbKeyTemplate;
/**
* Returns a KeyTemplate that generates new instances of
* EcdsaPrivateKey with the following parameters:
* Hash function: SHA512
* Curve: NIST P-384
* Signature encoding: DER (this is the encoding that Java uses)
* OutputPrefixType: TINK
*
*/
static ecdsaP384(): PbKeyTemplate;
/**
* Returns a KeyTemplate that generates new instances of
* EcdsaPrivateKey with the following parameters:
* Hash function: SHA512
* Curve: NIST P-521
* Signature encoding: DER (this is the encoding that Java uses).
* OutputPrefixType: TINK
*
*/
static ecdsaP521(): PbKeyTemplate;
/**
* Returns a KeyTemplate that generates new instances of
* EcdsaPrivateKey with the following parameters:
* Hash function: SHA256
* Curve: NIST P-256
* Signature encoding: IEEE_P1363 (this is the encoding that WebCrypto uses)
* OutputPrefixType: TINK
*
*/
static ecdsaP256IeeeEncoding(): PbKeyTemplate;
/**
* Returns a KeyTemplate that generates new instances of
* EcdsaPrivateKey with the following parameters:
* Hash function: SHA512
* Curve: NIST P-384
* Signature encoding: IEEE_P1363 (this is the encoding that WebCrypto uses)
* OutputPrefixType: TINK
*
*/
static ecdsaP384IeeeEncoding(): PbKeyTemplate;
/**
* Returns a KeyTemplate that generates new instances of
* EcdsaPrivateKey with the following parameters:
* Hash function: SHA512
* Curve: NIST P-521
* Signature encoding: IEEE_P1363 (this is the encoding that WebCrypto uses)
* OutputPrefixType: TINK
*
*/
static ecdsaP521IeeeEncoding(): PbKeyTemplate;
}