File

src/crypto/key/dto/rotation-policy.dto.ts

Description

DTO for key rotation policy configuration.

Index

Properties

Properties

Optional certValidityDays
Type : number
Decorators :
@ApiPropertyOptional({description: 'Certificate validity in days when generating new certificates.', example: 90, minimum: 1})
@IsNumber()
@IsOptional()
@Min(1)
enabled
Type : boolean
Decorators :
@ApiProperty({description: 'Whether automatic key rotation is enabled.', example: true})
@IsBoolean()
Optional intervalDays
Type : number
Decorators :
@ApiPropertyOptional({description: 'Rotation interval in days. Key material will be rotated after this many days.', example: 30, minimum: 1})
@IsNumber()
@IsOptional()
@Min(1)
Optional signingCaKeyId
Type : string
Decorators :
@ApiPropertyOptional({description: 'The ID of the CA key used to sign certificates for this key. If not set, certificates will be self-signed.', example: 'ca-key-id'})
@IsString()
@IsOptional()
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
import {
    IsBoolean,
    IsNumber,
    IsOptional,
    IsString,
    Min,
} from "class-validator";

/**
 * DTO for key rotation policy configuration.
 */
export class RotationPolicyDto {
    @ApiProperty({
        description: "Whether automatic key rotation is enabled.",
        example: true,
    })
    @IsBoolean()
    enabled!: boolean;

    @ApiPropertyOptional({
        description:
            "Rotation interval in days. Key material will be rotated after this many days.",
        example: 30,
        minimum: 1,
    })
    @IsNumber()
    @IsOptional()
    @Min(1)
    intervalDays?: number;

    @ApiPropertyOptional({
        description:
            "Certificate validity in days when generating new certificates.",
        example: 90,
        minimum: 1,
    })
    @IsNumber()
    @IsOptional()
    @Min(1)
    certValidityDays?: number;

    @ApiPropertyOptional({
        description:
            "The ID of the CA key used to sign certificates for this key. If not set, certificates will be self-signed.",
        example: "ca-key-id",
    })
    @IsString()
    @IsOptional()
    signingCaKeyId?: string;
}

results matching ""

    No results matching ""