import { default as default_2 } from 'node-forge'; import { default as default_3 } from 'crypto'; declare const C: () => string; declare namespace cer { export { setFile, getPem, getData, version, getNoCer, text, pubkey, modulu, serial, subjectHash, issuerHash, ocspid, hash, subjectHashOld, issuerHashOld, issuer, subject, date, checkend, ocspUri, validity, fingerPrint, C } } export { cer } export declare class Certificate { private readonly _forgeCert; private readonly _pem; private constructor(); get forgeCertificate(): default_2.pki.Certificate; static fromDer(derBuffer: Buffer): Certificate; static fromPem(pem: string): Certificate; static fromFile(filePath: string): Promise; static fromFileSync(filePath: string): Certificate; toPem(): string; toDer(): Buffer; serialNumber(): string; noCertificado(): string; rfc(): string; private _isValidRfc; legalName(): string; issuer(): Record; subject(): Record; validFrom(): Date; validTo(): Date; isExpired(): boolean; fingerprint(): string; fingerprintSha256(): string; toBase64(): string; publicKey(): string; certificateType(): 'CSD' | 'FIEL' | 'UNKNOWN'; isFiel(): boolean; isCsd(): boolean; acVersion(): number | null; subjectType(): 'MORAL' | 'FISICA' | 'UNKNOWN'; isValid(): boolean; verifyIssuedBy(issuer: Certificate): boolean; verifyIntegrity(issuer: Certificate): boolean; verify(data: string, signature: string, algorithm?: 'SHA256' | 'SHA384' | 'SHA512'): boolean; rsaEncrypt(message: string): string; private _attributesToRecord; private static _decodeAttrValue; } declare const checkend: (seconds: string | number) => string; declare class Credential_2 { private readonly _certificate; private readonly _privateKey; private constructor(); static create(cerPath: string, keyPath: string, password: string): Promise; static fromPem(cerPem: string, keyPem: string): Credential_2; isFiel(): boolean; isCsd(): boolean; rfc(): string; legalName(): string; serialNumber(): string; noCertificado(): string; sign(data: string, algorithm?: string): string; verify(data: string, signature: string, algorithm?: string): boolean; isValid(): boolean; belongsTo(rfc: string): boolean; keyMatchesCertificate(): boolean; get certificate(): Certificate; get privateKey(): PrivateKey; } export { Credential_2 as Credential } export declare type CsdMode = 'node' | 'binary'; declare const date: (format?: string) => { startDate: string; endDate: string; }; declare const fingerPrint: () => string; declare const getData: () => any; declare const getData_2: () => default_2.pki.rsa.PrivateKey; export declare function getMode(): CsdMode; declare const getNoCer: () => string; declare const getPem: (options?: { begin: boolean; }) => string; declare const getPem_2: (options?: { begin: boolean; }) => string; declare const hash: () => string; declare const issuer: () => any; declare const issuerHash: () => string; declare const issuerHashOld: () => string; declare namespace key { export { setFile_2 as setFile, getPem_2 as getPem, getData_2 as getData, signatureHexForge, signatureHexCripto } } export { key } declare const modulu: () => string; export declare class Ocsp { private readonly urlService; private readonly issuerCertificate; private readonly subjectCertificate; private readonly ocspCertificate; private static readonly URL_REGEX; constructor(urlService: string, issuerCertificate: Certificate, subjectCertificate: Certificate, ocspCertificate: Certificate); verify(): Promise; parseResponseStatus(asn1Response: default_2.asn1.Asn1): OcspResponseStatus; parseCertificateStatus(asn1Basic: default_2.asn1.Asn1): OcspCertificateStatusResult; verifyResponseSignature(asn1Basic: default_2.asn1.Asn1): boolean; private _verifySha1; private _postRequest; private _extractBasicResponse; private _buildRequestDer; private _encodeIssuerName; private _extractIssuerPublicKeyBinary; private _sha1Binary; private _asn1DateToDate; } export declare enum OcspCertificateStatus { GOOD = 0, REVOKED = 1, UNKNOWN = 2 } export declare interface OcspCertificateStatusResult { status: 'GOOD' | 'REVOKED' | 'UNKNOWN' | 'UNDEFINED'; revocationTime?: Date; } declare const ocspid: () => string; export declare enum OcspResponseStatus { SUCCESSFUL = "00", MALFORMED_REQUEST = "01", INTERNAL_ERROR = "02", TRY_LATER = "03", SIG_REQUIRED = "05", UNAUTHORIZED = "06", UNDEFINED = "" } declare const ocspUri: () => string; export declare interface OcspVerifyResponse extends OcspCertificateStatusResult { ocspRequestBase64: string; ocspResponseBase64: string; } export declare class PrivateKey { private readonly _pem; private readonly _keyObject; private constructor(); static fromDer(derBuffer: Buffer, password: string, opts?: PrivateKeyLoadOptions): PrivateKey; static fromPem(pem: string): PrivateKey; static fromFile(filePath: string, password: string, opts?: PrivateKeyLoadOptions): Promise; static fromFileSync(filePath: string, password: string, opts?: PrivateKeyLoadOptions): PrivateKey; private static _detectDerKind; toPem(): string; sign(data: string, algorithm?: string): string; rsaDecrypt(encryptedBase64: string): string; belongsToCertificate(cert: Certificate): boolean; get keyObject(): default_3.KeyObject; } export declare interface PrivateKeyLoadOptions { strict?: boolean; } declare const pubkey: (options?: { begin: boolean; }) => string; declare const serial: () => string; declare const setFile: (filePath: string) => void; declare const setFile_2: (keyfile: string, pass?: string) => void; export declare function setMode(mode: CsdMode): void; declare const signatureHexCripto: (message: string) => string; declare const signatureHexForge: (message: string) => string; declare const subject: () => any; declare const subjectHash: () => string; declare const subjectHashOld: () => string; declare const text: () => string; declare const validity: () => { notBefore: Date; notAfter: Date; }; declare const version: () => number; export { }