antifraud-data-utils-ts 0.1.10 → 0.2.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/CHANGELOG.md +187 -134
- package/LICENSE +13 -13
- package/README.md +257 -243
- package/dist/cryptography/index.d.ts +1 -0
- package/dist/cryptography/index.d.ts.map +1 -1
- package/dist/cryptography/index.js +1 -0
- package/dist/cryptography/index.js.map +1 -1
- package/dist/cryptography/numeric-qr.d.ts +4 -0
- package/dist/cryptography/numeric-qr.d.ts.map +1 -0
- package/dist/cryptography/numeric-qr.js +22 -0
- package/dist/cryptography/numeric-qr.js.map +1 -0
- package/dist/cryptography/post-quantum-detached-qr.d.ts +14 -0
- package/dist/cryptography/post-quantum-detached-qr.d.ts.map +1 -0
- package/dist/cryptography/post-quantum-detached-qr.js +76 -0
- package/dist/cryptography/post-quantum-detached-qr.js.map +1 -0
- package/dist/encoding/base58btc.d.ts +3 -0
- package/dist/encoding/base58btc.d.ts.map +1 -0
- package/dist/encoding/base58btc.js +19 -0
- package/dist/encoding/base58btc.js.map +1 -0
- package/dist/identity-assurance/antifraud-data-card.d.ts +42 -0
- package/dist/identity-assurance/antifraud-data-card.d.ts.map +1 -0
- package/dist/identity-assurance/antifraud-data-card.js +120 -0
- package/dist/identity-assurance/antifraud-data-card.js.map +1 -0
- package/dist/identity-assurance/didcomm-binary-attachment.d.ts.map +1 -1
- package/dist/identity-assurance/didcomm-binary-attachment.js +1 -18
- package/dist/identity-assurance/didcomm-binary-attachment.js.map +1 -1
- package/dist/identity-assurance/identity-evidence.d.ts.map +1 -1
- package/dist/identity-assurance/identity-evidence.js +1 -16
- package/dist/identity-assurance/identity-evidence.js.map +1 -1
- package/dist/identity-assurance/index.d.ts +1 -0
- package/dist/identity-assurance/index.d.ts.map +1 -1
- package/dist/identity-assurance/index.js +1 -0
- package/dist/identity-assurance/index.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/organization-credentials.d.ts +75 -0
- package/dist/organization-credentials.d.ts.map +1 -0
- package/dist/organization-credentials.js +162 -0
- package/dist/organization-credentials.js.map +1 -0
- package/dist/organization-identity.d.ts +21 -0
- package/dist/organization-identity.d.ts.map +1 -0
- package/dist/organization-identity.js +47 -0
- package/dist/organization-identity.js.map +1 -0
- package/dist/service-conversation.d.ts +40 -0
- package/dist/service-conversation.d.ts.map +1 -0
- package/dist/service-conversation.js +58 -0
- package/dist/service-conversation.js.map +1 -0
- package/docs/ANTIFRAUD_DATA_CARD_V1.md +47 -0
- package/docs/DC4EU_EDUCATION_AND_MEDICAL_CREDENTIALS.md +93 -0
- package/docs/DIDCOMM_SCHEMA_ORG_ATTACHMENTS.md +73 -0
- package/docs/EDUCATION_ADMINISTRATIVE_ASSISTANT_IDENTITY_EVIDENCE.md +90 -0
- package/docs/IDENTITY_VERIFICATION_AND_ATTESTATION.md +354 -0
- package/docs/ORGANIZATION_CONTACT_IDENTITY.md +113 -0
- package/package.json +69 -55
package/README.md
CHANGED
|
@@ -1,243 +1,257 @@
|
|
|
1
|
-
# Antifraud Data Utilities
|
|
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
|
-
and
|
|
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
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
user
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
1
|
+
# Antifraud Data Utilities
|
|
2
|
+
|
|
3
|
+
The executable draft for the non-health
|
|
4
|
+
[Antifraud Data Card v1](docs/ANTIFRAUD_DATA_CARD_V1.md) defines the `afdc:/`
|
|
5
|
+
JSON:API/Schema.org credential transport and its separate `pqc:/` detached
|
|
6
|
+
ML-DSA companion proof.
|
|
7
|
+
|
|
8
|
+
Product-neutral TypeScript contracts for identity verification, evidence,
|
|
9
|
+
attestations and public organization-service discovery.
|
|
10
|
+
|
|
11
|
+
The [organization contact identity guide](docs/ORGANIZATION_CONTACT_IDENTITY.md)
|
|
12
|
+
documents the `organization-identity` entry point. It accepts an explicit email
|
|
13
|
+
or E.164 phone channel and preserves the established actor multihash and
|
|
14
|
+
organization employee DID representation. These pure builders never verify a
|
|
15
|
+
contact, assign a role or replace an organization licence or device grant.
|
|
16
|
+
The related `organization-credentials` entry point builds compatible reviewed
|
|
17
|
+
admission/domain drafts with email or telephone parties and explicitly supplied
|
|
18
|
+
occupation/authority claims; signing and verification remain outside it.
|
|
19
|
+
|
|
20
|
+
The central trust rule is provenance without authority substitution: every
|
|
21
|
+
identity or qualification claim keeps who asserted it, under which authority
|
|
22
|
+
and jurisdiction, from which evidence, at what time, with which proof and
|
|
23
|
+
current status. Employer, university, licensing authority, verifier and subject
|
|
24
|
+
are separate actors even when they support the same claim.
|
|
25
|
+
|
|
26
|
+
The package keeps three concerns separate:
|
|
27
|
+
|
|
28
|
+
1. Canonical business data uses governed Schema.org flat claims.
|
|
29
|
+
2. OpenID Identity Assurance `verified_claims` is an exchange projection.
|
|
30
|
+
3. An attestation records that an authorized actor assessed a subject, claim
|
|
31
|
+
or relationship; it never silently rewrites the assessed source data.
|
|
32
|
+
|
|
33
|
+
The separate `organization-service-catalog` subpath defines a Schema.org-first
|
|
34
|
+
public graph for the legal Organization, department Organizations, Places and
|
|
35
|
+
client Services. Publication is explicit at every level. A public Service must
|
|
36
|
+
reference at least one public Place in its own department; private and unknown
|
|
37
|
+
relationships fail closed. Its DCAT descriptor supports bounded marketplace
|
|
38
|
+
cache refresh, withdrawal and rollback detection without becoming proof that
|
|
39
|
+
the publisher is trusted.
|
|
40
|
+
|
|
41
|
+
Schedules, Slots, Appointments, subjects and research studies do not belong in
|
|
42
|
+
that dataset. The builder emits no FHIR resources. A later sector adapter may
|
|
43
|
+
translate the canonical Schema.org graph when required.
|
|
44
|
+
|
|
45
|
+
It also exports the reviewed, stateless shared cryptography engine through
|
|
46
|
+
`antifraud-data-utils-ts/cryptography`. The engine preserves the existing
|
|
47
|
+
`gdc-common-utils-ts` confidential envelope: a fresh AES-256-GCM content key is
|
|
48
|
+
wrapped for the recipient with ML-KEM-768, HKDF-SHA-256 and AES-256-GCM key
|
|
49
|
+
wrap. ML-DSA-65 signs or verifies exact bytes. The engine never stores a private
|
|
50
|
+
key, unlock secret or plaintext key; managed wallets and KMS adapters retain
|
|
51
|
+
custody and authorization.
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
import {
|
|
55
|
+
CryptographyService,
|
|
56
|
+
type ICryptoHelper,
|
|
57
|
+
} from 'antifraud-data-utils-ts/cryptography'
|
|
58
|
+
|
|
59
|
+
const cryptography = new CryptographyService(runtimeCryptoHelper)
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
`defineManagedSignatureRequest` creates only a pending request. It binds the
|
|
63
|
+
immutable manifest digest to the trusted authenticated user, registered device,
|
|
64
|
+
operation, signer, relying party, purpose and ML-DSA-65 actor-signing key.
|
|
65
|
+
Login, review, delivery, read state and a successful local user-presence
|
|
66
|
+
ceremony are deliberately not represented as signatures. SDK orchestration
|
|
67
|
+
owns authorization, one-use session consumption and proof creation.
|
|
68
|
+
|
|
69
|
+
`buildSocialPublicationManifestDigest` and
|
|
70
|
+
`defineSocialPublicationDemoRecord` close the bounded synthetic publication
|
|
71
|
+
flow. The latter accepts only public content matching the immutable SHA3-384
|
|
72
|
+
manifest, an already verified ML-DSA-65 managed-wallet proof, and an explicit
|
|
73
|
+
in-memory Fabric Demo receipt. It never represents the simulated ledger as a
|
|
74
|
+
real Fabric transaction or turns login and review into signatures.
|
|
75
|
+
|
|
76
|
+
## Current API
|
|
77
|
+
|
|
78
|
+
```ts
|
|
79
|
+
import {
|
|
80
|
+
buildPublicOrganizationServiceCatalog,
|
|
81
|
+
evaluateOrganizationCatalogCache,
|
|
82
|
+
} from 'antifraud-data-utils-ts/organization-service-catalog'
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
```ts
|
|
86
|
+
import {
|
|
87
|
+
ClearingHouseTenantCapability,
|
|
88
|
+
ClaimProofFormat,
|
|
89
|
+
EudiPidClaim,
|
|
90
|
+
IdentityAttestationCapability,
|
|
91
|
+
IdentityEvidenceType,
|
|
92
|
+
QualificationAuthorityKind,
|
|
93
|
+
QualificationVerificationStatus,
|
|
94
|
+
SchemaOrgIdentityClaim,
|
|
95
|
+
SchemaOrgContentIdentifierProfile,
|
|
96
|
+
SchemaOrgDocumentResourceType,
|
|
97
|
+
SchemaOrgQualificationClaim,
|
|
98
|
+
buildDidCommInlineBinaryAttachment,
|
|
99
|
+
buildDidCommLinkedBinaryAttachment,
|
|
100
|
+
buildSchemaOrgConfidentialDocumentGraph,
|
|
101
|
+
buildQualificationLedgerAnchor,
|
|
102
|
+
defineProfessionalQualification,
|
|
103
|
+
defineAuthorizedWorkforceIdentityEvidenceStatement,
|
|
104
|
+
defineClaimProofBinding,
|
|
105
|
+
importOidc4IdaToSchemaOrgFlatClaims,
|
|
106
|
+
projectSchemaOrgFlatClaimsToOidc4Ida,
|
|
107
|
+
selectAuthoritativeTenantEndpoint,
|
|
108
|
+
toSchemaOrgQualificationFlatClaims,
|
|
109
|
+
verifiedClaimsJsonSchema,
|
|
110
|
+
workforceIdentityEvidenceStatementJsonSchema,
|
|
111
|
+
} from 'antifraud-data-utils-ts/identity-assurance'
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
`ClaimProofBinding` connects one canonical claim or derived predicate to one or
|
|
115
|
+
more credential-level proof references. For example, an `age-over` predicate
|
|
116
|
+
can disclose `age_over_18=true` without disclosing the source birth date. An
|
|
117
|
+
SD-JWT VC signs disclosure digests at credential level; the package does not
|
|
118
|
+
misrepresent that mechanism as an independent signature embedded in every
|
|
119
|
+
flat claim.
|
|
120
|
+
|
|
121
|
+
The initial governed projection covers the registered OpenID identity claims
|
|
122
|
+
that have direct Schema.org equivalents. An unknown mapping fails on export.
|
|
123
|
+
Import reports unsupported claims and conflicting existing values instead of
|
|
124
|
+
discarding or overwriting them.
|
|
125
|
+
|
|
126
|
+
An authorized workforce member may record identity evidence only when trusted
|
|
127
|
+
server context supplies the active employee assignment, active membership in a
|
|
128
|
+
controller-governed work group, that group's reusable authorization and
|
|
129
|
+
`identity.evidence.record`. The employee has no separate Consent. A subject or
|
|
130
|
+
lawful representative authorization remains a distinct optional gate when the
|
|
131
|
+
use case requires it. The form collects the evidence observation; it does not
|
|
132
|
+
select the actor, grant permission or sign a credential. Raw identity documents
|
|
133
|
+
are excluded from the statement. Attachments are referenced by digest.
|
|
134
|
+
Schema.org `MediaObject` flat claims describe a scanned artifact and bind its
|
|
135
|
+
protected URL, media type and size to a CIDv1(raw, SHA3-384) identifier encoded
|
|
136
|
+
with multibase base58btc. OpenID Identity Assurance attachment metadata is a
|
|
137
|
+
projection of that same artifact; it is not the canonical store.
|
|
138
|
+
|
|
139
|
+
`buildSchemaOrgConfidentialDocumentGraph` produces a strict JSON:API 1.1
|
|
140
|
+
primary document whose `data[]` contains direct Schema.org
|
|
141
|
+
`DigitalDocument` and `MediaObject` resource objects. A manifest relates its
|
|
142
|
+
documents through `hasPart`; each document relates its concrete file through
|
|
143
|
+
`encoding`. The `MediaObject.identifier` is a `PropertyValue`: `propertyID` is
|
|
144
|
+
`cidv1-raw-sha3-384` and `value` is the complete multibase base58btc CID. The
|
|
145
|
+
builder verifies that the CID embeds a SHA3-384 digest matching the supplied
|
|
146
|
+
digest, requires exact byte size, protected URL and media type, rejects
|
|
147
|
+
duplicate resource identifiers and never accepts raw document bytes.
|
|
148
|
+
|
|
149
|
+
The document graph and the binary transport are deliberately separate.
|
|
150
|
+
Antifraud documents are always Schema.org `DigitalDocument` resources whose
|
|
151
|
+
concrete encodings are Schema.org `MediaObject` resources; they are never FHIR
|
|
152
|
+
`DocumentReference` resources. `buildDidCommInlineBinaryAttachment` carries a
|
|
153
|
+
bounded file as DIDComm `attachments[].data.base64`, while
|
|
154
|
+
`buildDidCommLinkedBinaryAttachment` carries the same governed `MediaObject`
|
|
155
|
+
through `attachments[].data.links` plus its multibase multihash. Both forms
|
|
156
|
+
preserve the Internet media type and exact byte count and work for PDF,
|
|
157
|
+
spreadsheet, word-processing, image, video or another governed media type.
|
|
158
|
+
DIDComm is the delivery transport and does not replace the Schema.org business
|
|
159
|
+
record or become the persistence model. See
|
|
160
|
+
[`docs/DIDCOMM_SCHEMA_ORG_ATTACHMENTS.md`](docs/DIDCOMM_SCHEMA_ORG_ATTACHMENTS.md)
|
|
161
|
+
and [GitHub issue #2](https://github.com/antifraudservices/antifraud-data-utils-ts/issues/2).
|
|
162
|
+
|
|
163
|
+
Historical inputs may have used `identifier.additionalType` to name an
|
|
164
|
+
identifier scheme. `normalizeSchemaOrgContentIdentifier` reads that legacy
|
|
165
|
+
shape for migration, but canonical output uses `PropertyValue.propertyID`.
|
|
166
|
+
Conflicting legacy and canonical values fail closed. Established external
|
|
167
|
+
organization, person or animal identifier contracts are not silently renamed
|
|
168
|
+
by this attachment-specific compatibility rule.
|
|
169
|
+
|
|
170
|
+
A controller or authorized human-resources employee may use the same governed
|
|
171
|
+
flow to record evidence about an employee's identity or qualifications. When a
|
|
172
|
+
qualification refers to a university or another awarding organization, that
|
|
173
|
+
organization must be resolved by its legal identifier and jurisdiction, not by
|
|
174
|
+
display name alone. If no credential from the awarding organization exists,
|
|
175
|
+
the result is an employer attestation about evidence the employer reviewed; it
|
|
176
|
+
must not be represented as a university-issued credential. The employer's
|
|
177
|
+
signature is its own proof. A later university credential or confirmation is
|
|
178
|
+
added as a separate proof for the same claim instead of replacing the employer
|
|
179
|
+
proof.
|
|
180
|
+
|
|
181
|
+
This separation is essential in health and other regulated sectors. Evidence
|
|
182
|
+
of a qualification is not by itself an active professional licence, an active
|
|
183
|
+
employment assignment, or authority to perform an operation. A downstream
|
|
184
|
+
policy evaluates each applicable status independently and fails closed on
|
|
185
|
+
suspension, revocation, expiry, or an authority mismatch.
|
|
186
|
+
|
|
187
|
+
An invitation may propose an optional department and zero or more groups. The
|
|
188
|
+
proposal grants nothing before employee activation. Invitation acceptance and
|
|
189
|
+
later department or group changes require a Communication notice, while the
|
|
190
|
+
shared group authorization remains unchanged for the other active members.
|
|
191
|
+
|
|
192
|
+
The home tenant is the initial trust root. An employer or index-provider tenant
|
|
193
|
+
publishes its own authoritative endpoint. A different source tenant is usable
|
|
194
|
+
only after the home tenant explicitly trusts it and the source advertises the
|
|
195
|
+
required capability. The source tenant reads its stored record before issuing
|
|
196
|
+
an attestation; caller-authored claims are never signed as authoritative data.
|
|
197
|
+
|
|
198
|
+
Professional qualifications use product-neutral Schema.org
|
|
199
|
+
`EducationalOccupationalCredential` flat claims. Employer, awarding body and
|
|
200
|
+
professional-body proofs remain independent. The package does not expose a
|
|
201
|
+
health-specific model or a native FHIR projection. Health applications may
|
|
202
|
+
project this neutral contract to their FHIR version in their own data-utility
|
|
203
|
+
layer. `buildQualificationLedgerAnchor` deliberately excludes personal claims,
|
|
204
|
+
qualification values, legal identifiers, credentials, documents and
|
|
205
|
+
signatures; a shared ledger receives only opaque links, a content hash and
|
|
206
|
+
lifecycle metadata.
|
|
207
|
+
|
|
208
|
+
EUDI Person Identification Data and OpenID Identity Assurance are related but
|
|
209
|
+
different contracts. For example, EUDI PID defines `birth_date` and
|
|
210
|
+
`age_over_18`, while the OpenID `verified_claims.claims` projection uses the
|
|
211
|
+
registered `birthdate` claim. OpenID4VP presents credentials and OpenID4VCI
|
|
212
|
+
issues them; OpenID Identity Assurance describes verified claims and evidence.
|
|
213
|
+
|
|
214
|
+
## Repository boundary
|
|
215
|
+
|
|
216
|
+
This package contains pure types, vocabulary, JSON Schemas, converters,
|
|
217
|
+
validators, synthetic fixtures and stateless cryptographic primitives. It
|
|
218
|
+
contains no user interface, role policy, HTTP client, persistence adapter,
|
|
219
|
+
private-key custody, credential issuer, ledger connection or deployment
|
|
220
|
+
configuration.
|
|
221
|
+
|
|
222
|
+
See [Identity verification and attestation contract](docs/IDENTITY_VERIFICATION_AND_ATTESTATION.md)
|
|
223
|
+
for the normative model and downstream acceptance requirements.
|
|
224
|
+
|
|
225
|
+
See [DC4EU education and medical credential reference](docs/DC4EU_EDUCATION_AND_MEDICAL_CREDENTIALS.md)
|
|
226
|
+
for the upstream European Higher Education Diploma, Doctor ID, professional
|
|
227
|
+
suitability and medical-training credential boundaries and their current draft
|
|
228
|
+
status.
|
|
229
|
+
|
|
230
|
+
See [Education administrative assistant identity-evidence journey](docs/EDUCATION_ADMINISTRATIVE_ASSISTANT_IDENTITY_EVIDENCE.md)
|
|
231
|
+
for the controller-governed employee flow, age predicates and the local
|
|
232
|
+
user-interface acceptance boundary.
|
|
233
|
+
|
|
234
|
+
## Standards
|
|
235
|
+
|
|
236
|
+
- [OpenID Identity Assurance Schema Definition 1.0](https://openid.net/specs/openid-ida-verified-claims-1_0-final.html)
|
|
237
|
+
- [OpenID Connect for Identity Assurance 1.0](https://openid.net/specs/openid-connect-4-identity-assurance-1_0-final.html)
|
|
238
|
+
- [Schema.org Person](https://schema.org/Person)
|
|
239
|
+
- [Schema.org Action](https://schema.org/Action)
|
|
240
|
+
- [Schema.org AssessAction](https://schema.org/AssessAction)
|
|
241
|
+
- [Schema.org EducationalOccupationalCredential](https://schema.org/EducationalOccupationalCredential)
|
|
242
|
+
- [DC4EU EUDI Wallet large-scale pilot](https://ec.europa.eu/digital-building-blocks/sites/spaces/EUDIGITALIDENTITYWALLET/pages/920064520/LSP-DC4EU)
|
|
243
|
+
|
|
244
|
+
## Development
|
|
245
|
+
|
|
246
|
+
Node.js 24 is required.
|
|
247
|
+
|
|
248
|
+
```bash
|
|
249
|
+
npm ci
|
|
250
|
+
npm test
|
|
251
|
+
npm run typecheck
|
|
252
|
+
npm pack --dry-run
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
## License
|
|
256
|
+
|
|
257
|
+
Apache-2.0.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cryptography/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,cAAc,CAAA;AAC5B,cAAc,2BAA2B,CAAA;AACzC,cAAc,YAAY,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cryptography/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,cAAc,CAAA;AAC5B,cAAc,2BAA2B,CAAA;AACzC,cAAc,YAAY,CAAA;AAC1B,cAAc,+BAA+B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cryptography/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,cAAc,CAAA;AAC5B,cAAc,2BAA2B,CAAA;AACzC,cAAc,YAAY,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cryptography/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,cAAc,CAAA;AAC5B,cAAc,2BAA2B,CAAA;AACzC,cAAc,YAAY,CAAA;AAC1B,cAAc,+BAA+B,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Decimal-pair encoding used by compact JWS QR transports. */
|
|
2
|
+
export declare function encodeNumericQrValue(value: string, errorCode: string): string;
|
|
3
|
+
export declare function decodeNumericQrValue(value: string, errorCode: string): string;
|
|
4
|
+
//# sourceMappingURL=numeric-qr.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"numeric-qr.d.ts","sourceRoot":"","sources":["../../src/cryptography/numeric-qr.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAM7E;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAS7E"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Decimal-pair encoding used by compact JWS QR transports. */
|
|
2
|
+
export function encodeNumericQrValue(value, errorCode) {
|
|
3
|
+
return [...value].map(character => {
|
|
4
|
+
const encoded = character.charCodeAt(0) - 45;
|
|
5
|
+
if (encoded < 0 || encoded > 99)
|
|
6
|
+
throw new TypeError(errorCode);
|
|
7
|
+
return encoded.toString().padStart(2, '0');
|
|
8
|
+
}).join('');
|
|
9
|
+
}
|
|
10
|
+
export function decodeNumericQrValue(value, errorCode) {
|
|
11
|
+
if (!value || value.length % 2 || !/^\d+$/u.test(value))
|
|
12
|
+
throw new TypeError(errorCode);
|
|
13
|
+
let result = '';
|
|
14
|
+
for (let index = 0; index < value.length; index += 2) {
|
|
15
|
+
const pair = Number(value.slice(index, index + 2));
|
|
16
|
+
if (pair > 77)
|
|
17
|
+
throw new TypeError(errorCode);
|
|
18
|
+
result += String.fromCharCode(pair + 45);
|
|
19
|
+
}
|
|
20
|
+
return result;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=numeric-qr.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"numeric-qr.js","sourceRoot":"","sources":["../../src/cryptography/numeric-qr.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,MAAM,UAAU,oBAAoB,CAAC,KAAa,EAAE,SAAiB;IACnE,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;QAChC,MAAM,OAAO,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,EAAE,CAAA;QAC5C,IAAI,OAAO,GAAG,CAAC,IAAI,OAAO,GAAG,EAAE;YAAE,MAAM,IAAI,SAAS,CAAC,SAAS,CAAC,CAAA;QAC/D,OAAO,OAAO,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;IAC5C,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACb,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,KAAa,EAAE,SAAiB;IACnE,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,MAAM,IAAI,SAAS,CAAC,SAAS,CAAC,CAAA;IACvF,IAAI,MAAM,GAAG,EAAE,CAAA;IACf,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QACrD,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,CAAA;QAClD,IAAI,IAAI,GAAG,EAAE;YAAE,MAAM,IAAI,SAAS,CAAC,SAAS,CAAC,CAAA;QAC7C,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC,IAAI,GAAG,EAAE,CAAC,CAAA;IAC1C,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const PostQuantumDetachedProofPrefix: "pqc:/";
|
|
2
|
+
export declare const PostQuantumDetachedProofDefaultQrCount = 2;
|
|
3
|
+
/** Wraps a validated RFC 7797 detached ML-DSA JWS without interpreting its external payload. */
|
|
4
|
+
export declare function encodePostQuantumDetachedProofUri(detachedJws: string): string;
|
|
5
|
+
export declare function decodePostQuantumDetachedProofUri(uri: string): string;
|
|
6
|
+
/**
|
|
7
|
+
* Encodes only the detached proof as decimal QR chunks. The signed JSON:API,
|
|
8
|
+
* VC, SHC or other external payload is deliberately not duplicated.
|
|
9
|
+
*/
|
|
10
|
+
export declare function encodePostQuantumDetachedProofQr(detachedJws: string, options?: Readonly<{
|
|
11
|
+
qrCount?: number;
|
|
12
|
+
}>): readonly string[];
|
|
13
|
+
export declare function decodePostQuantumDetachedProofQr(values: readonly string[]): string;
|
|
14
|
+
//# sourceMappingURL=post-quantum-detached-qr.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post-quantum-detached-qr.d.ts","sourceRoot":"","sources":["../../src/cryptography/post-quantum-detached-qr.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,8BAA8B,EAAG,OAAgB,CAAA;AAC9D,eAAO,MAAM,sCAAsC,IAAI,CAAA;AAIvD,gGAAgG;AAChG,wBAAgB,iCAAiC,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE7E;AAED,wBAAgB,iCAAiC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAKrE;AAED;;;GAGG;AACH,wBAAgB,gCAAgC,CAC9C,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,QAAQ,CAAC;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAM,GAC3C,SAAS,MAAM,EAAE,CAYnB;AAED,wBAAgB,gCAAgC,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAiBlF"}
|