smartacme/ts/smartacme.classes.cert.ts
2019-01-16 22:34:38 +01:00

41 lines
826 B
TypeScript

import * as plugins from './smartacme.plugins';
import * as interfaces from './interfaces';
import { CertManager } from './smartacme.classes.certmanager';
import { Collection, svDb, unI } from '@pushrocks/smartdata';
import { ICert } from './interfaces';
@plugins.smartdata.Collection(() => {
return CertManager.activeDB;
})
export class Cert extends plugins.smartdata.SmartDataDbDoc<Cert> implements interfaces.ICert {
@unI()
public id: string;
@svDb()
public domainName: string;
@svDb()
public created: number;
@svDb()
public privateKey: string;
@svDb()
public publicKey: string;
@svDb()
public csr: string;
constructor(optionsArg: ICert) {
super();
if (optionsArg) {
Object.keys(optionsArg).forEach(key => {
this[key] = optionsArg[key];
});
}
}
}