diff --git a/schemas/src/Backend/Provider/SslCertProviders/ISslCertProvider.ts b/schemas/src/Backend/Provider/SslCertProviders/ISslCertProvider.ts new file mode 100644 index 00000000..b0404fdf --- /dev/null +++ b/schemas/src/Backend/Provider/SslCertProviders/ISslCertProvider.ts @@ -0,0 +1,50 @@ +import {SslCertBundel} from './SslCertBundel.js'; +import {SslCertCreateOptions} from "./SslCertCreateOptions.js"; + +/** + * The ssl certificate provider interface. + */ +export interface ISslCertProvider { + + /** + * Return the keyname for provider as ident. + * @returns {string} + */ + getName(): string; + + /** + * Return the title for provider (for frontend). + * @returns {string} + */ + getTitle(): string; + + /** + * Is provider ready for the request by last request try. + * @param {number} lastRequest - Timestamp from last request. + * @param {number} tryCounst - Count by trys. + * @returns {boolean} By true the request can start. + */ + isReadyForRequest(lastRequest: number, tryCounst: number): boolean; + + /** + * Exist a certificate by domain name. + * @param {string} domainName - Name of domain. + * @returns {boolean} + */ + existCertificate(domainName: string): Promise; + + /** + * Return when existed, the certificat bundel (cert, fullchain, privatkey). + * @param {string} domainName + * @returns {SslCertBundel|null} + */ + getCertificationBundel(domainName: string): Promise; + + /** + * Create a certificate by provider. + * @param {SslCertCreateOptions} options + * @returns {boolean} + */ + createCertificate(options: SslCertCreateOptions): Promise; + +} \ No newline at end of file diff --git a/schemas/src/Backend/Provider/SslCertProviders/SslCertBundel.ts b/schemas/src/Backend/Provider/SslCertProviders/SslCertBundel.ts new file mode 100644 index 00000000..342978d9 --- /dev/null +++ b/schemas/src/Backend/Provider/SslCertProviders/SslCertBundel.ts @@ -0,0 +1,30 @@ +/** + * Ssl certification bundel. + */ +export type SslCertBundel = { + + /** + * Certificate pem path. + * @member {string} + */ + certPem: string; + + /** + * Chain pem path. + * @member {string} + */ + chainPem: string; + + /** + * Full chain pem path. + * @member {string} + */ + fullChainPem: string; + + /** + * Privat key pem path. + * @member {string} + */ + privatKeyPem: string; + +}; \ No newline at end of file diff --git a/schemas/src/Backend/Provider/SslCertProviders/SslCertCreateOptions.ts b/schemas/src/Backend/Provider/SslCertProviders/SslCertCreateOptions.ts new file mode 100644 index 00000000..f50dae33 --- /dev/null +++ b/schemas/src/Backend/Provider/SslCertProviders/SslCertCreateOptions.ts @@ -0,0 +1,24 @@ +/** + * Ssl certification creates options. + */ +export type SslCertCreateOptions = { + + /** + * The domain name for certificate creation. + * @member {string} + */ + domainName: string; + + /** + * The email for certificate notification from provider. + * @member {string} + */ + email: string; + + /** + * Size of a private key, by undefinded is the default 4096. + * @member {number} + */ + keySize?: number; + +}; \ No newline at end of file