File

src/crypto/key/entities/cert.entity.ts

Description

Entity to manage certificates for keys.

Index

Properties

Properties

createdAt
Type : Date
Decorators :
@CreateDateColumn()

The timestamp when the VP request was created.

crt
Type : string
Decorators :
@Column('varchar')

Certificate in PEM format.

Optional description
Type : string
Decorators :
@Column('varchar', {nullable: true})

Description of the key.

id
Type : string
Decorators :
@Column('varchar', {primary: true})

Unique identifier for the key.

tenant
Type : TenantEntity
Decorators :
@ManyToOne(undefined, {cascade: true, onDelete: 'CASCADE'})

The tenant that owns this object.

tenantId
Type : string
Decorators :
@Column('varchar', {primary: true})

Tenant ID for the key.

type
Type : CertificateType
Decorators :
@Column('varchar', {default: 'signing', primary: true})

Type of the certificate (access or signing).

updatedAt
Type : Date
Decorators :
@UpdateDateColumn()

The timestamp when the VP request was last updated.

import {
    Column,
    CreateDateColumn,
    Entity,
    ManyToOne,
    UpdateDateColumn,
} from "typeorm";
import { TenantEntity } from "../../../auth/tenant/entitites/tenant.entity";

export type CertificateType = "access" | "signing";

/**
 * Entity to manage certificates for keys.
 */
@Entity()
export class CertEntity {
    /**
     * Unique identifier for the key.
     */
    @Column("varchar", { primary: true })
    id: string;

    /**
     * Tenant ID for the key.
     */
    @Column("varchar", { primary: true })
    tenantId: string;

    /**
     * The tenant that owns this object.
     */
    @ManyToOne(() => TenantEntity, { cascade: true, onDelete: "CASCADE" })
    tenant: TenantEntity;

    /**
     * Certificate in PEM format.
     */
    @Column("varchar")
    crt: string;

    /**
     * Type of the certificate (access or signing).
     */
    @Column("varchar", { default: "signing", primary: true })
    type: CertificateType;

    /**
     * Description of the key.
     */
    @Column("varchar", { nullable: true })
    description?: string;

    /**
     * The timestamp when the VP request was created.
     */
    @CreateDateColumn()
    createdAt: Date;

    /**
     * The timestamp when the VP request was last updated.
     */
    @UpdateDateColumn()
    updatedAt: Date;
}

results matching ""

    No results matching ""