deno.land / std@0.166.0 / node / internal / crypto / x509.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.// Copyright Joyent, Inc. and Node.js contributors. All rights reserved. MIT license.
import { KeyObject } from "./keys.ts";import { Buffer } from "../../buffer.ts";import { ERR_INVALID_ARG_TYPE } from "../errors.ts";import { isArrayBufferView } from "../util/types.ts";import { notImplemented } from "../../_utils.ts";import { BinaryLike } from "./types.ts";
// deno-lint-ignore no-explicit-anyexport type PeerCertificate = any;
export interface X509CheckOptions { /** * @default 'always' */ subject: "always" | "never"; /** * @default true */ wildcards: boolean; /** * @default true */ partialWildcards: boolean; /** * @default false */ multiLabelWildcards: boolean; /** * @default false */ singleLabelSubdomains: boolean;}
export class X509Certificate { constructor(buffer: BinaryLike) { if (typeof buffer === "string") { buffer = Buffer.from(buffer); }
if (!isArrayBufferView(buffer)) { throw new ERR_INVALID_ARG_TYPE( "buffer", ["string", "Buffer", "TypedArray", "DataView"], buffer, ); }
notImplemented("crypto.X509Certificate"); }
get ca(): boolean { notImplemented("crypto.X509Certificate.prototype.ca");
return false; }
checkEmail( _email: string, _options?: Pick<X509CheckOptions, "subject">, ): string | undefined { notImplemented("crypto.X509Certificate.prototype.checkEmail"); }
checkHost(_name: string, _options?: X509CheckOptions): string | undefined { notImplemented("crypto.X509Certificate.prototype.checkHost"); }
checkIP(_ip: string): string | undefined { notImplemented("crypto.X509Certificate.prototype.checkIP"); }
checkIssued(_otherCert: X509Certificate): boolean { notImplemented("crypto.X509Certificate.prototype.checkIssued"); }
checkPrivateKey(_privateKey: KeyObject): boolean { notImplemented("crypto.X509Certificate.prototype.checkPrivateKey"); }
get fingerprint(): string { notImplemented("crypto.X509Certificate.prototype.fingerprint");
return ""; }
get fingerprint256(): string { notImplemented("crypto.X509Certificate.prototype.fingerprint256");
return ""; }
get fingerprint512(): string { notImplemented("crypto.X509Certificate.prototype.fingerprint512");
return ""; }
get infoAccess(): string | undefined { notImplemented("crypto.X509Certificate.prototype.infoAccess");
return ""; }
get issuer(): string { notImplemented("crypto.X509Certificate.prototype.issuer");
return ""; }
get issuerCertificate(): X509Certificate | undefined { notImplemented("crypto.X509Certificate.prototype.issuerCertificate");
return {} as X509Certificate; }
get keyUsage(): string[] { notImplemented("crypto.X509Certificate.prototype.keyUsage");
return []; }
get publicKey(): KeyObject { notImplemented("crypto.X509Certificate.prototype.publicKey");
return {} as KeyObject; }
get raw(): Buffer { notImplemented("crypto.X509Certificate.prototype.raw");
return {} as Buffer; }
get serialNumber(): string { notImplemented("crypto.X509Certificate.prototype.serialNumber");
return ""; }
get subject(): string { notImplemented("crypto.X509Certificate.prototype.subject");
return ""; }
get subjectAltName(): string | undefined { notImplemented("crypto.X509Certificate.prototype.subjectAltName");
return ""; }
toJSON(): string { return this.toString(); }
toLegacyObject(): PeerCertificate { notImplemented("crypto.X509Certificate.prototype.toLegacyObject"); }
toString(): string { notImplemented("crypto.X509Certificate.prototype.toString"); }
get validFrom(): string { notImplemented("crypto.X509Certificate.prototype.validFrom");
return ""; }
get validTo(): string { notImplemented("crypto.X509Certificate.prototype.validTo");
return ""; }
verify(_publicKey: KeyObject): boolean { notImplemented("crypto.X509Certificate.prototype.verify"); }}
export default { X509Certificate,};
std

Version Info

Tagged at
a year ago