smartacme/dist/smartacme.classes.acmecert.d.ts

79 lines
2.3 KiB
TypeScript
Raw Normal View History

2017-01-14 17:36:33 +00:00
import { IRsaKeypair } from './smartacme.classes.smartacme';
import { AcmeAccount } from './smartacme.classes.acmeaccount';
/**
* types of challenges supported by letsencrypt and this module
*/
export declare type TChallengeType = 'dns-01' | 'http-01';
/**
* values that a challenge's status can have
*/
export declare type TChallengeStatus = 'pending';
export interface ISmartAcmeChallenge {
uri: string;
status: TChallengeStatus;
type: TChallengeType;
token: string;
keyAuthorization: string;
}
2017-01-25 01:45:48 +00:00
export interface ISmartAcmeChallengeChosen extends ISmartAcmeChallenge {
2017-01-15 21:30:33 +00:00
dnsKeyHash: string;
domainName: string;
domainNamePrefixed: string;
2017-01-14 17:36:33 +00:00
}
export interface IAcmeCsrConstructorOptions {
bit: number;
key: string;
domain: string;
country: string;
country_short: string;
locality: string;
organization: string;
organization_short: string;
password: string;
unstructured: string;
subject_alt_names: string[];
}
/**
* class AcmeCert represents a cert for domain
*/
2017-01-14 13:14:50 +00:00
export declare class AcmeCert {
2017-01-15 11:21:29 +00:00
domainName: string;
2017-01-14 17:36:33 +00:00
attributes: any;
fullchain: string;
parentAcmeAccount: AcmeAccount;
csr: any;
validFrom: Date;
validTo: Date;
keypair: IRsaKeypair;
keyPairFinal: IRsaKeypair;
2017-01-25 01:45:48 +00:00
chosenChallenge: ISmartAcmeChallengeChosen;
dnsKeyHash: string;
2017-01-15 11:21:29 +00:00
constructor(optionsArg: IAcmeCsrConstructorOptions, parentAcmeAccount: AcmeAccount);
2017-01-14 17:36:33 +00:00
/**
* requests a challenge for a domain
* @param domainNameArg - the domain name to request a challenge for
* @param challengeType - the challenge type to request
*/
2017-04-28 16:56:55 +00:00
requestChallenge(challengeTypeArg?: TChallengeType): Promise<ISmartAcmeChallengeChosen>;
2017-01-15 21:30:33 +00:00
/**
2017-01-15 21:59:58 +00:00
* checks if DNS records are set, will go through a max of 30 cycles
2017-01-15 21:30:33 +00:00
*/
2017-01-27 00:09:38 +00:00
checkDns(cycleArg?: number): Promise<void>;
2017-01-14 17:36:33 +00:00
/**
* validates a challenge, only call after you have set the challenge at the expected location
*/
2017-01-22 20:50:04 +00:00
requestValidation(): Promise<void>;
2017-01-14 17:36:33 +00:00
/**
* requests a certificate
*/
2017-04-28 16:56:55 +00:00
requestCert(): Promise<{}>;
2017-01-14 17:36:33 +00:00
/**
* getCertificate - takes care of cooldown, validation polling and certificate retrieval
*/
getCertificate(): void;
/**
* accept a challenge - for private use only
*/
2017-04-28 16:56:55 +00:00
acceptChallenge(): Promise<{}>;
2017-01-14 13:14:50 +00:00
}