-
Notifications
You must be signed in to change notification settings - Fork 0
/
local_certificate_args.ts
41 lines (38 loc) · 1.12 KB
/
local_certificate_args.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import * as keysEntitiesProto from "../../bridge/proto/keys_entities";
import { KeyType } from "./key_type";
import { SubjectCertificateParams } from "./subject_certificate_params";
/**
* Represents the parameters for generating a local certificate.
*/
export class LocalCertificateParams {
public keyType: KeyType;
public subject: SubjectCertificateParams;
public password: string;
public expiration: number;
/**
* Constructs an LocalCertificateParams object with the specified parameters.
* @param keyType
* @param subject
* @param password
* @param expiration
*/
constructor(
keyType: KeyType,
subject: SubjectCertificateParams,
password: string,
expiration: number
) {
this.keyType = keyType;
this.subject = subject;
this.password = password;
this.expiration = expiration;
}
public toProto(): keysEntitiesProto.LocalCertificateParams {
return keysEntitiesProto.LocalCertificateParams.fromPartial({
keyType: KeyType.toProto(this.keyType),
subject: this.subject.toProto(),
password: this.password,
expiration: this.expiration
});
}
}