File

src/crypto/key/dto/cert-import.dto.ts

Description

DTO for creating a certificate.

Extends

OmitType(CertEntity, [ "tenantId", "tenant", "key", "createdAt", "updatedAt", "usages", "crt", "id", ] as const)

Index

Properties

Properties

certUsageTypes
Type : CertUsage[]
Decorators :
@IsEnum(CertUsage, {each: true})

Usage types for the certificate.

Optional crt
Type : string
Decorators :
@IsString()
@IsOptional()

Certificate in PEM format, if not provided, a self-signed certificate will be generated.

Optional id
Type : string
Decorators :
@IsOptional()
@IsString()
keyId
Type : string
Decorators :
@IsString()

Key ID of the certificate's private key.

Optional subjectName
Type : string
Decorators :
@IsString()
@IsOptional()

Subject name (CN) for self-signed certificate generation. If not provided, the tenant name will be used.

import { OmitType } from "@nestjs/swagger";
import { IsEnum, IsOptional, IsString } from "class-validator";
import { CertEntity } from "../entities/cert.entity";
import { CertUsage } from "../entities/cert-usage.entity";

/**
 * DTO for creating a certificate.
 */
export class CertImportDto extends OmitType(CertEntity, [
    "tenantId",
    "tenant",
    "key",
    "createdAt",
    "updatedAt",
    "usages",
    "crt",
    "id",
] as const) {
    @IsOptional()
    @IsString()
    id?: string;

    /**
     * Key ID of the certificate's private key.
     */
    @IsString()
    keyId: string;

    /**
     * Usage types for the certificate.
     */
    @IsEnum(CertUsage, { each: true })
    certUsageTypes: CertUsage[];

    /**
     * Certificate in PEM format, if not provided, a self-signed certificate will be generated.
     */
    @IsString()
    @IsOptional()
    crt?: string;

    /**
     * Subject name (CN) for self-signed certificate generation.
     * If not provided, the tenant name will be used.
     */
    @IsString()
    @IsOptional()
    subjectName?: string;
}

results matching ""

    No results matching ""