src/crypto/key/dto/key-import.dto.ts
JWK
Properties |
alg |
Type : string
|
Decorators :
@IsString()
|
Defined in src/crypto/key/dto/key-import.dto.ts:18
|
crv |
Type : string
|
Decorators :
@IsString()
|
Defined in src/crypto/key/dto/key-import.dto.ts:14
|
d |
Type : string
|
Decorators :
@IsString()
|
Defined in src/crypto/key/dto/key-import.dto.ts:16
|
kid |
Type : string
|
Decorators :
@IsString()
|
Defined in src/crypto/key/dto/key-import.dto.ts:6
|
kty |
Type : string
|
Decorators :
@IsEnum(['EC'])
|
Defined in src/crypto/key/dto/key-import.dto.ts:8
|
x |
Type : string
|
Decorators :
@IsString()
|
Defined in src/crypto/key/dto/key-import.dto.ts:10
|
y |
Type : string
|
Decorators :
@IsString()
|
Defined in src/crypto/key/dto/key-import.dto.ts:12
|
import { IsEnum, IsObject, IsOptional, IsString } from 'class-validator';
import { JWK } from 'jose';
class Key implements JWK {
@IsString()
kid: string; // Key ID
@IsEnum(['EC'])
kty: string; // Key Type
@IsString()
x: string; // X coordinate for EC keys
@IsString()
y: string; // Y coordinate for EC keys
@IsString()
crv: string; // Curve name for EC keys
@IsString()
d: string; // Private key value for EC keys
@IsString()
alg: string; // Algorithm used with the key
}
/**
* DTO for importing a key.
*/
export class KeyImportDto {
/**
* The private key in JWK format.
*/
@IsObject()
privateKey: Key;
/**
* Optional certificate in PEM format.
*/
@IsString()
@IsOptional()
crt?: string;
}