import { X509Certificate } from 'node:crypto';
import { ASN1Element, SEQUENCE } from 'asn1-ts';
export declare function normaliseEUI(eui: string | Uint8Array | EUI): string;
export declare class EUI {
    readonly eui: string;
    constructor(eui: string | Uint8Array);
    toString(): string;
    valueOf(): string;
    equals(otherEui: string | Uint8Array | EUI): boolean;
}
export declare enum KeyUsage {
    digitalSignature = 0,
    nonRepudiation = 1,
    keyEncipherment = 2,
    dataEncipherment = 3,
    keyAgreement = 4,
    keyCertSign = 5,
    cRLSign = 6,
    encipherOnly = 7,
    decipherOnly = 8
}
export interface CertificateMetadata {
    eui: EUI;
    serial: number | bigint;
    role?: number;
    keyUsage: KeyUsage[];
}
export declare function parseOrganisationSubject(subjectRDNs: SEQUENCE<ASN1Element>): Pick<CertificateMetadata, 'eui' | 'role'>;
export declare function extractExtension(tbsCertificate: SEQUENCE<ASN1Element>, oid: string): Uint8Array | null;
/**
 * Search for the keyUsage extension and extract its values. More info:
 * https://datatracker.ietf.org/doc/html/rfc2459#section-4.1
 *
 * @param tbsCertificate
 * @returns
 */
export declare function parseKeyUsageFromExtensions(tbsCertificate: SEQUENCE<ASN1Element>): KeyUsage[];
/**
 * Given an algorithm identifier (as defined by RFC2459), throw an exception if
 * its not ecdsa with sha256.
 *
 * @param algId
 */
export declare function assertKeyType(algId: SEQUENCE<ASN1Element>): void;
/**
 * parse metadata from a organisation certificate, throws exception if not
 * correct format.
 * @param cert
 * @returns
 */
export declare function buildOrgCertificateMetadata(cert: X509Certificate): CertificateMetadata;
export declare function parseSubjectAltNameFromExtensions(tbsCertificate: SEQUENCE<ASN1Element>): EUI;
/**
 * parse metadata from a device certificate, throws exception if not correct
 * format.
 * @param cert
 * @returns
 */
export declare function buildDeviceCertificateMetadata(cert: X509Certificate): CertificateMetadata;
//# sourceMappingURL=certificateMetadata.d.ts.map