-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Stefan Werfling
committed
Oct 23, 2023
1 parent
b340b89
commit 0bef99a
Showing
3 changed files
with
104 additions
and
0 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
schemas/src/Backend/Provider/SslCertProviders/ISslCertProvider.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<boolean>; | ||
|
||
/** | ||
* Return when existed, the certificat bundel (cert, fullchain, privatkey). | ||
* @param {string} domainName | ||
* @returns {SslCertBundel|null} | ||
*/ | ||
getCertificationBundel(domainName: string): Promise<SslCertBundel|null>; | ||
|
||
/** | ||
* Create a certificate by provider. | ||
* @param {SslCertCreateOptions} options | ||
* @returns {boolean} | ||
*/ | ||
createCertificate(options: SslCertCreateOptions): Promise<boolean>; | ||
|
||
} |
30 changes: 30 additions & 0 deletions
30
schemas/src/Backend/Provider/SslCertProviders/SslCertBundel.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
|
||
}; |
24 changes: 24 additions & 0 deletions
24
schemas/src/Backend/Provider/SslCertProviders/SslCertCreateOptions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
|
||
}; |