/** * @license * Copyright 2022-2026 Matter.js Authors * SPDX-License-Identifier: Apache-2.0 */ import { Bytes, Crypto, EcdsaSignature, MlDsa, PublicKey } from "@matter/general"; /** An ML-DSA signature over a certificate, as carried in its signatureValue BIT STRING. */ export declare class MlDsaSignature { readonly parameterSet: MlDsa.ParameterSet; readonly bytes: Bytes; constructor(parameterSet: MlDsa.ParameterSet, bytes: Bytes); } /** The issuer's signature over a certificate: ecdsa-with-SHA256, or ML-DSA for PQC Phase 1 attestation certificates. */ export type CertificateSignature = EcdsaSignature | MlDsaSignature; /** * A certificate's public key, tagged by algorithm. * * An issuer's key algorithm fixes the signature algorithm of the certificates it signs: "ECDSA-P256" signs with * ecdsa-with-SHA256 and an ML-DSA key with the same parameter set. */ export type CertificateKeyAlgorithm = CertificatePublicKey["algorithm"]; /** * Whether a PAI with the given key algorithm may be issued by a PAA with the given one: the PAI may use a weaker * algorithm than its PAA but not a stronger one, as PQC Phase 1 requires. */ export declare function mayIssue(paa: CertificateKeyAlgorithm, pai: CertificateKeyAlgorithm): boolean; export type CertificatePublicKey = { readonly algorithm: "ECDSA-P256"; readonly key: PublicKey; } | { readonly algorithm: MlDsa.ParameterSet; readonly key: Bytes; }; /** * The signature carried by a certificate or CRL, from its signatureAlgorithm AlgorithmIdentifier DER and * signatureValue BIT STRING content. * * @throws CertificateError if the algorithm is neither ecdsa-with-SHA256 nor ML-DSA-44/65, an ML-DSA identifier carries * parameters, or the value is malformed * @see {@link https://www.rfc-editor.org/rfc/rfc9881 RFC 9881} for the ML-DSA signature encoding */ export declare function certificateSignatureOf(algorithmIdentifier: Bytes, value: Bytes): CertificateSignature; /** * Verify a signature over DER data with the signer's key. * * @throws CertificateError if the key algorithm cannot have produced the signature * @throws CryptoVerifyError if the signature does not verify * @throws KeyInputError if the key is malformed * @see {@link https://csrc.nist.gov/pubs/fips/204/final FIPS 204} for ML-DSA */ export declare function verifyCertificateSignature(crypto: Crypto, signerKey: CertificatePublicKey, data: Bytes, signature: CertificateSignature): Promise; //# sourceMappingURL=CertificateSignature.d.ts.map