/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { Bytes, Crypto, EcdsaSignature, Key } from "@matter/general";
import { Unsigned } from "./common.js";
import { MatterCertificate } from "./definitions/base.js";
import { CertificateExtension } from "./definitions/operational.js";
/**
 * Abstract definition of a X.509 certificate that can be signed and converted to ASN.1 DER format.
 * It also provides two static methods to create a certificate signing request (CSR) and to extract the public key
 * from a CSR.
 */
export declare abstract class Certificate<CT extends MatterCertificate> {
    #private;
    constructor(cert: CT | Unsigned<CT>);
    get cert(): Unsigned<CT>;
    get isSigned(): boolean;
    /**
     * Get the signature of the certificate.
     * If the certificate is not signed, it throws a CertificateError.
     */
    get signature(): EcdsaSignature;
    /**
     * Set the signature of the certificate.
     * If the certificate is already signed, it throws a CertificateError.
     */
    set signature(signature: EcdsaSignature);
    /**
     * Sign the certificate using the provided crypto and key.
     * It throws a CertificateError if the certificate is already signed.
     */
    sign(crypto: Crypto, key: JsonWebKey): Promise<void>;
    /**
     * Serialize as signed DER.
     *
     * If no signature is present, throws an error.
     */
    asSignedDer(): AllowSharedBufferSource;
    /**
     * Serialize as DER without signature.
     */
    asUnsignedDer(): Bytes;
    /**
     * Convert the extensions of the certificate to ASN.1 DER format.
     */
    extensionsToAsn1(extensions: CertificateExtension): {
        [field: string]: any;
    };
}
export declare namespace Certificate {
    /**
     * Create a Certificate Signing Request (CSR) in ASN.1 DER format.
     */
    function createCertificateSigningRequest(crypto: Crypto, key: Key): Promise<AllowSharedBufferSource>;
    /** These extensions are minimum required for all Matter certificates. */
    const REQUIRED_PAA_EXTENSIONS: string[];
    /** These extensions are usually required for all Matter certificates, beside a PAA. */
    const REQUIRED_EXTENSIONS: string[];
    /**
     * Parse an ASN.1/DER encoded certificate into the internal format.
     * This extracts the certificate data without the signature.
     */
    function parseAsn1Certificate(encodedCert: Bytes, requiredExtensions?: string[]): MatterCertificate;
    /**
     * Extract the public key from a Certificate Signing Request (CSR) in ASN.1 DER format.
     */
    function getPublicKeyFromCsr(crypto: Crypto, encodedCsr: Bytes): Promise<AllowSharedBufferSource>;
}
//# sourceMappingURL=Certificate.d.ts.map