misc: key usages setup

This commit is contained in:
Sheen Capadngan
2024-09-10 21:42:41 +08:00
parent a8fd83652d
commit 1c749c84f2
11 changed files with 199 additions and 20 deletions
@@ -1,3 +1,5 @@
import { CertKeyUsage } from "../certificates/types";
export type TCertificateTemplate = {
id: string;
caId: string;
@@ -8,6 +10,7 @@ export type TCertificateTemplate = {
commonName: string;
subjectAlternativeName: string;
ttl: string;
keyUsages: CertKeyUsage[];
};
export type TCreateCertificateTemplateDTO = {
@@ -18,6 +21,7 @@ export type TCreateCertificateTemplateDTO = {
subjectAlternativeName: string;
ttl: string;
projectId: string;
keyUsages: CertKeyUsage[];
};
export type TUpdateCertificateTemplateDTO = {
@@ -29,6 +33,7 @@ export type TUpdateCertificateTemplateDTO = {
subjectAlternativeName?: string;
ttl?: string;
projectId: string;
keyUsages?: CertKeyUsage[];
};
export type TDeleteCertificateTemplateDTO = {
@@ -23,3 +23,15 @@ export type TRevokeCertDTO = {
serialNumber: string;
revocationReason: string;
};
export enum CertKeyUsage {
DIGITAL_SIGNATURE = "digitalSignature",
KEY_ENCIPHERMENT = "keyEncipherment",
NON_REPUDIATION = "nonRepudiation",
DATA_ENCIPHERMENT = "dataEncipherment",
KEY_AGREEMENT = "keyAgreement",
KEY_CERT_SIGN = "keyCertSign",
CRL_SIGN = "cRLSign",
ENCIPHER_ONLY = "encipherOnly",
DECIPHER_ONLY = "decipherOnly"
}