node-opcua-pki 6.14.0 → 6.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/pki.mjs +195 -20
- package/dist/bin/pki.mjs.map +1 -1
- package/dist/index.d.mts +152 -1
- package/dist/index.d.ts +152 -1
- package/dist/index.js +195 -20
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +195 -20
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -59,6 +59,17 @@ interface StartDateEndDateParam {
|
|
|
59
59
|
endDate?: Date;
|
|
60
60
|
/** Number of days the certificate is valid. @defaultValue 365 */
|
|
61
61
|
validity?: number;
|
|
62
|
+
/**
|
|
63
|
+
* Certificate validity in milliseconds.
|
|
64
|
+
*
|
|
65
|
+
* When provided, takes precedence over {@link validity} and enables
|
|
66
|
+
* sub-day validity (X.509 supports second precision per RFC 5280
|
|
67
|
+
* §4.1.2.5; OpenSSL is invoked with `-startdate`/`-enddate` already).
|
|
68
|
+
*
|
|
69
|
+
* Typical use is short-lived certificates for demos or for renewal
|
|
70
|
+
* cycle testing. Existing day-based callers are unaffected.
|
|
71
|
+
*/
|
|
72
|
+
validityMs?: number;
|
|
62
73
|
}
|
|
63
74
|
/**
|
|
64
75
|
* Parameters for creating a self-signed certificate.
|
|
@@ -161,6 +172,28 @@ interface CertificateAuthorityOptions {
|
|
|
161
172
|
* The parent CA must be initialized before this CA.
|
|
162
173
|
*/
|
|
163
174
|
issuerCA?: CertificateAuthority;
|
|
175
|
+
/**
|
|
176
|
+
* Public URL (http/https) where the CRL produced by this CA is
|
|
177
|
+
* reachable. When set, every issued certificate carries an
|
|
178
|
+
* X.509v3 `crlDistributionPoints` extension pointing at this URL.
|
|
179
|
+
*
|
|
180
|
+
* Leave undefined to omit the extension entirely (opt-in — see
|
|
181
|
+
* US-202). Validated synchronously at construction / setter call.
|
|
182
|
+
*/
|
|
183
|
+
crlDistributionUrl?: string;
|
|
184
|
+
/**
|
|
185
|
+
* Public URL of the OCSP responder. When set, every issued cert
|
|
186
|
+
* carries an `authorityInfoAccess` extension with an `OCSP` leg
|
|
187
|
+
* pointing at this URL. Leave undefined to omit (US-202).
|
|
188
|
+
*/
|
|
189
|
+
ocspResponderUrl?: string;
|
|
190
|
+
/**
|
|
191
|
+
* Public URL where the issuer's certificate can be fetched.
|
|
192
|
+
* When set, the `authorityInfoAccess` extension on every issued
|
|
193
|
+
* cert carries a `caIssuers` leg pointing at this URL (chain
|
|
194
|
+
* repair). Leave undefined to omit (US-202).
|
|
195
|
+
*/
|
|
196
|
+
caIssuersUrl?: string;
|
|
164
197
|
}
|
|
165
198
|
/**
|
|
166
199
|
* An OpenSSL-based Certificate Authority (CA) that can create,
|
|
@@ -218,6 +251,13 @@ interface IssuedCertificateRecord {
|
|
|
218
251
|
interface SignCertificateOptions {
|
|
219
252
|
/** Certificate validity in days (default: 365). */
|
|
220
253
|
validity?: number;
|
|
254
|
+
/**
|
|
255
|
+
* Certificate validity in milliseconds.
|
|
256
|
+
*
|
|
257
|
+
* When provided, takes precedence over {@link validity} and enables
|
|
258
|
+
* sub-day validity (e.g. 10-minute certificates for renewal demos).
|
|
259
|
+
*/
|
|
260
|
+
validityMs?: number;
|
|
221
261
|
/** Override the certificate start date. */
|
|
222
262
|
startDate?: Date;
|
|
223
263
|
/** Override DNS SANs. */
|
|
@@ -229,6 +269,34 @@ interface SignCertificateOptions {
|
|
|
229
269
|
/** Override the X.500 subject. */
|
|
230
270
|
subject?: SubjectOptions | string;
|
|
231
271
|
}
|
|
272
|
+
/**
|
|
273
|
+
* Capabilities advertised by a PKI backend (or by this
|
|
274
|
+
* {@link CertificateAuthority}) so consumers can clamp requested
|
|
275
|
+
* validity to the limits the backend can actually honor.
|
|
276
|
+
*
|
|
277
|
+
* Useful for the GDS Pull / Push management flows, where the CA may
|
|
278
|
+
* be supplied by an external service (step-ca, EJBCA, …) with its
|
|
279
|
+
* own minimum / maximum / granularity constraints.
|
|
280
|
+
*
|
|
281
|
+
* @see CertificateAuthority.getCapabilities
|
|
282
|
+
*/
|
|
283
|
+
interface PkiBackendCapabilities {
|
|
284
|
+
/** Smallest validity this backend can issue, in milliseconds. */
|
|
285
|
+
minValidityMs: number;
|
|
286
|
+
/** Largest validity this backend will issue, in milliseconds. */
|
|
287
|
+
maxValidityMs: number;
|
|
288
|
+
/**
|
|
289
|
+
* Validity is rounded up to the nearest multiple of this many
|
|
290
|
+
* milliseconds. For `node-opcua-pki`'s OpenSSL-based CA this is
|
|
291
|
+
* 1 000 ms (one second — the X.509 floor per RFC 5280 §4.1.2.5).
|
|
292
|
+
*/
|
|
293
|
+
validityGranularityMs: number;
|
|
294
|
+
/**
|
|
295
|
+
* Native unit the backend works in. Diagnostic only — callers
|
|
296
|
+
* always pass `validityMs` (US-208 / US-210).
|
|
297
|
+
*/
|
|
298
|
+
nativeUnit: "second" | "minute" | "hour" | "day";
|
|
299
|
+
}
|
|
232
300
|
/**
|
|
233
301
|
* Options for {@link CertificateAuthority.generateKeyPairAndSignDER}.
|
|
234
302
|
*/
|
|
@@ -243,6 +311,13 @@ interface GenerateKeyPairAndSignOptions {
|
|
|
243
311
|
ip?: string[];
|
|
244
312
|
/** Certificate validity in days (default: 365). */
|
|
245
313
|
validity?: number;
|
|
314
|
+
/**
|
|
315
|
+
* Certificate validity in milliseconds.
|
|
316
|
+
*
|
|
317
|
+
* When provided, takes precedence over {@link validity} and enables
|
|
318
|
+
* sub-day validity (e.g. 10-minute certificates for renewal demos).
|
|
319
|
+
*/
|
|
320
|
+
validityMs?: number;
|
|
246
321
|
/** Certificate start date (default: now). */
|
|
247
322
|
startDate?: Date;
|
|
248
323
|
/** RSA key size in bits (default: 2048). */
|
|
@@ -270,7 +345,61 @@ declare class CertificateAuthority {
|
|
|
270
345
|
readonly subject: Subject;
|
|
271
346
|
/** @internal Parent CA (undefined for root CAs). */
|
|
272
347
|
readonly _issuerCA?: CertificateAuthority;
|
|
348
|
+
/** @internal Configured CDP / AIA URLs (US-202). */
|
|
349
|
+
private _crlDistributionUrl?;
|
|
350
|
+
private _ocspResponderUrl?;
|
|
351
|
+
private _caIssuersUrl?;
|
|
273
352
|
constructor(options: CertificateAuthorityOptions);
|
|
353
|
+
/**
|
|
354
|
+
* Public URL where the CRL produced by this CA is reachable, or
|
|
355
|
+
* `undefined` if no CDP extension should be emitted on issued certs.
|
|
356
|
+
*/
|
|
357
|
+
get crlDistributionUrl(): string | undefined;
|
|
358
|
+
/**
|
|
359
|
+
* Public URL of the OCSP responder, or `undefined` if no AIA OCSP
|
|
360
|
+
* leg should be emitted on issued certs.
|
|
361
|
+
*/
|
|
362
|
+
get ocspResponderUrl(): string | undefined;
|
|
363
|
+
/**
|
|
364
|
+
* Public URL where the issuer's certificate can be fetched, or
|
|
365
|
+
* `undefined` if no AIA caIssuers leg should be emitted.
|
|
366
|
+
*/
|
|
367
|
+
get caIssuersUrl(): string | undefined;
|
|
368
|
+
/**
|
|
369
|
+
* Configure the URL embedded as `crlDistributionPoints` in every
|
|
370
|
+
* subsequently-issued certificate. Pass `undefined` to disable
|
|
371
|
+
* the extension entirely. Validated synchronously — throws on
|
|
372
|
+
* empty string, non-http(s) protocol, missing path. Warns (does
|
|
373
|
+
* not throw) when the URL points at loopback.
|
|
374
|
+
*
|
|
375
|
+
* @see US-202
|
|
376
|
+
*/
|
|
377
|
+
setCrlDistributionUrl(url: string | undefined): void;
|
|
378
|
+
/**
|
|
379
|
+
* Configure the OCSP responder URL embedded as the `OCSP` leg of
|
|
380
|
+
* the `authorityInfoAccess` extension on every subsequently-issued
|
|
381
|
+
* certificate. Pass `undefined` to disable.
|
|
382
|
+
*
|
|
383
|
+
* @see US-202
|
|
384
|
+
*/
|
|
385
|
+
setOcspResponderUrl(url: string | undefined): void;
|
|
386
|
+
/**
|
|
387
|
+
* Configure the caIssuers URL embedded as the `caIssuers` leg of
|
|
388
|
+
* the `authorityInfoAccess` extension on every subsequently-issued
|
|
389
|
+
* certificate. Pass `undefined` to disable.
|
|
390
|
+
*
|
|
391
|
+
* @see US-202
|
|
392
|
+
*/
|
|
393
|
+
setCaIssuersUrl(url: string | undefined): void;
|
|
394
|
+
/**
|
|
395
|
+
* @internal
|
|
396
|
+
* Populate the OpenSSL config substitution env vars (`CDP_URL` and
|
|
397
|
+
* `AIA_VALUE`) from the configured URLs, or unset them so the
|
|
398
|
+
* matching `{{#KEY}}...{{/KEY}}` blocks in the templates are
|
|
399
|
+
* stripped. MUST be called before every `generateStaticConfig`
|
|
400
|
+
* invocation that signs a certificate.
|
|
401
|
+
*/
|
|
402
|
+
_wireRevocationEnvVars(): void;
|
|
274
403
|
/** Absolute path to the CA root directory (alias for {@link location}). */
|
|
275
404
|
get rootDir(): string;
|
|
276
405
|
/** Path to the OpenSSL configuration file (`conf/caconfig.cnf`). */
|
|
@@ -399,6 +528,28 @@ declare class CertificateAuthority {
|
|
|
399
528
|
* @returns the signed certificate as a DER-encoded buffer
|
|
400
529
|
*/
|
|
401
530
|
signCertificateRequestFromDER(csrDer: Buffer, options?: SignCertificateOptions): Promise<Buffer>;
|
|
531
|
+
/**
|
|
532
|
+
* Advertise the validity limits this CA can honor.
|
|
533
|
+
*
|
|
534
|
+
* Consumers (notably the GDS server in [`cert_auth.ts`](https://github.com/sterfive/node-opcua-gds))
|
|
535
|
+
* clamp a requested validity against these bounds before calling
|
|
536
|
+
* {@link signCertificateRequestFromDER}, so a misconfigured
|
|
537
|
+
* `defaultCertValidity` cannot ask the CA for something it cannot
|
|
538
|
+
* produce.
|
|
539
|
+
*
|
|
540
|
+
* Defaults match the OpenSSL-backed implementation:
|
|
541
|
+
* - `minValidityMs = 60_000` (1 minute) — practical floor; the
|
|
542
|
+
* X.509 spec floor is 1 second but very short certs are rarely
|
|
543
|
+
* useful and pathological for any real deployment.
|
|
544
|
+
* - `maxValidityMs = 10 * 365 * 86_400_000` (≈ 10 years) — long
|
|
545
|
+
* enough for root CAs.
|
|
546
|
+
* - `validityGranularityMs = 1_000` (1 second) — RFC 5280 §4.1.2.5
|
|
547
|
+
* floor on `notBefore` / `notAfter`.
|
|
548
|
+
* - `nativeUnit = "second"` — what `x509Date()` actually encodes.
|
|
549
|
+
*
|
|
550
|
+
* @see US-208 — the consumer-side capability story.
|
|
551
|
+
*/
|
|
552
|
+
getCapabilities(): PkiBackendCapabilities;
|
|
402
553
|
/**
|
|
403
554
|
* Generate a new RSA key pair, create an internal CSR, sign it
|
|
404
555
|
* with this CA, and return both the certificate and private key
|
|
@@ -1364,4 +1515,4 @@ declare function dumpPFX(pfxFile: Filename, passphrase?: string): Promise<string
|
|
|
1364
1515
|
*/
|
|
1365
1516
|
declare function install_prerequisite(): Promise<string>;
|
|
1366
1517
|
|
|
1367
|
-
export { type AddCertificateValidationOptions, CertificateAuthority, type CertificateAuthorityOptions, CertificateManager, type CertificateManagerEvents, type CertificateManagerOptions, CertificateManagerState, type CertificateStatus, type CertificateStore, type ChainCompletionResult, ChainCompletionStatus, type CreateCertificateSigningRequestOptions, type CreateCertificateSigningRequestWithConfigOptions, type CreatePFXOptions, type CreateSelfSignCertificateParam, type CreateSelfSignCertificateParam1, type CreateSelfSignCertificateWithConfigParam, type CrlStore, type ExtractPFXOptions, type ExtractPFXResult, type Filename, type GenerateKeyPairAndSignOptions, type GenerateKeyPairAndSignPFXOptions, type InitializeCSRResult, type InstallCACertificateResult, type KeyLength, type KeySize, type Params, type ProcessAltNamesParam, type SignCertificateOptions, type StartDateEndDateParam, type Thumbprint, VerificationStatus, type VerifyCertificateOptions, adjustApplicationUri, adjustDate, coerceCertificateChain, convertPFXtoPEM, createPFX, dumpPFX, extractAllFromPFX, extractCACertificatesFromPFX, extractCertificateFromPFX, extractPrivateKeyFromPFX, findIssuerCertificateInChain, install_prerequisite, isIntermediateIssuer, isIssuer, isRootIssuer, makeFingerprint, quote };
|
|
1518
|
+
export { type AddCertificateValidationOptions, CertificateAuthority, type CertificateAuthorityOptions, CertificateManager, type CertificateManagerEvents, type CertificateManagerOptions, CertificateManagerState, type CertificateStatus, type CertificateStore, type ChainCompletionResult, ChainCompletionStatus, type CreateCertificateSigningRequestOptions, type CreateCertificateSigningRequestWithConfigOptions, type CreatePFXOptions, type CreateSelfSignCertificateParam, type CreateSelfSignCertificateParam1, type CreateSelfSignCertificateWithConfigParam, type CrlStore, type ExtractPFXOptions, type ExtractPFXResult, type Filename, type GenerateKeyPairAndSignOptions, type GenerateKeyPairAndSignPFXOptions, type InitializeCSRResult, type InstallCACertificateResult, type KeyLength, type KeySize, type Params, type PkiBackendCapabilities, type ProcessAltNamesParam, type SignCertificateOptions, type StartDateEndDateParam, type Thumbprint, VerificationStatus, type VerifyCertificateOptions, adjustApplicationUri, adjustDate, coerceCertificateChain, convertPFXtoPEM, createPFX, dumpPFX, extractAllFromPFX, extractCACertificatesFromPFX, extractCertificateFromPFX, extractPrivateKeyFromPFX, findIssuerCertificateInChain, install_prerequisite, isIntermediateIssuer, isIssuer, isRootIssuer, makeFingerprint, quote };
|
package/dist/index.d.ts
CHANGED
|
@@ -59,6 +59,17 @@ interface StartDateEndDateParam {
|
|
|
59
59
|
endDate?: Date;
|
|
60
60
|
/** Number of days the certificate is valid. @defaultValue 365 */
|
|
61
61
|
validity?: number;
|
|
62
|
+
/**
|
|
63
|
+
* Certificate validity in milliseconds.
|
|
64
|
+
*
|
|
65
|
+
* When provided, takes precedence over {@link validity} and enables
|
|
66
|
+
* sub-day validity (X.509 supports second precision per RFC 5280
|
|
67
|
+
* §4.1.2.5; OpenSSL is invoked with `-startdate`/`-enddate` already).
|
|
68
|
+
*
|
|
69
|
+
* Typical use is short-lived certificates for demos or for renewal
|
|
70
|
+
* cycle testing. Existing day-based callers are unaffected.
|
|
71
|
+
*/
|
|
72
|
+
validityMs?: number;
|
|
62
73
|
}
|
|
63
74
|
/**
|
|
64
75
|
* Parameters for creating a self-signed certificate.
|
|
@@ -161,6 +172,28 @@ interface CertificateAuthorityOptions {
|
|
|
161
172
|
* The parent CA must be initialized before this CA.
|
|
162
173
|
*/
|
|
163
174
|
issuerCA?: CertificateAuthority;
|
|
175
|
+
/**
|
|
176
|
+
* Public URL (http/https) where the CRL produced by this CA is
|
|
177
|
+
* reachable. When set, every issued certificate carries an
|
|
178
|
+
* X.509v3 `crlDistributionPoints` extension pointing at this URL.
|
|
179
|
+
*
|
|
180
|
+
* Leave undefined to omit the extension entirely (opt-in — see
|
|
181
|
+
* US-202). Validated synchronously at construction / setter call.
|
|
182
|
+
*/
|
|
183
|
+
crlDistributionUrl?: string;
|
|
184
|
+
/**
|
|
185
|
+
* Public URL of the OCSP responder. When set, every issued cert
|
|
186
|
+
* carries an `authorityInfoAccess` extension with an `OCSP` leg
|
|
187
|
+
* pointing at this URL. Leave undefined to omit (US-202).
|
|
188
|
+
*/
|
|
189
|
+
ocspResponderUrl?: string;
|
|
190
|
+
/**
|
|
191
|
+
* Public URL where the issuer's certificate can be fetched.
|
|
192
|
+
* When set, the `authorityInfoAccess` extension on every issued
|
|
193
|
+
* cert carries a `caIssuers` leg pointing at this URL (chain
|
|
194
|
+
* repair). Leave undefined to omit (US-202).
|
|
195
|
+
*/
|
|
196
|
+
caIssuersUrl?: string;
|
|
164
197
|
}
|
|
165
198
|
/**
|
|
166
199
|
* An OpenSSL-based Certificate Authority (CA) that can create,
|
|
@@ -218,6 +251,13 @@ interface IssuedCertificateRecord {
|
|
|
218
251
|
interface SignCertificateOptions {
|
|
219
252
|
/** Certificate validity in days (default: 365). */
|
|
220
253
|
validity?: number;
|
|
254
|
+
/**
|
|
255
|
+
* Certificate validity in milliseconds.
|
|
256
|
+
*
|
|
257
|
+
* When provided, takes precedence over {@link validity} and enables
|
|
258
|
+
* sub-day validity (e.g. 10-minute certificates for renewal demos).
|
|
259
|
+
*/
|
|
260
|
+
validityMs?: number;
|
|
221
261
|
/** Override the certificate start date. */
|
|
222
262
|
startDate?: Date;
|
|
223
263
|
/** Override DNS SANs. */
|
|
@@ -229,6 +269,34 @@ interface SignCertificateOptions {
|
|
|
229
269
|
/** Override the X.500 subject. */
|
|
230
270
|
subject?: SubjectOptions | string;
|
|
231
271
|
}
|
|
272
|
+
/**
|
|
273
|
+
* Capabilities advertised by a PKI backend (or by this
|
|
274
|
+
* {@link CertificateAuthority}) so consumers can clamp requested
|
|
275
|
+
* validity to the limits the backend can actually honor.
|
|
276
|
+
*
|
|
277
|
+
* Useful for the GDS Pull / Push management flows, where the CA may
|
|
278
|
+
* be supplied by an external service (step-ca, EJBCA, …) with its
|
|
279
|
+
* own minimum / maximum / granularity constraints.
|
|
280
|
+
*
|
|
281
|
+
* @see CertificateAuthority.getCapabilities
|
|
282
|
+
*/
|
|
283
|
+
interface PkiBackendCapabilities {
|
|
284
|
+
/** Smallest validity this backend can issue, in milliseconds. */
|
|
285
|
+
minValidityMs: number;
|
|
286
|
+
/** Largest validity this backend will issue, in milliseconds. */
|
|
287
|
+
maxValidityMs: number;
|
|
288
|
+
/**
|
|
289
|
+
* Validity is rounded up to the nearest multiple of this many
|
|
290
|
+
* milliseconds. For `node-opcua-pki`'s OpenSSL-based CA this is
|
|
291
|
+
* 1 000 ms (one second — the X.509 floor per RFC 5280 §4.1.2.5).
|
|
292
|
+
*/
|
|
293
|
+
validityGranularityMs: number;
|
|
294
|
+
/**
|
|
295
|
+
* Native unit the backend works in. Diagnostic only — callers
|
|
296
|
+
* always pass `validityMs` (US-208 / US-210).
|
|
297
|
+
*/
|
|
298
|
+
nativeUnit: "second" | "minute" | "hour" | "day";
|
|
299
|
+
}
|
|
232
300
|
/**
|
|
233
301
|
* Options for {@link CertificateAuthority.generateKeyPairAndSignDER}.
|
|
234
302
|
*/
|
|
@@ -243,6 +311,13 @@ interface GenerateKeyPairAndSignOptions {
|
|
|
243
311
|
ip?: string[];
|
|
244
312
|
/** Certificate validity in days (default: 365). */
|
|
245
313
|
validity?: number;
|
|
314
|
+
/**
|
|
315
|
+
* Certificate validity in milliseconds.
|
|
316
|
+
*
|
|
317
|
+
* When provided, takes precedence over {@link validity} and enables
|
|
318
|
+
* sub-day validity (e.g. 10-minute certificates for renewal demos).
|
|
319
|
+
*/
|
|
320
|
+
validityMs?: number;
|
|
246
321
|
/** Certificate start date (default: now). */
|
|
247
322
|
startDate?: Date;
|
|
248
323
|
/** RSA key size in bits (default: 2048). */
|
|
@@ -270,7 +345,61 @@ declare class CertificateAuthority {
|
|
|
270
345
|
readonly subject: Subject;
|
|
271
346
|
/** @internal Parent CA (undefined for root CAs). */
|
|
272
347
|
readonly _issuerCA?: CertificateAuthority;
|
|
348
|
+
/** @internal Configured CDP / AIA URLs (US-202). */
|
|
349
|
+
private _crlDistributionUrl?;
|
|
350
|
+
private _ocspResponderUrl?;
|
|
351
|
+
private _caIssuersUrl?;
|
|
273
352
|
constructor(options: CertificateAuthorityOptions);
|
|
353
|
+
/**
|
|
354
|
+
* Public URL where the CRL produced by this CA is reachable, or
|
|
355
|
+
* `undefined` if no CDP extension should be emitted on issued certs.
|
|
356
|
+
*/
|
|
357
|
+
get crlDistributionUrl(): string | undefined;
|
|
358
|
+
/**
|
|
359
|
+
* Public URL of the OCSP responder, or `undefined` if no AIA OCSP
|
|
360
|
+
* leg should be emitted on issued certs.
|
|
361
|
+
*/
|
|
362
|
+
get ocspResponderUrl(): string | undefined;
|
|
363
|
+
/**
|
|
364
|
+
* Public URL where the issuer's certificate can be fetched, or
|
|
365
|
+
* `undefined` if no AIA caIssuers leg should be emitted.
|
|
366
|
+
*/
|
|
367
|
+
get caIssuersUrl(): string | undefined;
|
|
368
|
+
/**
|
|
369
|
+
* Configure the URL embedded as `crlDistributionPoints` in every
|
|
370
|
+
* subsequently-issued certificate. Pass `undefined` to disable
|
|
371
|
+
* the extension entirely. Validated synchronously — throws on
|
|
372
|
+
* empty string, non-http(s) protocol, missing path. Warns (does
|
|
373
|
+
* not throw) when the URL points at loopback.
|
|
374
|
+
*
|
|
375
|
+
* @see US-202
|
|
376
|
+
*/
|
|
377
|
+
setCrlDistributionUrl(url: string | undefined): void;
|
|
378
|
+
/**
|
|
379
|
+
* Configure the OCSP responder URL embedded as the `OCSP` leg of
|
|
380
|
+
* the `authorityInfoAccess` extension on every subsequently-issued
|
|
381
|
+
* certificate. Pass `undefined` to disable.
|
|
382
|
+
*
|
|
383
|
+
* @see US-202
|
|
384
|
+
*/
|
|
385
|
+
setOcspResponderUrl(url: string | undefined): void;
|
|
386
|
+
/**
|
|
387
|
+
* Configure the caIssuers URL embedded as the `caIssuers` leg of
|
|
388
|
+
* the `authorityInfoAccess` extension on every subsequently-issued
|
|
389
|
+
* certificate. Pass `undefined` to disable.
|
|
390
|
+
*
|
|
391
|
+
* @see US-202
|
|
392
|
+
*/
|
|
393
|
+
setCaIssuersUrl(url: string | undefined): void;
|
|
394
|
+
/**
|
|
395
|
+
* @internal
|
|
396
|
+
* Populate the OpenSSL config substitution env vars (`CDP_URL` and
|
|
397
|
+
* `AIA_VALUE`) from the configured URLs, or unset them so the
|
|
398
|
+
* matching `{{#KEY}}...{{/KEY}}` blocks in the templates are
|
|
399
|
+
* stripped. MUST be called before every `generateStaticConfig`
|
|
400
|
+
* invocation that signs a certificate.
|
|
401
|
+
*/
|
|
402
|
+
_wireRevocationEnvVars(): void;
|
|
274
403
|
/** Absolute path to the CA root directory (alias for {@link location}). */
|
|
275
404
|
get rootDir(): string;
|
|
276
405
|
/** Path to the OpenSSL configuration file (`conf/caconfig.cnf`). */
|
|
@@ -399,6 +528,28 @@ declare class CertificateAuthority {
|
|
|
399
528
|
* @returns the signed certificate as a DER-encoded buffer
|
|
400
529
|
*/
|
|
401
530
|
signCertificateRequestFromDER(csrDer: Buffer, options?: SignCertificateOptions): Promise<Buffer>;
|
|
531
|
+
/**
|
|
532
|
+
* Advertise the validity limits this CA can honor.
|
|
533
|
+
*
|
|
534
|
+
* Consumers (notably the GDS server in [`cert_auth.ts`](https://github.com/sterfive/node-opcua-gds))
|
|
535
|
+
* clamp a requested validity against these bounds before calling
|
|
536
|
+
* {@link signCertificateRequestFromDER}, so a misconfigured
|
|
537
|
+
* `defaultCertValidity` cannot ask the CA for something it cannot
|
|
538
|
+
* produce.
|
|
539
|
+
*
|
|
540
|
+
* Defaults match the OpenSSL-backed implementation:
|
|
541
|
+
* - `minValidityMs = 60_000` (1 minute) — practical floor; the
|
|
542
|
+
* X.509 spec floor is 1 second but very short certs are rarely
|
|
543
|
+
* useful and pathological for any real deployment.
|
|
544
|
+
* - `maxValidityMs = 10 * 365 * 86_400_000` (≈ 10 years) — long
|
|
545
|
+
* enough for root CAs.
|
|
546
|
+
* - `validityGranularityMs = 1_000` (1 second) — RFC 5280 §4.1.2.5
|
|
547
|
+
* floor on `notBefore` / `notAfter`.
|
|
548
|
+
* - `nativeUnit = "second"` — what `x509Date()` actually encodes.
|
|
549
|
+
*
|
|
550
|
+
* @see US-208 — the consumer-side capability story.
|
|
551
|
+
*/
|
|
552
|
+
getCapabilities(): PkiBackendCapabilities;
|
|
402
553
|
/**
|
|
403
554
|
* Generate a new RSA key pair, create an internal CSR, sign it
|
|
404
555
|
* with this CA, and return both the certificate and private key
|
|
@@ -1364,4 +1515,4 @@ declare function dumpPFX(pfxFile: Filename, passphrase?: string): Promise<string
|
|
|
1364
1515
|
*/
|
|
1365
1516
|
declare function install_prerequisite(): Promise<string>;
|
|
1366
1517
|
|
|
1367
|
-
export { type AddCertificateValidationOptions, CertificateAuthority, type CertificateAuthorityOptions, CertificateManager, type CertificateManagerEvents, type CertificateManagerOptions, CertificateManagerState, type CertificateStatus, type CertificateStore, type ChainCompletionResult, ChainCompletionStatus, type CreateCertificateSigningRequestOptions, type CreateCertificateSigningRequestWithConfigOptions, type CreatePFXOptions, type CreateSelfSignCertificateParam, type CreateSelfSignCertificateParam1, type CreateSelfSignCertificateWithConfigParam, type CrlStore, type ExtractPFXOptions, type ExtractPFXResult, type Filename, type GenerateKeyPairAndSignOptions, type GenerateKeyPairAndSignPFXOptions, type InitializeCSRResult, type InstallCACertificateResult, type KeyLength, type KeySize, type Params, type ProcessAltNamesParam, type SignCertificateOptions, type StartDateEndDateParam, type Thumbprint, VerificationStatus, type VerifyCertificateOptions, adjustApplicationUri, adjustDate, coerceCertificateChain, convertPFXtoPEM, createPFX, dumpPFX, extractAllFromPFX, extractCACertificatesFromPFX, extractCertificateFromPFX, extractPrivateKeyFromPFX, findIssuerCertificateInChain, install_prerequisite, isIntermediateIssuer, isIssuer, isRootIssuer, makeFingerprint, quote };
|
|
1518
|
+
export { type AddCertificateValidationOptions, CertificateAuthority, type CertificateAuthorityOptions, CertificateManager, type CertificateManagerEvents, type CertificateManagerOptions, CertificateManagerState, type CertificateStatus, type CertificateStore, type ChainCompletionResult, ChainCompletionStatus, type CreateCertificateSigningRequestOptions, type CreateCertificateSigningRequestWithConfigOptions, type CreatePFXOptions, type CreateSelfSignCertificateParam, type CreateSelfSignCertificateParam1, type CreateSelfSignCertificateWithConfigParam, type CrlStore, type ExtractPFXOptions, type ExtractPFXResult, type Filename, type GenerateKeyPairAndSignOptions, type GenerateKeyPairAndSignPFXOptions, type InitializeCSRResult, type InstallCACertificateResult, type KeyLength, type KeySize, type Params, type PkiBackendCapabilities, type ProcessAltNamesParam, type SignCertificateOptions, type StartDateEndDateParam, type Thumbprint, VerificationStatus, type VerifyCertificateOptions, adjustApplicationUri, adjustDate, coerceCertificateChain, convertPFXtoPEM, createPFX, dumpPFX, extractAllFromPFX, extractCACertificatesFromPFX, extractCertificateFromPFX, extractPrivateKeyFromPFX, findIssuerCertificateInChain, install_prerequisite, isIntermediateIssuer, isIssuer, isRootIssuer, makeFingerprint, quote };
|