fix(core): update

This commit is contained in:
2019-01-12 13:44:18 +01:00
parent ad54bf41ea
commit 1b11b637a5
4 changed files with 28 additions and 10 deletions

View File

@ -41,6 +41,9 @@ export class SmartAcme {
/**
* inits the instance
* ```ts
* await myCloudlyInstance.init() // does not support options
* ```
*/
public async init() {
this.privateKey =
@ -99,6 +102,8 @@ export class SmartAcme {
});
}
public async stop() {};
public async getCertificateForDomain(domainArg: string) {
const domain = domainArg;
@ -162,6 +167,15 @@ export class SmartAcme {
console.log(`Private key:\n${key.toString()}`);
console.log(`Certificate:\n${cert.toString()}`);
this.certmanager.storeCertificate(key.toString(), cert.toString(), csr.toString());
await this.certmanager.storeCertificate({
domainName: domainArg,
privateKey: key.toString(),
publicKey: cert.toString(),
csr: csr.toString(),
created: Date.now()
});
const newCertificate = await this.certmanager.retrieveCertificate(domainArg);
return newCertificate;
}
}