improve upon keyCreation

This commit is contained in:
2016-11-07 18:41:52 +01:00
parent e1f24823c6
commit 11f12d7c0e
16 changed files with 116 additions and 87 deletions

View File

@ -11,7 +11,6 @@ import { IReqResArg } from './smartacme.classes.jwebclient';
export declare class AcmeClient {
clientProfilePubKey: any;
daysValid: number;
defaultRsaKeySize: number;
directory: any;
directoryUrl: string;
emailDefaultPrefix: string;
@ -80,7 +79,7 @@ export declare class AcmeClient {
* @param {string} domain - expected to be already sanitized
* @param {function} callback - first argument will be the answer object
*/
requestSigning(domain: any, callback: any): void;
requestSigning(commonName: any, callback: any): q.Promise<{}>;
/**
* retrieves profile of user (will make directory lookup and registration check)
* @param {function} callback - first argument will be the answer object
@ -102,13 +101,8 @@ export declare class AcmeClient {
agreeTos(tosLink: any, callback: any): void;
/**
* Entry-Point: Request certificate
* @param {string} domain
* @param {string} organization
* @param {string} country
* @param {function} callback
* @returns Promise
*/
requestCertificate(domain: string, organization: string, country: string): q.Promise<{}>;
requestCertificate(domainArg: string, organizationArg: string, countryCodeArg: string): q.Promise<{}>;
/**
* External: Create key pair
* @param {number} bit - key strength, expected to be already sanitized
@ -118,7 +112,13 @@ export declare class AcmeClient {
* @param {string} e - email address, expected to be already sanitized
* @param {function} callback
*/
createKeyPair(bit: any, c: any, o: any, cn: any, e: any): q.Promise<{}>;
createKeyPair(optionsArg: {
keyBitSize: number;
countryCode: string;
organization: string;
commonName: string;
emailAddress: string;
}): q.Promise<{}>;
/**
* Helper: Empty callback
*/

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -3,7 +3,14 @@ export declare class SmartAcme {
acmeAccount: AcmeAccount;
acmeClient: acmeclient.AcmeClient;
constructor(directoryUrlArg?: string);
/**
* creates an account
*/
createAccount(): void;
/**
* returns the openssl key pair for
*/
getKeyPair(): any;
}
export declare class AcmeAccount {
}

View File

@ -4,14 +4,23 @@ class SmartAcme {
constructor(directoryUrlArg = 'https://acme-staging.api.letsencrypt.org/directory') {
this.acmeClient = new acmeclient.AcmeClient(directoryUrlArg);
}
/**
* creates an account
*/
createAccount() {
this.acmeClient.createAccount('test@bleu.de', (answer) => {
console.log(answer);
});
}
/**
* returns the openssl key pair for
*/
getKeyPair() {
return this.acmeClient.getKeyPair();
}
}
exports.SmartAcme = SmartAcme;
class AcmeAccount {
}
exports.AcmeAccount = AcmeAccount;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRhY21lLmNsYXNzZXMuc21hcnRhY21lLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRhY21lLmNsYXNzZXMuc21hcnRhY21lLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFDQSw2REFBNEQ7QUFFNUQ7SUFHSSxZQUFZLGtCQUEwQixvREFBb0Q7UUFDdEYsSUFBSSxDQUFDLFVBQVUsR0FBRyxJQUFJLFVBQVUsQ0FBQyxVQUFVLENBQUMsZUFBZSxDQUFDLENBQUE7SUFDaEUsQ0FBQztJQUVELGFBQWE7UUFDVCxJQUFJLENBQUMsVUFBVSxDQUFDLGFBQWEsQ0FBQyxjQUFjLEVBQUMsQ0FBQyxNQUFNO1lBQ2hELE9BQU8sQ0FBQyxHQUFHLENBQUMsTUFBTSxDQUFDLENBQUE7UUFDdkIsQ0FBQyxDQUFDLENBQUE7SUFDTixDQUFDO0NBQ0o7QUFaRCw4QkFZQztBQUVEO0NBRUM7QUFGRCxrQ0FFQyJ9
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRhY21lLmNsYXNzZXMuc21hcnRhY21lLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRhY21lLmNsYXNzZXMuc21hcnRhY21lLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFDQSw2REFBNEQ7QUFFNUQ7SUFHSSxZQUFZLGtCQUEwQixvREFBb0Q7UUFDdEYsSUFBSSxDQUFDLFVBQVUsR0FBRyxJQUFJLFVBQVUsQ0FBQyxVQUFVLENBQUMsZUFBZSxDQUFDLENBQUE7SUFDaEUsQ0FBQztJQUVEOztPQUVHO0lBQ0gsYUFBYTtRQUNULElBQUksQ0FBQyxVQUFVLENBQUMsYUFBYSxDQUFDLGNBQWMsRUFBQyxDQUFDLE1BQU07WUFDaEQsT0FBTyxDQUFDLEdBQUcsQ0FBQyxNQUFNLENBQUMsQ0FBQTtRQUN2QixDQUFDLENBQUMsQ0FBQTtJQUNOLENBQUM7SUFFRDs7T0FFRztJQUNILFVBQVU7UUFDTixNQUFNLENBQUMsSUFBSSxDQUFDLFVBQVUsQ0FBQyxVQUFVLEVBQUUsQ0FBQTtJQUN2QyxDQUFDO0NBQ0o7QUF0QkQsOEJBc0JDO0FBRUQ7Q0FFQztBQUZELGtDQUVDIn0=

2
dist/smartacme.paths.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
export declare let packageDir: string;
export declare let assetDir: string;

5
dist/smartacme.paths.js vendored Normal file
View File

@ -0,0 +1,5 @@
"use strict";
const plugins = require("./smartacme.plugins");
exports.packageDir = plugins.path.join(__dirname, '../');
exports.assetDir = plugins.path.join(exports.packageDir, 'assets/');
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRhY21lLnBhdGhzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRhY21lLnBhdGhzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSwrQ0FBOEM7QUFFbkMsUUFBQSxVQUFVLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsU0FBUyxFQUFDLEtBQUssQ0FBQyxDQUFBO0FBQy9DLFFBQUEsUUFBUSxHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLGtCQUFVLEVBQUMsU0FBUyxDQUFDLENBQUEifQ==

View File

@ -1,5 +1,6 @@
import 'typings-global';
import * as path from 'path';
import * as smartfile from 'smartfile';
import * as smartstring from 'smartstring';
import * as shelljs from 'shelljs';
export { path, smartstring, shelljs };
export { path, smartfile, smartstring, shelljs };

View File

@ -2,8 +2,10 @@
require("typings-global");
const path = require("path");
exports.path = path;
const smartfile = require("smartfile");
exports.smartfile = smartfile;
const smartstring = require("smartstring");
exports.smartstring = smartstring;
const shelljs = require("shelljs");
exports.shelljs = shelljs;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRhY21lLnBsdWdpbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydGFjbWUucGx1Z2lucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsMEJBQXVCO0FBQ3ZCLDZCQUE0QjtBQUt4QixvQkFBSTtBQUpSLDJDQUEwQztBQUt0QyxrQ0FBVztBQUpmLG1DQUFrQztBQUs5QiwwQkFBTyJ9
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRhY21lLnBsdWdpbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydGFjbWUucGx1Z2lucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsMEJBQXVCO0FBQ3ZCLDZCQUE0QjtBQU14QixvQkFBSTtBQUxSLHVDQUFzQztBQU1sQyw4QkFBUztBQUxiLDJDQUEwQztBQU10QyxrQ0FBVztBQUxmLG1DQUFrQztBQU05QiwwQkFBTyJ9