2016-11-11 13:17:50 +00:00
|
|
|
/// <reference types="q" />
|
|
|
|
import 'typings-global';
|
|
|
|
import * as q from 'q';
|
2017-01-01 17:05:26 +00:00
|
|
|
import { SmartacmeHelper, IRsaKeypair } from './smartacme.classes.helper';
|
2017-01-14 13:14:50 +00:00
|
|
|
export declare type TChallengeType = 'dns-01' | 'http-01';
|
|
|
|
export declare type TChallengeStatus = 'pending';
|
|
|
|
export interface ISmartAcmeChallenge {
|
|
|
|
uri: string;
|
|
|
|
status: TChallengeStatus;
|
|
|
|
type: TChallengeType;
|
|
|
|
token: string;
|
|
|
|
keyAuthorization: string;
|
|
|
|
}
|
|
|
|
export interface ISmartAcmeChallengeAccepted extends ISmartAcmeChallenge {
|
|
|
|
keyHash: string;
|
|
|
|
}
|
2016-11-11 13:17:50 +00:00
|
|
|
/**
|
|
|
|
* class SmartAcme exports methods for maintaining SSL Certificates
|
|
|
|
*/
|
2016-11-01 17:27:57 +00:00
|
|
|
export declare class SmartAcme {
|
2017-01-01 17:05:26 +00:00
|
|
|
helper: SmartacmeHelper;
|
|
|
|
acmeUrl: string;
|
2016-11-11 13:17:50 +00:00
|
|
|
productionBool: boolean;
|
2017-01-01 17:05:26 +00:00
|
|
|
keyPair: IRsaKeypair;
|
2017-01-01 20:20:12 +00:00
|
|
|
location: string;
|
|
|
|
link: string;
|
|
|
|
rawacmeClient: any;
|
2017-01-01 17:05:26 +00:00
|
|
|
JWK: any;
|
2016-11-07 17:41:52 +00:00
|
|
|
/**
|
2017-01-01 17:05:26 +00:00
|
|
|
* the constructor for class SmartAcme
|
2016-11-07 17:41:52 +00:00
|
|
|
*/
|
2017-01-01 17:05:26 +00:00
|
|
|
constructor(productionArg?: boolean);
|
2016-11-07 17:41:52 +00:00
|
|
|
/**
|
2016-11-11 13:17:50 +00:00
|
|
|
* creates an account if not currently present in module
|
2017-01-01 17:05:26 +00:00
|
|
|
* @executes ASYNC
|
2016-11-07 17:41:52 +00:00
|
|
|
*/
|
2016-11-11 13:17:50 +00:00
|
|
|
createAccount(): q.Promise<{}>;
|
2017-01-01 20:20:12 +00:00
|
|
|
agreeTos(): q.Promise<{}>;
|
|
|
|
/**
|
2017-01-01 23:18:51 +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-01 20:20:12 +00:00
|
|
|
*/
|
2017-01-14 13:14:50 +00:00
|
|
|
requestChallenge(domainNameArg: string, challengeTypeArg?: TChallengeType): q.Promise<ISmartAcmeChallengeAccepted>;
|
2017-01-01 23:18:51 +00:00
|
|
|
/**
|
|
|
|
* getCertificate - takes care of cooldown, validation polling and certificate retrieval
|
|
|
|
*/
|
|
|
|
getCertificate(): void;
|
2017-01-14 13:14:50 +00:00
|
|
|
/**
|
|
|
|
* validates a challenge
|
|
|
|
*/
|
|
|
|
validate(challenge: ISmartAcmeChallengeAccepted): q.Promise<{}>;
|
2017-01-01 23:18:51 +00:00
|
|
|
/**
|
|
|
|
* accept a challenge - for private use only
|
|
|
|
*/
|
|
|
|
private acceptChallenge(challenge);
|
2016-11-01 17:27:57 +00:00
|
|
|
}
|