@originator-profile/verify 0.4.0-beta.1

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.
@@ -0,0 +1,532 @@
1
+ import { JwtVcDecodingResult, JwtVcVerificationResult, UnverifiedJwtVc, VerifiedJwtVc, VcValidator } from '@originator-profile/securing-mechanism';
2
+ import { ContentAttestation, Target, ContentAttestationSet, JwtOpPayload, JwtDpPayload, Op, Dp, OpVc, Jwk, CoreProfile, Certificate as Certificate$1, WebMediaProfile, WebsiteProfile, ArticleCA, JapaneseExistenceCertificate, OriginatorProfileSet, SiteProfile, CertificationSystem, AllowedOrigin } from '@originator-profile/model';
3
+ import { Keys } from '@originator-profile/cryptography';
4
+ import { DigestSriContent, ContentFetcher, ElementSelector } from '@originator-profile/sign';
5
+ import { ErrorObject } from 'ajv';
6
+ import { JWTVerifyResult, ResolvedKey, JWTPayload } from 'jose';
7
+ import { JOSEError } from 'jose/errors';
8
+
9
+ /** Content Attestation 復号失敗 */
10
+ type CaDecodingFailure = JwtVcDecodingResult<ContentAttestation>;
11
+ /** 復号済み Content Attestation */
12
+ type DecodedCa = UnverifiedJwtVc<ContentAttestation>;
13
+ /** Content Attestation 復号結果 */
14
+ type CaDecodingResult = DecodedCa | CaInvalid;
15
+ /** Content Attestation 検証失敗 */
16
+ type CaVerificationFailure = JwtVcVerificationResult<ContentAttestation>;
17
+ /** 検証済み Content Attestation */
18
+ type VerifiedCa<T extends ContentAttestation = ContentAttestation> = VerifiedJwtVc<T>;
19
+ /** Content Attestation 検証結果 */
20
+ type CaVerificationResult<T extends ContentAttestation = ContentAttestation> = VerifiedCa<T> | CaInvalid | CaVerifyFailed;
21
+
22
+ /**
23
+ * Content Attestation 無効
24
+ *
25
+ * Content Attestation が無効な形式です。詳細は result プロパティに格納される CaInvalid クラスインスタンスのメッセージを確認してください。
26
+ */
27
+ declare class CaInvalid extends Error {
28
+ result: CaDecodingFailure;
29
+ static get code(): string;
30
+ readonly code: string;
31
+ constructor(message: string, result: CaDecodingFailure);
32
+ }
33
+ /**
34
+ * Content Attestation 検証失敗
35
+ *
36
+ * Content Attestation の検証に失敗しました。詳細は result プロパティに格納される CaVerifyFailed クラスインスタンスのメッセージを確認してください。
37
+ **/
38
+ declare class CaVerifyFailed extends Error {
39
+ result: CaVerificationFailure;
40
+ static get code(): string;
41
+ readonly code: string;
42
+ constructor(message: string, result: CaVerificationFailure);
43
+ }
44
+
45
+ /**
46
+ * `digestSRI` の検証
47
+ * @see {@link https://www.w3.org/TR/SRI/#the-integrity-attribute}
48
+ * @example
49
+ * ```ts
50
+ * const content: DigestSriContent = {
51
+ * id: "<URL>",
52
+ * digestSRI: "sha256-...",
53
+ * };
54
+ *
55
+ * await verifyDigestSri(content); // true or false
56
+ * ```
57
+ */
58
+ declare function verifyDigestSri(content: DigestSriContent, fetcher?: typeof fetch): Promise<boolean>;
59
+
60
+ type IntegrityVerifyResult = {
61
+ valid: boolean;
62
+ failedIntegrities: ReadonlyArray<string>;
63
+ };
64
+ /** Target Integrity のコンテンツ取得・要素位置特定アルゴリズム */
65
+ declare const TargetIntegrityAlgorithm: {
66
+ HtmlTargetIntegrity: {
67
+ contentFetcher: ContentFetcher;
68
+ elementSelector: ElementSelector;
69
+ };
70
+ TextTargetIntegrity: {
71
+ contentFetcher: ContentFetcher;
72
+ elementSelector: ElementSelector;
73
+ };
74
+ VisibleTextTargetIntegrity: {
75
+ contentFetcher: ContentFetcher;
76
+ elementSelector: ElementSelector;
77
+ };
78
+ ExternalResourceTargetIntegrity: {
79
+ contentFetcher: ContentFetcher;
80
+ elementSelector: ElementSelector;
81
+ };
82
+ };
83
+ /**
84
+ * Target Integrity の検証
85
+ * @see {@link https://docs.originator-profile.org/opb/content-integrity-descriptor/}
86
+ * @example
87
+ * ```ts
88
+ * const content = {
89
+ * type: "HtmlTargetIntegrity", // or ***TargetIntegrity
90
+ * cssSelector: "<CSS セレクター>",
91
+ * integrity: "sha256-...",
92
+ * };
93
+ *
94
+ * await verifyIntegrity(content); // true or false
95
+ * ```
96
+ */
97
+ declare function verifyIntegrity(content: Target, doc?: Document, fetcher?: typeof fetch): Promise<IntegrityVerifyResult>;
98
+ type VerifyIntegrity = typeof verifyIntegrity;
99
+
100
+ /**
101
+ * Content Attestation 検証機の作成
102
+ * @param ca Content Attestation
103
+ * @param keys Content Attestation の発行者の検証鍵
104
+ * @param issuer Content Attestation の発行者
105
+ * @param url 検証対象のURL
106
+ * @param verifyIntegrity Target Integrity の検証器
107
+ * @param validator バリデーター
108
+ * @returns 検証機
109
+ */
110
+ declare function CaVerifier<T extends ContentAttestation>(ca: string, keys: Keys, issuer: string, url: URL, verifyIntegrity?: VerifyIntegrity, validator?: VcValidator<VerifiedCa<T>>): () => Promise<CaVerificationResult<T>>;
111
+
112
+ /** COntent Attestation Set 要素 */
113
+ type CasItem<Ca> = {
114
+ main: boolean;
115
+ attestation: Ca;
116
+ };
117
+ /** 検証済み Content Attestation Set */
118
+ type VerifiedCas<Ca extends ContentAttestation = ContentAttestation> = Array<CasItem<VerifiedCa<Ca>>>;
119
+ /** Content Attestation Set 検証失敗 */
120
+ type CasVerificationFailure = Exclude<CasItem<CaVerificationResult>, CaVerificationResult>[];
121
+ /** Content Attestation Set 検証結果 */
122
+ type CasVerificationResult<T extends ContentAttestation = ContentAttestation> = VerifiedCas<T> | CasVerifyFailed;
123
+
124
+ /**
125
+ * Content Attestation Set 検証失敗
126
+ *
127
+ * Content Attestation Set の検証に失敗しました。詳細は result プロパティに格納される CaVerifyFailed クラスインスタンスのメッセージを確認してください。
128
+ **/
129
+ declare class CasVerifyFailed extends Error {
130
+ result: CasVerificationFailure;
131
+ static get code(): string;
132
+ readonly code: string;
133
+ constructor(message: string, result: CasVerificationFailure);
134
+ }
135
+
136
+ /**
137
+ * Content Attestation Set 要素の正規化
138
+ *
139
+ * @example
140
+ * ```ts
141
+ * const cas = ["eyJ...", { main: true, attestation: "eyJ..." }];
142
+ * const normalized = normalizeCasItem(cas);
143
+ * normalized; // [{ main: false, attestation: "eyJ..." }, { main: true, attestation: "eyJ..." }]
144
+ * ```
145
+ * */
146
+ declare function normalizeCasItem<Ca>(ca: Ca | CasItem<Ca>): CasItem<Ca>;
147
+
148
+ /**
149
+ * Content Attestation Set の検証
150
+ * @param cas Content Attestation Set
151
+ * @param verifiedOps 検証済み Originator Profile Set
152
+ * @param url 検証対象のURL
153
+ * @param verifyIntegrity Target Integrity の検証器
154
+ * @param validator バリデーター
155
+ * @returns CAS 検証結果
156
+ *
157
+ * @example
158
+ * ```ts
159
+ * import { verifyIntegirty } from "@originator-profile/verify";
160
+ *
161
+ * const cas = ["eyJ...", { main: true, attestation: "eyJ..." }];
162
+ * const verifiedOps; // VerifiedOps
163
+ * const url = location.href;
164
+ * const verified = await verifyCas(cas, verifiedOps, url, verifyIntegrity);
165
+ * if (verified instanceof Error) {
166
+ * verified; // CasVerifyFailed
167
+ * process.exit(1);
168
+ * }
169
+ * verified; // VerifiedCas
170
+ * ```
171
+ */
172
+ declare function verifyCas<T extends ContentAttestation = ContentAttestation>(cas: ContentAttestationSet, verifiedOps: VerifiedOps, url: string, verifyIntegrity: VerifyIntegrity, validator?: typeof VcValidator): Promise<CasVerificationResult<T>>;
173
+
174
+ interface ProfilePair {
175
+ op: {
176
+ iss: string;
177
+ sub: string;
178
+ profile: string;
179
+ };
180
+ dp: {
181
+ sub: string;
182
+ profile: string;
183
+ };
184
+ }
185
+ interface WebsiteProfilePair {
186
+ "@context": string;
187
+ website: ProfilePair;
188
+ }
189
+ interface AdProfilePair {
190
+ "@context": string;
191
+ ad: ProfilePair;
192
+ }
193
+ /** Profile の Token の復号結果 */
194
+ type DecodeResult = {
195
+ op: true;
196
+ payload: JwtOpPayload;
197
+ jwt: string;
198
+ } | {
199
+ dp: true;
200
+ payload: JwtDpPayload;
201
+ jwt: string;
202
+ } | ProfileClaimsValidationFailed;
203
+ /** Profile の Token の検証結果 */
204
+ type VerifyTokenResult = (JWTVerifyResult & ResolvedKey & ({
205
+ op: Op;
206
+ jwt: string;
207
+ } | {
208
+ dp: Dp;
209
+ jwt: string;
210
+ })) | ProfileClaimsValidationFailed | ProfileTokenVerifyFailed;
211
+ /** Profile Set */
212
+ type Profiles = {
213
+ profile: string[];
214
+ ad?: ProfilePair[];
215
+ };
216
+ /** Profile の検証結果 */
217
+ type VerifyResult = VerifyTokenResult | ProfilesResolveFailed | ProfilesVerifyFailed;
218
+ /** Profile Set の検証結果 */
219
+ type VerifyResults = VerifyResult[];
220
+
221
+ declare class ProfileGenericError extends Error {
222
+ static get code(): string;
223
+ readonly code: string;
224
+ }
225
+ declare class ProfileClaimsValidationFailed extends ProfileGenericError {
226
+ static get code(): "ERR_PROFILE_CLAIMS_VALIDATION_FAILED";
227
+ readonly code: "ERR_PROFILE_CLAIMS_VALIDATION_FAILED";
228
+ /** 復号結果 */
229
+ result: {
230
+ error?: JOSEError;
231
+ errors?: ErrorObject[];
232
+ payload?: JWTPayload;
233
+ jwt: string;
234
+ };
235
+ constructor(message: string, result: ProfileClaimsValidationFailed["result"]);
236
+ }
237
+ declare class ProfileTokenVerifyFailed extends ProfileGenericError {
238
+ static get code(): "ERR_PROFILE_TOKEN_VERIFY_FAILED";
239
+ readonly code: "ERR_PROFILE_TOKEN_VERIFY_FAILED";
240
+ /** 検証結果 */
241
+ result: Exclude<DecodeResult, ProfileGenericError> & {
242
+ error?: JOSEError;
243
+ };
244
+ constructor(message: string, result: ProfileTokenVerifyFailed["result"]);
245
+ }
246
+ declare class ProfileBodyExtractFailed extends ProfileGenericError {
247
+ static get code(): "ERR_PROFILE_BODY_EXTRACT_FAILED";
248
+ readonly code: "ERR_PROFILE_BODY_EXTRACT_FAILED";
249
+ }
250
+ declare class ProfileBodyVerifyFailed extends ProfileGenericError {
251
+ static get code(): "ERR_PROFILE_BODY_VERIFY_FAILED";
252
+ readonly code: "ERR_PROFILE_BODY_VERIFY_FAILED";
253
+ /** 検証結果 */
254
+ result: {
255
+ error?: JOSEError;
256
+ body: string;
257
+ };
258
+ constructor(message: string, result: ProfileBodyVerifyFailed["result"]);
259
+ }
260
+ declare class ProfilesResolveFailed extends ProfileGenericError {
261
+ static get code(): "ERR_PROFILES_RESOLVE_FAILED";
262
+ readonly code: "ERR_PROFILES_RESOLVE_FAILED";
263
+ /** 検証結果 */
264
+ result: Exclude<DecodeResult, ProfileGenericError>;
265
+ constructor(message: string, result: ProfilesResolveFailed["result"]);
266
+ }
267
+ declare class ProfilesVerifyFailed extends ProfileGenericError {
268
+ static get code(): "ERR_PROFILES_VERIFY_FAILED";
269
+ readonly code: "ERR_PROFILES_VERIFY_FAILED";
270
+ /** 検証結果 */
271
+ result: Exclude<DecodeResult | VerifyTokenResult, ProfileGenericError>;
272
+ constructor(message: string, result: ProfilesVerifyFailed["result"]);
273
+ }
274
+ declare class CertificationSystemValidationFailed extends ProfileGenericError {
275
+ static get code(): "ERR_CERTIFICATION_SYSTEM_VALIDATION_FAILED";
276
+ readonly code: "ERR_CERTIFICATION_SYSTEM_VALIDATION_FAILED";
277
+ /** 検証結果 */
278
+ result: {
279
+ payload?: unknown;
280
+ };
281
+ constructor(message: string, result: CertificationSystemValidationFailed["result"]);
282
+ }
283
+
284
+ // Definitions by: Eddie Atkinson <https://github.com/eddie-atkinson>
285
+
286
+ type Operation = "add" | "replace" | "remove" | "move";
287
+
288
+ type DiffOps = Array<{
289
+ op: Operation;
290
+ path: Array<string | number>;
291
+ value?: any;
292
+ }>;
293
+ type PathConverter = (path: string) => string[];
294
+
295
+ declare function diffApply<T extends object>(
296
+ obj: T,
297
+ diff: DiffOps,
298
+ pathConverter?: PathConverter
299
+ ): T;
300
+
301
+ /**
302
+ * JSON Patch を適用する関数
303
+ *
304
+ * @link https://jsonpatch.com/
305
+ */
306
+ declare const patch: <T extends object>(...args: Parameters<typeof diffApply<T>>) => T;
307
+ /**
308
+ * VerifyResult ファクトリー
309
+ *
310
+ * @link https://reference.originator-profile.org/ts/types/_originator-profile_securing-mechanism.UnverifiedJwtVc
311
+ * @link https://reference.originator-profile.org/ts/types/_originator-profile_securing-mechanism.VerifiedJwtVc
312
+ */
313
+ declare const VerifyResultFactory: (issuedAt: Date, expiredAt: Date) => {
314
+ create: (vc: OpVc, jwt: string, verificationKey?: Jwk, validated?: boolean) => UnverifiedJwtVc<OpVc> | VerifiedJwtVc<OpVc>;
315
+ };
316
+ /** OP ID Constants */
317
+ declare const opId: {
318
+ /** CP 発行者 */
319
+ authority: "dns:cp-issuer.example.org";
320
+ /** PA 発行者 */
321
+ certifier: "dns:pa-issuer.example.org";
322
+ /** CA 発行者 */
323
+ originator: "dns:originator.example.org";
324
+ /** 無効な第三者 */
325
+ invalid: "dns:invalid.example.org";
326
+ };
327
+ /** Core Profile */
328
+ declare const cp: CoreProfile;
329
+ /** Certificate */
330
+ declare const certificate: Certificate$1;
331
+ /** Web Media Profile */
332
+ declare const wmp: WebMediaProfile;
333
+ /** Website Profile */
334
+ declare const wsp: WebsiteProfile;
335
+ /** CA ID */
336
+ declare const caId = "urn:uuid:78550fa7-f846-4e0f-ad5c-8d34461cb95b";
337
+ /** CA URL */
338
+ declare const caUrl: URL;
339
+ /** Article CA */
340
+ declare const article: ArticleCA;
341
+
342
+ /**
343
+ * Originator Profile Set 無効
344
+ *
345
+ * Originator Profile Set が無効な形式です。詳細は result プロパティに格納される OpInvalid クラスインスタンスのメッセージを確認してください。
346
+ */
347
+ declare class OpsInvalid extends Error {
348
+ result: OpsDecodingFailure;
349
+ static get code(): string;
350
+ readonly code: string;
351
+ constructor(message: string, result: OpsDecodingFailure);
352
+ }
353
+ /**
354
+ * Originator Profile 無効
355
+ *
356
+ * Originator Profile が無効な形式です。次の原因で使用されます。
357
+ *
358
+ * - Core Profile の復号に失敗した
359
+ * - Profile Annotation の復号に失敗した
360
+ * - Web Media Profile の復号に失敗した
361
+ * - Core Profile と Profile Annotation の `credentialSubject.id` が不一致
362
+ * - Core Profile と Web Media Profile の `credentialSubject.id` が不一致
363
+ */
364
+ declare class OpInvalid extends Error {
365
+ result: OpDecodingFailure;
366
+ static get code(): string;
367
+ readonly code: string;
368
+ constructor(message: string, result: OpDecodingFailure);
369
+ }
370
+ /**
371
+ * Core Profile 未発見
372
+ *
373
+ * Core Profile が見つかりませんでした。次の原因で使用されます。
374
+ *
375
+ * - Core Profile が Originator Profile Set に含まれていない
376
+ * - Core Profile の検証結果が見つからなかった
377
+ */
378
+ declare class CoreProfileNotFound<T extends OpVc> extends Error {
379
+ result: UnverifiedJwtVc<T>;
380
+ static get code(): string;
381
+ readonly code: string;
382
+ constructor(message: string, result: UnverifiedJwtVc<T>);
383
+ }
384
+ /**
385
+ * Originator Profile Set 検証失敗
386
+ *
387
+ * Originator Profile Set の検証に失敗しました。詳細は result プロパティに格納される OpVerifyFailed クラスインスタンスのメッセージを確認してください。
388
+ **/
389
+ declare class OpsVerifyFailed extends Error {
390
+ result: OpsVerificationFailure;
391
+ static get code(): string;
392
+ readonly code: string;
393
+ constructor(message: string, result: OpsVerificationFailure);
394
+ }
395
+ /**
396
+ * Originator Profile 検証失敗
397
+ *
398
+ * Originator Profile の検証に失敗しました。次の原因で使用されます。
399
+ *
400
+ * - Core Profile の検証に失敗した
401
+ * - Profile Annotation の検証に失敗した
402
+ * - Web Media Profile の検証に失敗した
403
+ *
404
+ * ここでの検証の失敗とは、次の原因を含みます。
405
+ *
406
+ * - 復号に失敗した
407
+ * - Core Profile の検証結果が見つからなかった
408
+ * - Profile Annotation 発行者の Core Profile が見つからなかった
409
+ * - Web Media Profile 発行者の Core Profile が見つからなかった
410
+ * - 署名の検証に失敗した
411
+ **/
412
+ declare class OpVerifyFailed extends Error {
413
+ result: OpVerificationFailure;
414
+ static get code(): string;
415
+ readonly code: string;
416
+ constructor(message: string, result: OpVerificationFailure);
417
+ }
418
+
419
+ type Certificate = Certificate$1 | JapaneseExistenceCertificate;
420
+ /** Originator Profile 復号失敗 */
421
+ type OpDecodingFailure = {
422
+ core: JwtVcDecodingResult<CoreProfile>;
423
+ annotations?: JwtVcDecodingResult<Certificate>[];
424
+ media?: JwtVcDecodingResult<WebMediaProfile>;
425
+ };
426
+ /** 復号済み Originator Profile */
427
+ type DecodedOp = {
428
+ core: UnverifiedJwtVc<CoreProfile>;
429
+ annotations?: UnverifiedJwtVc<Certificate>[];
430
+ media: UnverifiedJwtVc<WebMediaProfile>;
431
+ };
432
+ /** Originator Profile 復号結果 */
433
+ type OpDecodingResult = DecodedOp | OpInvalid;
434
+ /** Originator Profile Set 復号失敗 */
435
+ type OpsDecodingFailure = OpDecodingResult[];
436
+ /** 復号済み Originator Profile Set */
437
+ type DecodedOps = DecodedOp[];
438
+ /** Originator Profile Set 復号結果 */
439
+ type OpsDecodingResult = DecodedOps | OpsInvalid;
440
+ /** Originator Profile 検証失敗 */
441
+ type OpVerificationFailure = {
442
+ core: JwtVcVerificationResult<CoreProfile> | CoreProfileNotFound<CoreProfile>;
443
+ annotations?: (JwtVcVerificationResult<Certificate> | CoreProfileNotFound<Certificate>)[];
444
+ media?: JwtVcVerificationResult<WebMediaProfile> | CoreProfileNotFound<WebMediaProfile>;
445
+ };
446
+ /** 検証済み Originator Profile */
447
+ type VerifiedOp = {
448
+ core: VerifiedJwtVc<CoreProfile>;
449
+ annotations?: VerifiedJwtVc<Certificate>[];
450
+ media?: VerifiedJwtVc<WebMediaProfile>;
451
+ };
452
+ /** Originator Profile 検証結果 */
453
+ type OpVerificationResult = VerifiedOp | OpVerifyFailed;
454
+ /** Originator Profile Set 検証失敗 */
455
+ type OpsVerificationFailure = OpVerificationResult[];
456
+ /** 検証済み Originator Profile Set */
457
+ type VerifiedOps = VerifiedOp[];
458
+ /** Originator Profile Set 検証結果 */
459
+ type OpsVerificationResult = VerifiedOps | OpsInvalid | OpsVerifyFailed;
460
+
461
+ /**
462
+ * Originator Profile Set の復号
463
+ * @param ops Originator Profile Set
464
+ * @returns 復号結果
465
+ */
466
+ declare function decodeOps(ops: OriginatorProfileSet): OpsDecodingResult;
467
+
468
+ /**
469
+ * Originator Profile Set の検証者の作成
470
+ * @param ops Originator Profile Set
471
+ * @param keys Core Profile の発行者の検証鍵
472
+ * @param issuer Core Profile の発行者
473
+ * @param validator バリデーター
474
+ * @returns 検証者
475
+ */
476
+ declare function OpsVerifier(ops: OriginatorProfileSet, keys: Keys, issuer: string | string[], validator?: typeof VcValidator): () => Promise<OpsVerificationResult>;
477
+
478
+ declare class SiteProfileInvalid extends Error {
479
+ result: SpVerificationFailure;
480
+ static get code(): "ERR_SITE_PROFILE_INVALID";
481
+ readonly code: "ERR_SITE_PROFILE_INVALID";
482
+ constructor(message: string, result: SpVerificationFailure);
483
+ }
484
+ declare class SiteProfileVerifyFailed extends Error {
485
+ result: SpVerificationFailure;
486
+ static get code(): "ERR_SITE_PROFILE_VERIFY_FAILED";
487
+ readonly code: "ERR_SITE_PROFILE_VERIFY_FAILED";
488
+ constructor(message: string, result: SpVerificationFailure);
489
+ }
490
+
491
+ /** Site Profile 検証失敗 */
492
+ type SpVerificationFailure = {
493
+ originators: OpsVerificationResult;
494
+ credential?: JwtVcVerificationResult<WebsiteProfile> | JwtVcDecodingResult<WebsiteProfile> | CoreProfileNotFound<WebsiteProfile>;
495
+ };
496
+ type VerifiedSp = {
497
+ originators: VerifiedOps;
498
+ credential: VerifiedJwtVc<WebsiteProfile>;
499
+ };
500
+ type SpVerificationResult = VerifiedSp | SiteProfileInvalid | SiteProfileVerifyFailed;
501
+
502
+ /**
503
+ * Site Profile の検証者の作成
504
+ * @param sp Site Profile
505
+ * @param keys Core Profile の発行者の検証鍵
506
+ * @param issuer Core Profile の発行者
507
+ * @param origin 提示するWebサイトを識別するための RFC 6454 オリジン
508
+ * @param verifyOrigin WSPが提示されたWebサイトのorigin引数との一致性検証の可否 (デフォルト: 有効)
509
+ * @param validator バリデーター
510
+ * @returns 検証者
511
+ */
512
+ declare function SpVerifier(sp: SiteProfile, keys: Keys, issuer: string | string[], origin: URL["origin"], verifyOrigin?: boolean, validator?: typeof VcValidator): () => Promise<SpVerificationResult>;
513
+
514
+ /** 認証制度ペイロードの確認のためのバリデーター */
515
+ declare function CertificationSystemValidator(): (payload: unknown) => true | CertificationSystemValidationFailed;
516
+ type CertificationSystemValidator = ReturnType<typeof CertificationSystemValidator>;
517
+ /**
518
+ * 認証制度の検証
519
+ * @param payload ペイロード
520
+ * @return 検証結果
521
+ */
522
+ declare function validateCertificationSystem(payload: unknown): CertificationSystem | CertificationSystemValidationFailed;
523
+
524
+ /**
525
+ * URLオリジンが対象のオリジンの中に含まれているのか検証する
526
+ * @param origin 対象とするオリジン
527
+ * @param allowedOrigins 情報の対象となるオリジン
528
+ * @returns 検証結果: allowedOriginsの中にoriginが含まれていればtrue, それ以外ならfalse
529
+ */
530
+ declare function verifyAllowedOrigin(origin: URL["origin"], allowedOrigins: AllowedOrigin): boolean;
531
+
532
+ export { type AdProfilePair, type CaDecodingFailure, type CaDecodingResult, CaInvalid, type CaVerificationFailure, type CaVerificationResult, CaVerifier, CaVerifyFailed, type CasItem, type CasVerificationFailure, type CasVerificationResult, CasVerifyFailed, type Certificate, CertificationSystemValidationFailed, CertificationSystemValidator, CoreProfileNotFound, type DecodeResult, type DecodedCa, type DecodedOp, type DecodedOps, type IntegrityVerifyResult, type OpDecodingFailure, type OpDecodingResult, OpInvalid, type OpVerificationFailure, type OpVerificationResult, OpVerifyFailed, type OpsDecodingFailure, type OpsDecodingResult, OpsInvalid, type OpsVerificationFailure, type OpsVerificationResult, OpsVerifier, OpsVerifyFailed, ProfileBodyExtractFailed, ProfileBodyVerifyFailed, ProfileClaimsValidationFailed, ProfileGenericError, type ProfilePair, ProfileTokenVerifyFailed, type Profiles, ProfilesResolveFailed, ProfilesVerifyFailed, SiteProfileInvalid, SiteProfileVerifyFailed, type SpVerificationFailure, type SpVerificationResult, SpVerifier, TargetIntegrityAlgorithm, type VerifiedCa, type VerifiedCas, type VerifiedOp, type VerifiedOps, type VerifiedSp, type VerifyIntegrity, type VerifyResult, VerifyResultFactory, type VerifyResults, type VerifyTokenResult, type WebsiteProfilePair, article, caId, caUrl, certificate, cp, decodeOps, normalizeCasItem, opId, patch, validateCertificationSystem, verifyAllowedOrigin, verifyCas, verifyDigestSri, verifyIntegrity, wmp, wsp };