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

80 lines
2.3 KiB
TypeScript
Raw Normal View History

2017-01-14 17:36:33 +00:00
/// <reference types="q" />
import * as q from 'q';
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;
}
export interface ISmartAcmeChallengeAccepted 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;
acceptedChallenge: ISmartAcmeChallengeAccepted;
2017-01-14 17:36:33 +00:00
fullchain: string;
parentAcmeAccount: AcmeAccount;
csr: any;
validFrom: Date;
validTo: Date;
keypair: IRsaKeypair;
keyPairFinal: IRsaKeypair;
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-01-15 11:21:29 +00:00
requestChallenge(challengeTypeArg?: TChallengeType): q.Promise<ISmartAcmeChallengeAccepted>;
2017-01-15 21:30:33 +00:00
/**
* checks if DNS records are set
*/
checkDns(): Promise<any>;
2017-01-14 17:36:33 +00:00
/**
* validates a challenge, only call after you have set the challenge at the expected location
*/
requestValidation(): q.Promise<{}>;
2017-01-14 17:36:33 +00:00
/**
* requests a certificate
*/
requestCert(): q.Promise<{}>;
/**
* getCertificate - takes care of cooldown, validation polling and certificate retrieval
*/
getCertificate(): void;
/**
* accept a challenge - for private use only
*/
private acceptChallenge(challengeArg);
2017-01-14 13:14:50 +00:00
}