File

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

Index

Properties

Properties

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

Unique identifier for the key.

key
Type : JWK
Decorators :
@Column('json')

The key material.

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.

usage
Type : KeyUsage
Decorators :
@Column('varchar', {default: 'sign'})

The usage type of the key.

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

/**
 * Key usage types.
 */
export type KeyUsage = "sign" | "encrypt";

@Entity()
export class KeyEntity {
    /**
     * 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;

    /**
     * The key material.
     */
    @Column("json")
    key: JWK;

    /**
     * The usage type of the key.
     */
    @Column("varchar", { default: "sign" })
    usage: KeyUsage;
}

results matching ""

    No results matching ""