gdc-sdk-front-ts 0.6.2 → 0.6.6
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/README.md +36 -8
- package/dist/ProfileManager.d.ts +22 -0
- package/dist/ProfileManager.js +155 -0
- package/dist/gdc-common-utils-ts/src/AesManager.d.ts +27 -0
- package/dist/gdc-common-utils-ts/src/AesManager.js +64 -0
- package/dist/gdc-common-utils-ts/src/CryptographyService.d.ts +76 -0
- package/dist/gdc-common-utils-ts/src/CryptographyService.js +401 -0
- package/dist/gdc-common-utils-ts/src/constants/actor-session.d.ts +40 -0
- package/dist/gdc-common-utils-ts/src/constants/actor-session.js +40 -0
- package/dist/gdc-common-utils-ts/src/constants/communication.d.ts +28 -0
- package/dist/gdc-common-utils-ts/src/constants/communication.js +14 -0
- package/dist/gdc-common-utils-ts/src/constants/cryptography.d.ts +58 -0
- package/dist/gdc-common-utils-ts/src/constants/cryptography.js +49 -0
- package/dist/gdc-common-utils-ts/src/constants/dataspace-discovery.d.ts +11 -0
- package/dist/gdc-common-utils-ts/src/constants/dataspace-discovery.js +11 -0
- package/dist/gdc-common-utils-ts/src/constants/dataspace-protocol.d.ts +27 -0
- package/dist/gdc-common-utils-ts/src/constants/dataspace-protocol.js +27 -0
- package/dist/gdc-common-utils-ts/src/constants/device.d.ts +16 -0
- package/dist/gdc-common-utils-ts/src/constants/device.js +15 -0
- package/dist/gdc-common-utils-ts/src/constants/did-services.d.ts +42 -0
- package/dist/gdc-common-utils-ts/src/constants/did-services.js +40 -0
- package/dist/gdc-common-utils-ts/src/constants/eu-countries.d.ts +36 -0
- package/dist/gdc-common-utils-ts/src/constants/eu-countries.js +69 -0
- package/dist/gdc-common-utils-ts/src/constants/fhir-code-systems.d.ts +12 -0
- package/dist/gdc-common-utils-ts/src/constants/fhir-code-systems.js +12 -0
- package/dist/gdc-common-utils-ts/src/constants/fhir-resource-types.d.ts +52 -0
- package/dist/gdc-common-utils-ts/src/constants/fhir-resource-types.js +33 -0
- package/dist/gdc-common-utils-ts/src/constants/fhir-versions.d.ts +10 -0
- package/dist/gdc-common-utils-ts/src/constants/fhir-versions.js +10 -0
- package/dist/gdc-common-utils-ts/src/constants/healthcare.d.ts +496 -0
- package/dist/gdc-common-utils-ts/src/constants/healthcare.js +274 -0
- package/dist/gdc-common-utils-ts/src/constants/hl7-roles.d.ts +44 -0
- package/dist/gdc-common-utils-ts/src/constants/hl7-roles.js +208 -0
- package/dist/gdc-common-utils-ts/src/constants/index.d.ts +21 -0
- package/dist/gdc-common-utils-ts/src/constants/index.js +21 -0
- package/dist/gdc-common-utils-ts/src/constants/network.d.ts +25 -0
- package/dist/gdc-common-utils-ts/src/constants/network.js +17 -0
- package/dist/gdc-common-utils-ts/src/constants/schemaorg.d.ts +175 -0
- package/dist/gdc-common-utils-ts/src/constants/schemaorg.js +261 -0
- package/dist/gdc-common-utils-ts/src/constants/sectors.d.ts +24 -0
- package/dist/gdc-common-utils-ts/src/constants/sectors.js +24 -0
- package/dist/gdc-common-utils-ts/src/constants/service-capabilities.d.ts +82 -0
- package/dist/gdc-common-utils-ts/src/constants/service-capabilities.js +105 -0
- package/dist/gdc-common-utils-ts/src/constants/smart.d.ts +12 -0
- package/dist/gdc-common-utils-ts/src/constants/smart.js +12 -0
- package/dist/gdc-common-utils-ts/src/constants/urn.d.ts +11 -0
- package/dist/gdc-common-utils-ts/src/constants/urn.js +11 -0
- package/dist/gdc-common-utils-ts/src/constants/verifiable-credentials.d.ts +34 -0
- package/dist/gdc-common-utils-ts/src/constants/verifiable-credentials.js +42 -0
- package/dist/gdc-common-utils-ts/src/constants/vital-signs.d.ts +75 -0
- package/dist/gdc-common-utils-ts/src/constants/vital-signs.js +33 -0
- package/dist/gdc-common-utils-ts/src/examples/api-flow-examples.d.ts +15 -0
- package/dist/gdc-common-utils-ts/src/examples/api-flow-examples.js +16 -0
- package/dist/gdc-common-utils-ts/src/examples/communication-bundle-session.d.ts +22 -0
- package/dist/gdc-common-utils-ts/src/examples/communication-bundle-session.js +81 -0
- package/dist/gdc-common-utils-ts/src/examples/consent-access.d.ts +30 -0
- package/dist/gdc-common-utils-ts/src/examples/consent-access.js +121 -0
- package/dist/gdc-common-utils-ts/src/examples/contract-examples.d.ts +15 -0
- package/dist/gdc-common-utils-ts/src/examples/contract-examples.js +16 -0
- package/dist/gdc-common-utils-ts/src/examples/dataspace-discovery.d.ts +98 -0
- package/dist/gdc-common-utils-ts/src/examples/dataspace-discovery.js +141 -0
- package/dist/gdc-common-utils-ts/src/examples/frontend-session.d.ts +13 -0
- package/dist/gdc-common-utils-ts/src/examples/frontend-session.js +24 -0
- package/dist/gdc-common-utils-ts/src/examples/ica-activation-proof.d.ts +64 -0
- package/dist/gdc-common-utils-ts/src/examples/ica-activation-proof.js +77 -0
- package/dist/gdc-common-utils-ts/src/examples/index.d.ts +14 -0
- package/dist/gdc-common-utils-ts/src/examples/index.js +14 -0
- package/dist/gdc-common-utils-ts/src/examples/individual-controller.d.ts +100 -0
- package/dist/gdc-common-utils-ts/src/examples/individual-controller.js +71 -0
- package/dist/gdc-common-utils-ts/src/examples/lifecycle.d.ts +505 -0
- package/dist/gdc-common-utils-ts/src/examples/lifecycle.js +291 -0
- package/dist/gdc-common-utils-ts/src/examples/organization-controller.d.ts +163 -0
- package/dist/gdc-common-utils-ts/src/examples/organization-controller.js +93 -0
- package/dist/gdc-common-utils-ts/src/examples/professional.d.ts +228 -0
- package/dist/gdc-common-utils-ts/src/examples/professional.js +324 -0
- package/dist/gdc-common-utils-ts/src/examples/related-person.d.ts +10 -0
- package/dist/gdc-common-utils-ts/src/examples/related-person.js +13 -0
- package/dist/gdc-common-utils-ts/src/examples/relationship-access.d.ts +11 -0
- package/dist/gdc-common-utils-ts/src/examples/relationship-access.js +96 -0
- package/dist/gdc-common-utils-ts/src/examples/shared.d.ts +220 -0
- package/dist/gdc-common-utils-ts/src/examples/shared.js +191 -0
- package/dist/gdc-common-utils-ts/src/hmac.d.ts +14 -0
- package/dist/gdc-common-utils-ts/src/hmac.js +24 -0
- package/dist/gdc-common-utils-ts/src/i18n/clinical-sections.i18n.d.ts +6 -0
- package/dist/gdc-common-utils-ts/src/i18n/clinical-sections.i18n.js +15 -0
- package/dist/gdc-common-utils-ts/src/i18n/role-codes.i18n.d.ts +4 -0
- package/dist/gdc-common-utils-ts/src/i18n/role-codes.i18n.js +13 -0
- package/dist/gdc-common-utils-ts/src/index.d.ts +10 -0
- package/dist/gdc-common-utils-ts/src/index.js +10 -0
- package/dist/gdc-common-utils-ts/src/interfaces/Cryptography.types.d.ts +139 -0
- package/dist/gdc-common-utils-ts/src/interfaces/Cryptography.types.js +8 -0
- package/dist/gdc-common-utils-ts/src/interfaces/ICryptoHelper.d.ts +28 -0
- package/dist/gdc-common-utils-ts/src/interfaces/ICryptoHelper.js +3 -0
- package/dist/gdc-common-utils-ts/src/interfaces/ICryptography.d.ts +154 -0
- package/dist/gdc-common-utils-ts/src/interfaces/ICryptography.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/actor-session.d.ts +9 -0
- package/dist/gdc-common-utils-ts/src/models/actor-session.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/aes.d.ts +85 -0
- package/dist/gdc-common-utils-ts/src/models/aes.js +10 -0
- package/dist/gdc-common-utils-ts/src/models/auth.d.ts +35 -0
- package/dist/gdc-common-utils-ts/src/models/auth.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/bundle.d.ts +153 -0
- package/dist/gdc-common-utils-ts/src/models/bundle.js +25 -0
- package/dist/gdc-common-utils-ts/src/models/clinical-sections.d.ts +36 -0
- package/dist/gdc-common-utils-ts/src/models/clinical-sections.en.d.ts +150 -0
- package/dist/gdc-common-utils-ts/src/models/clinical-sections.en.js +104 -0
- package/dist/gdc-common-utils-ts/src/models/clinical-sections.js +32 -0
- package/dist/gdc-common-utils-ts/src/models/clinical-workbook-summary.d.ts +126 -0
- package/dist/gdc-common-utils-ts/src/models/clinical-workbook-summary.js +67 -0
- package/dist/gdc-common-utils-ts/src/models/comm.d.ts +56 -0
- package/dist/gdc-common-utils-ts/src/models/comm.js +4 -0
- package/dist/gdc-common-utils-ts/src/models/confidential-job.d.ts +78 -0
- package/dist/gdc-common-utils-ts/src/models/confidential-job.js +20 -0
- package/dist/gdc-common-utils-ts/src/models/confidential-message.d.ts +97 -0
- package/dist/gdc-common-utils-ts/src/models/confidential-message.js +4 -0
- package/dist/gdc-common-utils-ts/src/models/confidential-storage.d.ts +134 -0
- package/dist/gdc-common-utils-ts/src/models/confidential-storage.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/consent-access.d.ts +79 -0
- package/dist/gdc-common-utils-ts/src/models/consent-access.js +2 -0
- package/dist/gdc-common-utils-ts/src/models/consent-rule.d.ts +122 -0
- package/dist/gdc-common-utils-ts/src/models/consent-rule.js +22 -0
- package/dist/gdc-common-utils-ts/src/models/crypto.d.ts +35 -0
- package/dist/gdc-common-utils-ts/src/models/crypto.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/dataspace-discovery-defaults.d.ts +79 -0
- package/dist/gdc-common-utils-ts/src/models/dataspace-discovery-defaults.js +2 -0
- package/dist/gdc-common-utils-ts/src/models/dataspace-discovery.d.ts +68 -0
- package/dist/gdc-common-utils-ts/src/models/dataspace-discovery.js +9 -0
- package/dist/gdc-common-utils-ts/src/models/dataspace-protocol.d.ts +14 -0
- package/dist/gdc-common-utils-ts/src/models/dataspace-protocol.js +2 -0
- package/dist/gdc-common-utils-ts/src/models/device-license.d.ts +134 -0
- package/dist/gdc-common-utils-ts/src/models/device-license.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/did.d.ts +108 -0
- package/dist/gdc-common-utils-ts/src/models/did.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/fhir-documents.d.ts +101 -0
- package/dist/gdc-common-utils-ts/src/models/fhir-documents.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/identity-bootstrap.d.ts +104 -0
- package/dist/gdc-common-utils-ts/src/models/identity-bootstrap.js +2 -0
- package/dist/gdc-common-utils-ts/src/models/index.d.ts +42 -0
- package/dist/gdc-common-utils-ts/src/models/index.js +42 -0
- package/dist/gdc-common-utils-ts/src/models/indexing.d.ts +11 -0
- package/dist/gdc-common-utils-ts/src/models/indexing.js +18 -0
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/allergy-intolerance-claims.d.ts +24 -0
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/allergy-intolerance-claims.js +36 -0
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/communication-claims.d.ts +53 -0
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/communication-claims.js +55 -0
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/condition-claims.d.ts +14 -0
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/condition-claims.js +25 -0
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/device-use-statement-claims.d.ts +13 -0
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/device-use-statement-claims.js +23 -0
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/document-reference-claims.d.ts +36 -0
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/document-reference-claims.js +89 -0
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/medication-statement-claims.d.ts +341 -0
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/medication-statement-claims.js +204 -0
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/types.d.ts +9 -0
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/types.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims.d.ts +5 -0
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims.js +7 -0
- package/dist/gdc-common-utils-ts/src/models/issue.d.ts +57 -0
- package/dist/gdc-common-utils-ts/src/models/issue.js +75 -0
- package/dist/gdc-common-utils-ts/src/models/jsonapi.d.ts +13 -0
- package/dist/gdc-common-utils-ts/src/models/jsonapi.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/jwe.d.ts +120 -0
- package/dist/gdc-common-utils-ts/src/models/jwe.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/jwk.d.ts +39 -0
- package/dist/gdc-common-utils-ts/src/models/jwk.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/jws.d.ts +35 -0
- package/dist/gdc-common-utils-ts/src/models/jws.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/jwt.d.ts +9 -0
- package/dist/gdc-common-utils-ts/src/models/jwt.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/loinc-document-ontology.d.ts +55 -0
- package/dist/gdc-common-utils-ts/src/models/loinc-document-ontology.js +58 -0
- package/dist/gdc-common-utils-ts/src/models/oidc4ida.common.model.d.ts +33 -0
- package/dist/gdc-common-utils-ts/src/models/oidc4ida.common.model.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/oidc4ida.document.model.d.ts +50 -0
- package/dist/gdc-common-utils-ts/src/models/oidc4ida.document.model.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/oidc4ida.electronicRecord.model.d.ts +67 -0
- package/dist/gdc-common-utils-ts/src/models/oidc4ida.electronicRecord.model.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/oidc4ida.evidence.model.d.ts +51 -0
- package/dist/gdc-common-utils-ts/src/models/oidc4ida.evidence.model.js +5 -0
- package/dist/gdc-common-utils-ts/src/models/openid-device.d.ts +119 -0
- package/dist/gdc-common-utils-ts/src/models/openid-device.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/operation-outcome.d.ts +26 -0
- package/dist/gdc-common-utils-ts/src/models/operation-outcome.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/params.d.ts +133 -0
- package/dist/gdc-common-utils-ts/src/models/params.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/relationship-access.d.ts +160 -0
- package/dist/gdc-common-utils-ts/src/models/relationship-access.js +21 -0
- package/dist/gdc-common-utils-ts/src/models/resource-document.d.ts +14 -0
- package/dist/gdc-common-utils-ts/src/models/resource-document.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/response.d.ts +1 -0
- package/dist/gdc-common-utils-ts/src/models/response.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/urlPath.d.ts +58 -0
- package/dist/gdc-common-utils-ts/src/models/urlPath.js +76 -0
- package/dist/gdc-common-utils-ts/src/models/verifiable-credential.d.ts +45 -0
- package/dist/gdc-common-utils-ts/src/models/verifiable-credential.js +8 -0
- package/dist/gdc-common-utils-ts/src/storage/IVaultRepository.d.ts +53 -0
- package/dist/gdc-common-utils-ts/src/storage/IVaultRepository.js +25 -0
- package/dist/gdc-common-utils-ts/src/storage/VaultMemRepository.d.ts +30 -0
- package/dist/gdc-common-utils-ts/src/storage/VaultMemRepository.js +81 -0
- package/dist/gdc-common-utils-ts/src/storage/index.d.ts +3 -0
- package/dist/gdc-common-utils-ts/src/storage/index.js +4 -0
- package/dist/gdc-common-utils-ts/src/utils/activation-policy.d.ts +86 -0
- package/dist/gdc-common-utils-ts/src/utils/activation-policy.js +218 -0
- package/dist/gdc-common-utils-ts/src/utils/activation-request.d.ts +81 -0
- package/dist/gdc-common-utils-ts/src/utils/activation-request.js +99 -0
- package/dist/gdc-common-utils-ts/src/utils/actor.d.ts +18 -0
- package/dist/gdc-common-utils-ts/src/utils/actor.js +36 -0
- package/dist/gdc-common-utils-ts/src/utils/base-convert.d.ts +60 -0
- package/dist/gdc-common-utils-ts/src/utils/base-convert.js +104 -0
- package/dist/gdc-common-utils-ts/src/utils/baseN.d.ts +35 -0
- package/dist/gdc-common-utils-ts/src/utils/baseN.js +174 -0
- package/dist/gdc-common-utils-ts/src/utils/bundle-query.d.ts +35 -0
- package/dist/gdc-common-utils-ts/src/utils/bundle-query.js +177 -0
- package/dist/gdc-common-utils-ts/src/utils/bundle.d.ts +13 -0
- package/dist/gdc-common-utils-ts/src/utils/bundle.js +39 -0
- package/dist/gdc-common-utils-ts/src/utils/clinical-resource-converters.d.ts +64 -0
- package/dist/gdc-common-utils-ts/src/utils/clinical-resource-converters.js +279 -0
- package/dist/gdc-common-utils-ts/src/utils/clinical-resource-view.d.ts +55 -0
- package/dist/gdc-common-utils-ts/src/utils/clinical-resource-view.js +291 -0
- package/dist/gdc-common-utils-ts/src/utils/communication-bundle-session.d.ts +110 -0
- package/dist/gdc-common-utils-ts/src/utils/communication-bundle-session.js +326 -0
- package/dist/gdc-common-utils-ts/src/utils/communication-document-reference.d.ts +41 -0
- package/dist/gdc-common-utils-ts/src/utils/communication-document-reference.js +170 -0
- package/dist/gdc-common-utils-ts/src/utils/communication-fhir-r4.d.ts +41 -0
- package/dist/gdc-common-utils-ts/src/utils/communication-fhir-r4.js +215 -0
- package/dist/gdc-common-utils-ts/src/utils/communication-identity.d.ts +152 -0
- package/dist/gdc-common-utils-ts/src/utils/communication-identity.js +121 -0
- package/dist/gdc-common-utils-ts/src/utils/consent-claim-helpers.d.ts +79 -0
- package/dist/gdc-common-utils-ts/src/utils/consent-claim-helpers.js +213 -0
- package/dist/gdc-common-utils-ts/src/utils/consent.d.ts +218 -0
- package/dist/gdc-common-utils-ts/src/utils/consent.js +679 -0
- package/dist/gdc-common-utils-ts/src/utils/content.d.ts +55 -0
- package/dist/gdc-common-utils-ts/src/utils/content.js +60 -0
- package/dist/gdc-common-utils-ts/src/utils/dataspace-discovery-defaults.d.ts +130 -0
- package/dist/gdc-common-utils-ts/src/utils/dataspace-discovery-defaults.js +307 -0
- package/dist/gdc-common-utils-ts/src/utils/dataspace-discovery.d.ts +235 -0
- package/dist/gdc-common-utils-ts/src/utils/dataspace-discovery.js +482 -0
- package/dist/gdc-common-utils-ts/src/utils/dataspace-protocol.d.ts +66 -0
- package/dist/gdc-common-utils-ts/src/utils/dataspace-protocol.js +109 -0
- package/dist/gdc-common-utils-ts/src/utils/did-resolution.d.ts +60 -0
- package/dist/gdc-common-utils-ts/src/utils/did-resolution.js +173 -0
- package/dist/gdc-common-utils-ts/src/utils/did.d.ts +124 -0
- package/dist/gdc-common-utils-ts/src/utils/did.js +204 -0
- package/dist/gdc-common-utils-ts/src/utils/didcomm-submit-policy.d.ts +10 -0
- package/dist/gdc-common-utils-ts/src/utils/didcomm-submit-policy.js +15 -0
- package/dist/gdc-common-utils-ts/src/utils/didcomm-submit.d.ts +48 -0
- package/dist/gdc-common-utils-ts/src/utils/didcomm-submit.js +81 -0
- package/dist/gdc-common-utils-ts/src/utils/didcomm.d.ts +60 -0
- package/dist/gdc-common-utils-ts/src/utils/didcomm.js +78 -0
- package/dist/gdc-common-utils-ts/src/utils/discovery-normalization.d.ts +28 -0
- package/dist/gdc-common-utils-ts/src/utils/discovery-normalization.js +64 -0
- package/dist/gdc-common-utils-ts/src/utils/fhir-cid.d.ts +60 -0
- package/dist/gdc-common-utils-ts/src/utils/fhir-cid.js +152 -0
- package/dist/gdc-common-utils-ts/src/utils/fhir-validator.d.ts +61 -0
- package/dist/gdc-common-utils-ts/src/utils/fhir-validator.js +91 -0
- package/dist/gdc-common-utils-ts/src/utils/format-converter.d.ts +21 -0
- package/dist/gdc-common-utils-ts/src/utils/format-converter.js +109 -0
- package/dist/gdc-common-utils-ts/src/utils/index.d.ts +39 -0
- package/dist/gdc-common-utils-ts/src/utils/index.js +39 -0
- package/dist/gdc-common-utils-ts/src/utils/individual-form-pdf.d.ts +55 -0
- package/dist/gdc-common-utils-ts/src/utils/individual-form-pdf.js +191 -0
- package/dist/gdc-common-utils-ts/src/utils/jwt.d.ts +53 -0
- package/dist/gdc-common-utils-ts/src/utils/jwt.js +154 -0
- package/dist/gdc-common-utils-ts/src/utils/manager-error.d.ts +15 -0
- package/dist/gdc-common-utils-ts/src/utils/manager-error.js +21 -0
- package/dist/gdc-common-utils-ts/src/utils/medication-claim-helpers.d.ts +56 -0
- package/dist/gdc-common-utils-ts/src/utils/medication-claim-helpers.js +127 -0
- package/dist/gdc-common-utils-ts/src/utils/multibase58.d.ts +13 -0
- package/dist/gdc-common-utils-ts/src/utils/multibase58.js +40 -0
- package/dist/gdc-common-utils-ts/src/utils/multibasehash.d.ts +8 -0
- package/dist/gdc-common-utils-ts/src/utils/multibasehash.js +23 -0
- package/dist/gdc-common-utils-ts/src/utils/normalize-uuid.d.ts +1 -0
- package/dist/gdc-common-utils-ts/src/utils/normalize-uuid.js +35 -0
- package/dist/gdc-common-utils-ts/src/utils/normalize.d.ts +16 -0
- package/dist/gdc-common-utils-ts/src/utils/normalize.js +40 -0
- package/dist/gdc-common-utils-ts/src/utils/object-convert.d.ts +20 -0
- package/dist/gdc-common-utils-ts/src/utils/object-convert.js +51 -0
- package/dist/gdc-common-utils-ts/src/utils/smart-scope.d.ts +28 -0
- package/dist/gdc-common-utils-ts/src/utils/smart-scope.js +29 -0
- package/dist/gdc-common-utils-ts/src/utils/string-convert.d.ts +24 -0
- package/dist/gdc-common-utils-ts/src/utils/string-convert.js +62 -0
- package/dist/gdc-common-utils-ts/src/utils/string-utils.d.ts +25 -0
- package/dist/gdc-common-utils-ts/src/utils/string-utils.js +66 -0
- package/dist/gdc-common-utils-ts/src/utils/url.d.ts +26 -0
- package/dist/gdc-common-utils-ts/src/utils/url.js +44 -0
- package/dist/gdc-common-utils-ts/src/utils/vp-token.d.ts +139 -0
- package/dist/gdc-common-utils-ts/src/utils/vp-token.js +256 -0
- package/dist/gdc-sdk-core-ts/src/actor-model.d.ts +56 -0
- package/dist/gdc-sdk-core-ts/src/actor-model.js +112 -0
- package/dist/gdc-sdk-core-ts/src/app-identity.d.ts +80 -0
- package/dist/gdc-sdk-core-ts/src/app-identity.js +147 -0
- package/dist/gdc-sdk-core-ts/src/bootstrap-facade.d.ts +165 -0
- package/dist/gdc-sdk-core-ts/src/bootstrap-facade.js +191 -0
- package/dist/gdc-sdk-core-ts/src/communication-bundle-contracts.d.ts +112 -0
- package/dist/gdc-sdk-core-ts/src/communication-bundle-contracts.js +185 -0
- package/dist/gdc-sdk-core-ts/src/communication-bundle-resources.d.ts +32 -0
- package/dist/gdc-sdk-core-ts/src/communication-bundle-resources.js +215 -0
- package/dist/gdc-sdk-core-ts/src/communication-consent-mutation-contract.d.ts +55 -0
- package/dist/gdc-sdk-core-ts/src/communication-consent-mutation-contract.js +190 -0
- package/dist/gdc-sdk-core-ts/src/communication-document-facade.d.ts +55 -0
- package/dist/gdc-sdk-core-ts/src/communication-document-facade.js +194 -0
- package/dist/gdc-sdk-core-ts/src/communication-draft.d.ts +104 -0
- package/dist/gdc-sdk-core-ts/src/communication-draft.js +143 -0
- package/dist/gdc-sdk-core-ts/src/communication-outbox.d.ts +49 -0
- package/dist/gdc-sdk-core-ts/src/communication-outbox.js +62 -0
- package/dist/gdc-sdk-core-ts/src/communication-resource-helpers.d.ts +180 -0
- package/dist/gdc-sdk-core-ts/src/communication-resource-helpers.js +455 -0
- package/dist/gdc-sdk-core-ts/src/consent-access.d.ts +73 -0
- package/dist/gdc-sdk-core-ts/src/consent-access.js +109 -0
- package/dist/gdc-sdk-core-ts/src/consent-claim-helpers.d.ts +5 -0
- package/dist/gdc-sdk-core-ts/src/consent-claim-helpers.js +6 -0
- package/dist/gdc-sdk-core-ts/src/consent-communication-operations.d.ts +82 -0
- package/dist/gdc-sdk-core-ts/src/consent-communication-operations.js +135 -0
- package/dist/gdc-sdk-core-ts/src/did-resolution-session.d.ts +33 -0
- package/dist/gdc-sdk-core-ts/src/did-resolution-session.js +56 -0
- package/dist/gdc-sdk-core-ts/src/discovery-facade.d.ts +84 -0
- package/dist/gdc-sdk-core-ts/src/discovery-facade.js +24 -0
- package/dist/gdc-sdk-core-ts/src/identity-model.d.ts +46 -0
- package/dist/gdc-sdk-core-ts/src/identity-model.js +2 -0
- package/dist/gdc-sdk-core-ts/src/identity-store.d.ts +83 -0
- package/dist/gdc-sdk-core-ts/src/identity-store.js +51 -0
- package/dist/gdc-sdk-core-ts/src/index.d.ts +23 -0
- package/dist/gdc-sdk-core-ts/src/index.js +24 -0
- package/dist/gdc-sdk-core-ts/src/medication-claim-helpers.d.ts +5 -0
- package/dist/gdc-sdk-core-ts/src/medication-claim-helpers.js +6 -0
- package/dist/gdc-sdk-core-ts/src/polling-model.d.ts +35 -0
- package/dist/gdc-sdk-core-ts/src/polling-model.js +24 -0
- package/dist/gdc-sdk-core-ts/src/relationship-access.d.ts +40 -0
- package/dist/gdc-sdk-core-ts/src/relationship-access.js +150 -0
- package/dist/gdc-sdk-core-ts/src/session-model.d.ts +134 -0
- package/dist/gdc-sdk-core-ts/src/session-model.js +2 -0
- package/dist/gdc-sdk-core-ts/src/smart-endpoint-resolver.d.ts +19 -0
- package/dist/gdc-sdk-core-ts/src/smart-endpoint-resolver.js +19 -0
- package/dist/gdc-sdk-core-ts/src/vital-signs.d.ts +38 -0
- package/dist/gdc-sdk-core-ts/src/vital-signs.js +155 -0
- package/dist/gdc-sdk-front-ts/src/ClientSDK.d.ts +99 -0
- package/dist/gdc-sdk-front-ts/src/ClientSDK.js +177 -0
- package/dist/gdc-sdk-front-ts/src/ProfileManager.d.ts +140 -0
- package/dist/gdc-sdk-front-ts/src/ProfileManager.js +76 -0
- package/dist/gdc-sdk-front-ts/src/ProfileRegistry.d.ts +11 -0
- package/dist/gdc-sdk-front-ts/src/ProfileRegistry.js +26 -0
- package/dist/gdc-sdk-front-ts/src/VerifierService.d.ts +6 -0
- package/dist/gdc-sdk-front-ts/src/VerifierService.js +10 -0
- package/dist/gdc-sdk-front-ts/src/actor-session.d.ts +2 -0
- package/dist/gdc-sdk-front-ts/src/actor-session.js +2 -0
- package/dist/gdc-sdk-front-ts/src/capabilityMapper.d.ts +8 -0
- package/dist/gdc-sdk-front-ts/src/capabilityMapper.js +28 -0
- package/dist/gdc-sdk-front-ts/src/consent-claim-helpers.d.ts +4 -0
- package/dist/gdc-sdk-front-ts/src/consent-claim-helpers.js +5 -0
- package/dist/gdc-sdk-front-ts/src/discovery/DataspaceDiscoveryClient.d.ts +54 -0
- package/dist/gdc-sdk-front-ts/src/discovery/DataspaceDiscoveryClient.js +85 -0
- package/dist/gdc-sdk-front-ts/src/discovery/index.d.ts +3 -0
- package/dist/gdc-sdk-front-ts/src/discovery/index.js +4 -0
- package/dist/gdc-sdk-front-ts/src/discovery/mappers.d.ts +29 -0
- package/dist/gdc-sdk-front-ts/src/discovery/mappers.js +60 -0
- package/dist/gdc-sdk-front-ts/src/discovery/types.d.ts +83 -0
- package/dist/gdc-sdk-front-ts/src/discovery/types.js +2 -0
- package/dist/gdc-sdk-front-ts/src/index.d.ts +15 -0
- package/dist/gdc-sdk-front-ts/src/index.js +16 -0
- package/dist/gdc-sdk-front-ts/src/medication-claim-helpers.d.ts +4 -0
- package/dist/gdc-sdk-front-ts/src/medication-claim-helpers.js +5 -0
- package/dist/gdc-sdk-front-ts/src/roleRegistry.d.ts +19 -0
- package/dist/gdc-sdk-front-ts/src/roleRegistry.js +2 -0
- package/dist/gdc-sdk-front-ts/src/runtime-contracts.d.ts +22 -0
- package/dist/gdc-sdk-front-ts/src/runtime-contracts.js +7 -0
- package/dist/gdc-sdk-front-ts/src/services.d.ts +167 -0
- package/dist/gdc-sdk-front-ts/src/services.js +78 -0
- package/dist/gdc-sdk-front-ts/src/session-descriptor.d.ts +11 -0
- package/dist/gdc-sdk-front-ts/src/session-descriptor.js +8 -0
- package/dist/gdc-sdk-front-ts/src/types.d.ts +11 -0
- package/dist/gdc-sdk-front-ts/src/types.js +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +8 -0
- package/dist/medication-claim-helpers.d.ts +4 -0
- package/dist/medication-claim-helpers.js +5 -0
- package/dist/orchestration/client-port.d.ts +161 -0
- package/dist/orchestration/client-port.js +26 -0
- package/dist/orchestration/facades.d.ts +65 -0
- package/dist/orchestration/facades.js +142 -0
- package/dist/orchestration/host-onboarding-sdk.d.ts +9 -0
- package/dist/orchestration/host-onboarding-sdk.js +16 -0
- package/dist/orchestration/individual-controller-sdk.d.ts +18 -0
- package/dist/orchestration/individual-controller-sdk.js +43 -0
- package/dist/orchestration/individual-member-sdk.d.ts +8 -0
- package/dist/orchestration/individual-member-sdk.js +13 -0
- package/dist/orchestration/organization-controller-sdk.d.ts +11 -0
- package/dist/orchestration/organization-controller-sdk.js +22 -0
- package/dist/orchestration/organization-employee-sdk.d.ts +8 -0
- package/dist/orchestration/organization-employee-sdk.js +13 -0
- package/dist/orchestration/personal-sdk.d.ts +13 -0
- package/dist/orchestration/personal-sdk.js +28 -0
- package/dist/orchestration/professional-sdk.d.ts +10 -0
- package/dist/orchestration/professional-sdk.js +19 -0
- package/dist/services.d.ts +58 -10
- package/dist/services.js +88 -5
- package/package.json +3 -3
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
// Copyright 2025 Antifraud Services Inc. under the Apache License, Version 2.0.
|
|
2
|
+
// File: crypto-ts/CryptographyService.ts
|
|
3
|
+
import * as pako from 'pako';
|
|
4
|
+
import * as jwtUtils from './utils/jwt';
|
|
5
|
+
import { AesManager } from './AesManager';
|
|
6
|
+
import { Content } from './utils/content';
|
|
7
|
+
/**
|
|
8
|
+
* Implements the ICryptography interface, providing a complete suite of low-level,
|
|
9
|
+
* stateless cryptographic functions. This service is the "engine" of the security layer,
|
|
10
|
+
* orchestrating Post-Quantum and AES primitives.
|
|
11
|
+
*/
|
|
12
|
+
export class CryptographyService {
|
|
13
|
+
constructor(cryptoHelper) {
|
|
14
|
+
this.mlDsaModule = null;
|
|
15
|
+
this.mlKemModule = null;
|
|
16
|
+
// Constants for seed sizes, as per @noble library requirements.
|
|
17
|
+
this.ML_KEM_SEED_SIZE = 64;
|
|
18
|
+
this.ML_DSA_SEED_SIZE = 32;
|
|
19
|
+
this.aesManager = new AesManager();
|
|
20
|
+
this.cryptoHelper = cryptoHelper;
|
|
21
|
+
}
|
|
22
|
+
async loadMlDsa() {
|
|
23
|
+
if (this.mlDsaModule)
|
|
24
|
+
return this.mlDsaModule;
|
|
25
|
+
try {
|
|
26
|
+
// Use explicit .js subpath to satisfy package exports in Metro/Node ESM.
|
|
27
|
+
const module = await import('@noble/post-quantum/ml-dsa.js');
|
|
28
|
+
this.mlDsaModule = module;
|
|
29
|
+
return module;
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
throw new Error('[CryptographyService] Missing dependency "@noble/post-quantum/ml-dsa.js". Install it for ML-DSA operations.');
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
async loadMlKem() {
|
|
36
|
+
if (this.mlKemModule)
|
|
37
|
+
return this.mlKemModule;
|
|
38
|
+
try {
|
|
39
|
+
// Use explicit .js subpath to satisfy package exports in Metro/Node ESM.
|
|
40
|
+
const module = await import('@noble/post-quantum/ml-kem.js');
|
|
41
|
+
this.mlKemModule = module;
|
|
42
|
+
return module;
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
throw new Error('[CryptographyService] Missing dependency "@noble/post-quantum/ml-kem.js". Install it for ML-KEM operations.');
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
digestString(data, algorithm) {
|
|
49
|
+
return this.cryptoHelper.digestString(data, algorithm);
|
|
50
|
+
}
|
|
51
|
+
// --- Key Generation ---
|
|
52
|
+
async generateKeyPairMlKem(seedBytes, crv = 'ML-KEM-768') {
|
|
53
|
+
const mlKem = await this.loadMlKem();
|
|
54
|
+
let seed;
|
|
55
|
+
if (seedBytes && seedBytes.length === this.ML_KEM_SEED_SIZE) {
|
|
56
|
+
seed = seedBytes;
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
seed = await this.cryptoHelper.getRandomBytes(this.ML_KEM_SEED_SIZE);
|
|
60
|
+
}
|
|
61
|
+
let keygenFn;
|
|
62
|
+
switch (crv) {
|
|
63
|
+
case 'ML-KEM-512':
|
|
64
|
+
keygenFn = mlKem.ml_kem512.keygen;
|
|
65
|
+
break;
|
|
66
|
+
case 'ML-KEM-1024':
|
|
67
|
+
keygenFn = mlKem.ml_kem1024.keygen;
|
|
68
|
+
break;
|
|
69
|
+
case 'ML-KEM-768':
|
|
70
|
+
default:
|
|
71
|
+
keygenFn = mlKem.ml_kem768.keygen;
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
const { secretKey, publicKey: publicKeyBytes } = keygenFn(seed);
|
|
75
|
+
const pubJwkWithoutKid = {
|
|
76
|
+
kty: 'OKP', crv: crv, x: Content.bytesToRawBase64UrlSafe(publicKeyBytes),
|
|
77
|
+
};
|
|
78
|
+
const kid = await this._computeJwkThumbprint(pubJwkWithoutKid);
|
|
79
|
+
const publicKey = { ...pubJwkWithoutKid, kid };
|
|
80
|
+
return { publicJWKey: publicKey, secretKeyBytes: secretKey };
|
|
81
|
+
}
|
|
82
|
+
async generateKeyPairMlDsa(seedBytes, alg = 'ML-DSA-44') {
|
|
83
|
+
const mlDsa = await this.loadMlDsa();
|
|
84
|
+
let seed;
|
|
85
|
+
if (seedBytes && seedBytes.length === this.ML_DSA_SEED_SIZE) {
|
|
86
|
+
seed = seedBytes;
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
seed = await this.cryptoHelper.getRandomBytes(this.ML_DSA_SEED_SIZE);
|
|
90
|
+
}
|
|
91
|
+
let keygenFn;
|
|
92
|
+
switch (alg) {
|
|
93
|
+
case 'ML-DSA-65':
|
|
94
|
+
keygenFn = mlDsa.ml_dsa65.keygen;
|
|
95
|
+
break;
|
|
96
|
+
case 'ML-DSA-87':
|
|
97
|
+
keygenFn = mlDsa.ml_dsa87.keygen;
|
|
98
|
+
break;
|
|
99
|
+
case 'ML-DSA-44':
|
|
100
|
+
default:
|
|
101
|
+
keygenFn = mlDsa.ml_dsa44.keygen;
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
const { secretKey, publicKey: publicKeyBytes } = keygenFn(seed);
|
|
105
|
+
const pubJwkWithoutKid = {
|
|
106
|
+
kty: 'AKP', alg: alg, pub: Content.bytesToRawBase64UrlSafe(publicKeyBytes),
|
|
107
|
+
};
|
|
108
|
+
const kid = await this._computeJwkThumbprint(pubJwkWithoutKid);
|
|
109
|
+
const publicKey = { ...pubJwkWithoutKid, kid };
|
|
110
|
+
return { publicJWKey: publicKey, secretKeyBytes: secretKey };
|
|
111
|
+
}
|
|
112
|
+
// --- High-Level Workflows ---
|
|
113
|
+
async encryptJwe(payload, protectedHeader, secretJWKey, recipientsJWKeys) {
|
|
114
|
+
// ARCHITECTURAL NOTE: This implementation is currently only suitable for a single recipient.
|
|
115
|
+
// A Key Encapsulation Mechanism (KEM) derives a *different* shared secret for each recipient's public key.
|
|
116
|
+
// A true multi-recipient JWE requires a single Content Encryption Key (CEK) that is then
|
|
117
|
+
// encrypted (wrapped) for each recipient. This code uses the KEM-derived shared secret as the CEK.
|
|
118
|
+
// This must be refactored to a key-wrapping approach to support multiple recipients correctly.
|
|
119
|
+
if (recipientsJWKeys.length !== 1) {
|
|
120
|
+
// Temporarily throw until the architecture is fixed for multi-recipient.
|
|
121
|
+
throw new Error("CryptographyService.encryptJwe currently only supports a single recipient.");
|
|
122
|
+
}
|
|
123
|
+
const recipient = recipientsJWKeys[0];
|
|
124
|
+
const publicKeyBytes = Content.base64ToBytes(recipient.x);
|
|
125
|
+
// Per RFC 9278, we generate a random seed for the KEM. The KEM then derives both the
|
|
126
|
+
// final Content Encryption Key (CEK) and the encapsulated key from this seed.
|
|
127
|
+
const cekSeedBytes = await this.cryptoHelper.getRandomBytes(32);
|
|
128
|
+
const { derivedCekBytes, // This is the actual Content Encryption Key
|
|
129
|
+
encapsulatedCekBytes // This is the encrypted key for the recipient
|
|
130
|
+
} = await this.encapsulate(cekSeedBytes, secretJWKey.dBytes, publicKeyBytes);
|
|
131
|
+
// 2. Now, use the *derived* CEK to encrypt the payload with AES.
|
|
132
|
+
const protectedHeaderB64Url = Content.objectToRawBase64UrlSafe(protectedHeader);
|
|
133
|
+
let payloadBytes = Content.objectToBytes(payload);
|
|
134
|
+
let payloadString;
|
|
135
|
+
if (protectedHeader.zip === 'DEF') {
|
|
136
|
+
payloadBytes = pako.deflate(payloadBytes);
|
|
137
|
+
payloadString = Content.bytesToRawBase64UrlSafe(payloadBytes);
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
payloadString = Content.bytesToStringASCII(payloadBytes);
|
|
141
|
+
}
|
|
142
|
+
const encrypted = await this.encrypt(payloadString, derivedCekBytes, protectedHeaderB64Url);
|
|
143
|
+
// 3. Assemble the JWE. The `encrypted_key` is the result of the KEM encapsulation.
|
|
144
|
+
const recipientData = [{
|
|
145
|
+
header: { alg: recipient.crv, kid: recipient.kid },
|
|
146
|
+
encrypted_key: Content.bytesToRawBase64UrlSafe(encapsulatedCekBytes),
|
|
147
|
+
}];
|
|
148
|
+
return {
|
|
149
|
+
protected: protectedHeaderB64Url,
|
|
150
|
+
recipients: recipientData,
|
|
151
|
+
iv: encrypted.iv,
|
|
152
|
+
ciphertext: encrypted.ciphertext,
|
|
153
|
+
tag: encrypted.tag,
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
async encryptJweToCompact(payload, protectedHeader, secretJWKey, recipientJWKey) {
|
|
157
|
+
// 1. Construct the complete, final protected header by merging the main and recipient headers.
|
|
158
|
+
const recipientHeader = { alg: recipientJWKey.crv, kid: recipientJWKey.kid };
|
|
159
|
+
const finalProtectedHeader = { ...protectedHeader, ...recipientHeader };
|
|
160
|
+
const protectedHeaderB64Url = Content.objectToRawBase64UrlSafe(finalProtectedHeader);
|
|
161
|
+
// 2. Perform KEM to derive the Content Encryption Key (CEK).
|
|
162
|
+
const publicKeyBytes = Content.base64ToBytes(recipientJWKey.x);
|
|
163
|
+
const cekSeedBytes = await this.cryptoHelper.getRandomBytes(32);
|
|
164
|
+
const { derivedCekBytes, encapsulatedCekBytes } = await this.encapsulate(cekSeedBytes, secretJWKey.dBytes, publicKeyBytes);
|
|
165
|
+
const encapsulatedKeyB64Url = Content.bytesToRawBase64UrlSafe(encapsulatedCekBytes);
|
|
166
|
+
// 3. Encrypt the payload using the derived CEK and the *final* protected header as AAD.
|
|
167
|
+
const payloadBytes = typeof payload === 'string'
|
|
168
|
+
? Content.stringToBytesUTF8(payload)
|
|
169
|
+
: Content.objectToBytes(payload);
|
|
170
|
+
if (finalProtectedHeader.zip === 'DEF') {
|
|
171
|
+
// Note: Compressing a compact JWS string is often inefficient, but supported.
|
|
172
|
+
const compressedPayload = pako.deflate(payloadBytes);
|
|
173
|
+
const payloadString = Content.bytesToRawBase64UrlSafe(compressedPayload);
|
|
174
|
+
const encrypted = await this.encrypt(payloadString, derivedCekBytes, protectedHeaderB64Url);
|
|
175
|
+
return `${protectedHeaderB64Url}.${encapsulatedKeyB64Url}.${encrypted.iv}.${encrypted.ciphertext}.${encrypted.tag}`;
|
|
176
|
+
}
|
|
177
|
+
const payloadString = Content.bytesToStringASCII(payloadBytes);
|
|
178
|
+
const encrypted = await this.encrypt(payloadString, derivedCekBytes, protectedHeaderB64Url);
|
|
179
|
+
// 4. Assemble the 5 parts of the compact JWE.
|
|
180
|
+
return `${protectedHeaderB64Url}.${encapsulatedKeyB64Url}.${encrypted.iv}.${encrypted.ciphertext}.${encrypted.tag}`;
|
|
181
|
+
}
|
|
182
|
+
async decryptJwe(jwe, secretKeyJwk) {
|
|
183
|
+
const jweObject = typeof jwe === 'string' ? this.parseCompactJwe(jwe) : jwe;
|
|
184
|
+
const recipient = jweObject.recipients.find(r => r.header?.kid === secretKeyJwk.kid);
|
|
185
|
+
if (!recipient || !recipient.encrypted_key) {
|
|
186
|
+
throw new Error(`JWE does not contain a recipient with kid=${secretKeyJwk.kid}`);
|
|
187
|
+
}
|
|
188
|
+
// Decapsulate to get the CEK
|
|
189
|
+
const encapsulatedKeyBytes = Content.base64ToBytes(recipient.encrypted_key);
|
|
190
|
+
const cekBytes = await this.decapsulate(encapsulatedKeyBytes, secretKeyJwk.dBytes);
|
|
191
|
+
// Decrypt the payload
|
|
192
|
+
const encryptedData = { ciphertext: jweObject.ciphertext, iv: jweObject.iv, tag: jweObject.tag };
|
|
193
|
+
const decryptedPayloadString = await this.decrypt(encryptedData, cekBytes, jweObject.protected);
|
|
194
|
+
// Handle decompression
|
|
195
|
+
const protectedHeader = Content.base64UrlSafeToJSON(jweObject.protected);
|
|
196
|
+
let decryptedBytes;
|
|
197
|
+
if (protectedHeader.zip === 'DEF') {
|
|
198
|
+
const compressedBytes = Content.base64ToBytes(decryptedPayloadString);
|
|
199
|
+
decryptedBytes = pako.inflate(compressedBytes);
|
|
200
|
+
}
|
|
201
|
+
else {
|
|
202
|
+
decryptedBytes = Content.stringToBytesUTF8(decryptedPayloadString);
|
|
203
|
+
}
|
|
204
|
+
return { decryptedBytes, protectedHeader };
|
|
205
|
+
}
|
|
206
|
+
getRecipientKidsFromJwe(jwe) {
|
|
207
|
+
const jweObject = typeof jwe === 'string' ? this.parseCompactJwe(jwe) : jwe;
|
|
208
|
+
if (!jweObject.recipients) {
|
|
209
|
+
return [];
|
|
210
|
+
}
|
|
211
|
+
return jweObject.recipients
|
|
212
|
+
.map(recipient => recipient.header?.kid)
|
|
213
|
+
.filter((kid) => !!kid);
|
|
214
|
+
}
|
|
215
|
+
async signDataJws(payload, protectedHeader, secretKeyBytes) {
|
|
216
|
+
const protectedHeaderB64Url = Content.objectToRawBase64UrlSafe(protectedHeader);
|
|
217
|
+
const payloadB64Url = await jwtUtils.encodePayload(payload);
|
|
218
|
+
const signingInput = `${protectedHeaderB64Url}.${payloadB64Url}`;
|
|
219
|
+
const signingInputBytes = Content.stringToBytesUTF8(signingInput);
|
|
220
|
+
// Infer algorithm from protected header
|
|
221
|
+
const alg = protectedHeader.alg;
|
|
222
|
+
if (!alg)
|
|
223
|
+
throw new Error("Protected header must contain 'alg' property for signing.");
|
|
224
|
+
const signatureBytes = await this.signBytes(signingInputBytes, secretKeyBytes, alg);
|
|
225
|
+
const jwsParts = {
|
|
226
|
+
protected: protectedHeaderB64Url,
|
|
227
|
+
payload: payloadB64Url,
|
|
228
|
+
signature: Content.bytesToRawBase64UrlSafe(signatureBytes),
|
|
229
|
+
};
|
|
230
|
+
return jwsParts;
|
|
231
|
+
}
|
|
232
|
+
async verifyJws(jws, publicJwk) {
|
|
233
|
+
const parts = typeof jws === 'string' ? jwtUtils.getPartsJWT(jws) : jws;
|
|
234
|
+
if (!parts)
|
|
235
|
+
throw new Error('Invalid Compact JWS format');
|
|
236
|
+
const signingInput = `${parts.protected}.${parts.payload}`;
|
|
237
|
+
const signingInputBytes = Content.stringToBytesUTF8(signingInput);
|
|
238
|
+
const signatureBytes = Content.base64ToBytes(parts.signature);
|
|
239
|
+
return this.verifyBytes(signatureBytes, signingInputBytes, publicJwk);
|
|
240
|
+
}
|
|
241
|
+
async verifyDetachedJws(payloadBytes, detachedJws, publicJWKey) {
|
|
242
|
+
const parts = detachedJws.split('..');
|
|
243
|
+
if (parts.length !== 2)
|
|
244
|
+
throw new Error("Invalid Detached JWS format");
|
|
245
|
+
const protectedHeaderB64Url = parts[0];
|
|
246
|
+
const signatureB64Url = parts[1];
|
|
247
|
+
const payloadB64Url = Content.bytesToRawBase64UrlSafe(payloadBytes);
|
|
248
|
+
const signingInput = `${protectedHeaderB64Url}.${payloadB64Url}`;
|
|
249
|
+
const signingInputBytes = Content.stringToBytesUTF8(signingInput);
|
|
250
|
+
const signatureBytes = Content.base64ToBytes(signatureB64Url);
|
|
251
|
+
return this.verifyBytes(signatureBytes, signingInputBytes, publicJWKey);
|
|
252
|
+
}
|
|
253
|
+
// --- Low-Level Primitives ---
|
|
254
|
+
encrypt(plaintext, cekBytes, aad) {
|
|
255
|
+
return this.aesManager.encrypt(plaintext, cekBytes, aad);
|
|
256
|
+
}
|
|
257
|
+
decrypt(encryptedData, cekBytes, aad) {
|
|
258
|
+
return this.aesManager.decrypt(encryptedData, cekBytes, aad);
|
|
259
|
+
}
|
|
260
|
+
async encapsulate(cekSeedBytes, secretKeyBytes, recipientPublicKeyBytes) {
|
|
261
|
+
// According to RFC 9278 (JWE with ML-KEM), a seed is used for the KEM encapsulation.
|
|
262
|
+
// The KEM then derives a shared secret from this seed. It is this *derived* shared secret
|
|
263
|
+
// that is used to encrypt the content, NOT the original seed.
|
|
264
|
+
// The `encapsulate` function from the noble library handles this correctly by accepting the
|
|
265
|
+
// seed as the second argument. It returns both the encapsulated key (`cipherText`)
|
|
266
|
+
// and the derived shared secret, which we must use as the actual AES key.
|
|
267
|
+
const mlKem = await this.loadMlKem();
|
|
268
|
+
const { sharedSecret, cipherText } = await mlKem.ml_kem768.encapsulate(recipientPublicKeyBytes, cekSeedBytes);
|
|
269
|
+
return { derivedCekBytes: sharedSecret, encapsulatedCekBytes: cipherText };
|
|
270
|
+
}
|
|
271
|
+
async decapsulate(encapsulatedBytes, secretKeyBytes) {
|
|
272
|
+
const mlKem = await this.loadMlKem();
|
|
273
|
+
return mlKem.ml_kem768.decapsulate(encapsulatedBytes, secretKeyBytes);
|
|
274
|
+
}
|
|
275
|
+
async signBytes(payloadBytes, secretKeyBytes, alg) {
|
|
276
|
+
const mlDsa = await this.loadMlDsa();
|
|
277
|
+
switch (alg) {
|
|
278
|
+
case 'ML-DSA-44': return mlDsa.ml_dsa44.sign(payloadBytes, secretKeyBytes);
|
|
279
|
+
case 'ML-DSA-65': return mlDsa.ml_dsa65.sign(payloadBytes, secretKeyBytes);
|
|
280
|
+
case 'ML-DSA-87': return mlDsa.ml_dsa87.sign(payloadBytes, secretKeyBytes);
|
|
281
|
+
default: throw new Error(`Unsupported ML-DSA algorithm: ${alg}`);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
async verifyBytes(signatureBytes, dataBytes, publicKey) {
|
|
285
|
+
const mlDsa = await this.loadMlDsa();
|
|
286
|
+
const publicKeyBytes = Content.base64ToBytes(publicKey.pub || publicKey.x);
|
|
287
|
+
const alg = publicKey.alg;
|
|
288
|
+
if (!alg)
|
|
289
|
+
throw new Error("Public key must contain 'alg' property for verification.");
|
|
290
|
+
switch (alg) {
|
|
291
|
+
case 'ML-DSA-44': return mlDsa.ml_dsa44.verify(signatureBytes, dataBytes, publicKeyBytes);
|
|
292
|
+
case 'ML-DSA-65': return mlDsa.ml_dsa65.verify(signatureBytes, dataBytes, publicKeyBytes);
|
|
293
|
+
case 'ML-DSA-87': return mlDsa.ml_dsa87.verify(signatureBytes, dataBytes, publicKeyBytes);
|
|
294
|
+
default: throw new Error(`Unsupported ML-DSA algorithm: ${alg}`);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
// --- Formatting & Parsing Utilities ---
|
|
298
|
+
jwsToCompact(jws) {
|
|
299
|
+
return `${jws.protected}.${jws.payload}.${jws.signature}`;
|
|
300
|
+
}
|
|
301
|
+
parseCompactJws(jwsString) {
|
|
302
|
+
if (jwsString.trim().startsWith('{')) {
|
|
303
|
+
const parsed = JSON.parse(jwsString);
|
|
304
|
+
if (!parsed.payload || !parsed.signatures || !parsed.signatures[0]) {
|
|
305
|
+
throw new Error("Invalid JWS JSON format");
|
|
306
|
+
}
|
|
307
|
+
return {
|
|
308
|
+
payload: parsed.payload,
|
|
309
|
+
protected: parsed.signatures[0].protected,
|
|
310
|
+
signature: parsed.signatures[0].signature,
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
const parts = jwtUtils.getPartsJWT(jwsString);
|
|
314
|
+
if (!parts)
|
|
315
|
+
throw new Error("Invalid Compact JWS format");
|
|
316
|
+
const result = {
|
|
317
|
+
payload: Content.base64UrlSafeToJSON(parts.payload),
|
|
318
|
+
protected: Content.base64UrlSafeToJSON(parts.protected),
|
|
319
|
+
signature: Content.base64ToBytes(parts.signature),
|
|
320
|
+
};
|
|
321
|
+
return result;
|
|
322
|
+
}
|
|
323
|
+
parseCompactJwe(jweString) {
|
|
324
|
+
if (jweString.trim().startsWith('{')) {
|
|
325
|
+
return JSON.parse(jweString);
|
|
326
|
+
}
|
|
327
|
+
const parts = jweString.split('.');
|
|
328
|
+
if (parts.length !== 5)
|
|
329
|
+
throw new Error("Invalid Compact JWE format");
|
|
330
|
+
const protectedHeader = Content.base64UrlSafeToJSON(parts[0]);
|
|
331
|
+
// Compact JWE has no per-recipient header, but our model requires one.
|
|
332
|
+
// The 'kid' should be in the main protected header for decryption to work.
|
|
333
|
+
return {
|
|
334
|
+
protected: parts[0],
|
|
335
|
+
recipients: [{
|
|
336
|
+
header: { alg: protectedHeader.alg || '', kid: protectedHeader.kid || '' },
|
|
337
|
+
encrypted_key: parts[1]
|
|
338
|
+
}],
|
|
339
|
+
iv: parts[2],
|
|
340
|
+
ciphertext: parts[3],
|
|
341
|
+
tag: parts[4],
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
// --- JWK Thumbprint Calculation (RFC 7638) ---
|
|
345
|
+
/**
|
|
346
|
+
* Computes a JWK thumbprint using a specified hash algorithm.
|
|
347
|
+
* This implementation is platform-agnostic by using the injected ICryptoHelper.
|
|
348
|
+
*/
|
|
349
|
+
async _computeJwkThumbprint(jwk, hash = "SHA-256") {
|
|
350
|
+
const baseJwk = this._toBaseJwk(jwk);
|
|
351
|
+
const canonical = this._canonicalizeForJwkThumbprint(baseJwk);
|
|
352
|
+
// Use the platform-agnostic digest method
|
|
353
|
+
const digestHex = await this.cryptoHelper.digestString(canonical, hash);
|
|
354
|
+
// The digestString returns a hex string, but thumbprints are Base64UrlSafe.
|
|
355
|
+
// We need to convert from hex to bytes, then bytes to Base64UrlSafe.
|
|
356
|
+
const digestBytes = this._hexToBytes(digestHex);
|
|
357
|
+
return Content.bytesToRawBase64UrlSafe(digestBytes);
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Creates a canonical string from a simple, flat JSON object as required by
|
|
361
|
+
* RFC 7638 for JWK thumbprints.
|
|
362
|
+
*/
|
|
363
|
+
_canonicalizeForJwkThumbprint(obj) {
|
|
364
|
+
const keys = Object.keys(obj).sort();
|
|
365
|
+
const parts = keys.map(k => `"${k}":${JSON.stringify(obj[k])}`);
|
|
366
|
+
return `{${parts.join(",")}}`;
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Extracts the Base JWK for thumbprint calculation per RFC 7638.
|
|
370
|
+
* This handles both Post-Quantum (OKP, AKP) and legacy (EC) key types.
|
|
371
|
+
*/
|
|
372
|
+
_toBaseJwk(jwk) {
|
|
373
|
+
if (jwk.kty === "OKP") {
|
|
374
|
+
const { crv, x } = jwk;
|
|
375
|
+
return { kty: "OKP", crv, x };
|
|
376
|
+
}
|
|
377
|
+
else if (jwk.kty === "AKP") {
|
|
378
|
+
const { alg, pub } = jwk;
|
|
379
|
+
return { kty: "AKP", alg, pub };
|
|
380
|
+
}
|
|
381
|
+
else if (jwk.kty === "EC") {
|
|
382
|
+
const { crv, x, y } = jwk;
|
|
383
|
+
const baseJwk = { kty: "EC", crv, x, y };
|
|
384
|
+
return baseJwk;
|
|
385
|
+
}
|
|
386
|
+
else {
|
|
387
|
+
const exhaustiveCheck = jwk;
|
|
388
|
+
throw new Error(`Unsupported key type for JWK thumbprint: ${exhaustiveCheck.kty}`);
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Utility to convert a hex string to a Uint8Array.
|
|
393
|
+
*/
|
|
394
|
+
_hexToBytes(hex) {
|
|
395
|
+
const bytes = new Uint8Array(hex.length / 2);
|
|
396
|
+
for (let i = 0; i < hex.length; i += 2) {
|
|
397
|
+
bytes[i / 2] = parseInt(hex.substr(i, 2), 16);
|
|
398
|
+
}
|
|
399
|
+
return bytes;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical actor-kind vocabulary shared across SDK packages.
|
|
3
|
+
*/
|
|
4
|
+
export declare const ActorKinds: Readonly<{
|
|
5
|
+
readonly HostOnboarding: "host_onboarding";
|
|
6
|
+
readonly OrganizationController: "organization_controller";
|
|
7
|
+
readonly OrganizationEmployee: "organization_employee";
|
|
8
|
+
readonly IndividualController: "individual_controller";
|
|
9
|
+
readonly IndividualMember: "individual_member";
|
|
10
|
+
readonly Professional: "professional";
|
|
11
|
+
}>;
|
|
12
|
+
/**
|
|
13
|
+
* Canonical capability vocabulary shared across SDK packages.
|
|
14
|
+
*/
|
|
15
|
+
export declare const ActorCapabilities: Readonly<{
|
|
16
|
+
readonly HostActivateOrganization: "host.activate_organization";
|
|
17
|
+
readonly HostConfirmOrder: "host.confirm_order";
|
|
18
|
+
readonly OrganizationCreateEmployee: "organization.create_employee";
|
|
19
|
+
readonly OrganizationDisableEmployee: "organization.disable_employee";
|
|
20
|
+
readonly OrganizationPurgeEmployee: "organization.purge_employee";
|
|
21
|
+
readonly OrganizationActivateDevice: "organization.activate_device";
|
|
22
|
+
readonly OrganizationIssueActivationCode: "organization.issue_activation_code";
|
|
23
|
+
readonly OrganizationRequestSmartToken: "organization.request_smart_token";
|
|
24
|
+
readonly IndividualBootstrap: "individual.bootstrap";
|
|
25
|
+
readonly IndividualDisable: "individual.disable";
|
|
26
|
+
readonly IndividualPurge: "individual.purge";
|
|
27
|
+
readonly IndividualImportIps: "individual.import_ips";
|
|
28
|
+
readonly IndividualGenerateDigitalTwin: "individual.generate_digital_twin";
|
|
29
|
+
readonly IndividualIngestCommunication: "individual.ingest_communication";
|
|
30
|
+
readonly IndividualUpsertRelatedPerson: "individual.upsert_related_person";
|
|
31
|
+
readonly IndividualMemberDisable: "individual_member.disable";
|
|
32
|
+
readonly IndividualMemberPurge: "individual_member.purge";
|
|
33
|
+
readonly ConsentGrantProfessionalAccess: "consent.grant_professional_access";
|
|
34
|
+
readonly ProfessionalMedication: "professional.medication";
|
|
35
|
+
readonly ProfessionalAppointment: "professional.appointment";
|
|
36
|
+
readonly ProfessionalRequestSmartToken: "professional.request_smart_token";
|
|
37
|
+
readonly TokenRequestSmart: "token.request_smart";
|
|
38
|
+
}>;
|
|
39
|
+
export type ActorKindsValue = typeof ActorKinds[keyof typeof ActorKinds];
|
|
40
|
+
export type ActorCapabilitiesValue = typeof ActorCapabilities[keyof typeof ActorCapabilities];
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
|
|
2
|
+
// Always create JSDoc, do not use strings inline in keys nor values, use types instead, and reuse the data test examples.
|
|
3
|
+
/**
|
|
4
|
+
* Canonical actor-kind vocabulary shared across SDK packages.
|
|
5
|
+
*/
|
|
6
|
+
export const ActorKinds = Object.freeze({
|
|
7
|
+
HostOnboarding: 'host_onboarding',
|
|
8
|
+
OrganizationController: 'organization_controller',
|
|
9
|
+
OrganizationEmployee: 'organization_employee',
|
|
10
|
+
IndividualController: 'individual_controller',
|
|
11
|
+
IndividualMember: 'individual_member',
|
|
12
|
+
Professional: 'professional',
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* Canonical capability vocabulary shared across SDK packages.
|
|
16
|
+
*/
|
|
17
|
+
export const ActorCapabilities = Object.freeze({
|
|
18
|
+
HostActivateOrganization: 'host.activate_organization',
|
|
19
|
+
HostConfirmOrder: 'host.confirm_order',
|
|
20
|
+
OrganizationCreateEmployee: 'organization.create_employee',
|
|
21
|
+
OrganizationDisableEmployee: 'organization.disable_employee',
|
|
22
|
+
OrganizationPurgeEmployee: 'organization.purge_employee',
|
|
23
|
+
OrganizationActivateDevice: 'organization.activate_device',
|
|
24
|
+
OrganizationIssueActivationCode: 'organization.issue_activation_code',
|
|
25
|
+
OrganizationRequestSmartToken: 'organization.request_smart_token',
|
|
26
|
+
IndividualBootstrap: 'individual.bootstrap',
|
|
27
|
+
IndividualDisable: 'individual.disable',
|
|
28
|
+
IndividualPurge: 'individual.purge',
|
|
29
|
+
IndividualImportIps: 'individual.import_ips',
|
|
30
|
+
IndividualGenerateDigitalTwin: 'individual.generate_digital_twin',
|
|
31
|
+
IndividualIngestCommunication: 'individual.ingest_communication',
|
|
32
|
+
IndividualUpsertRelatedPerson: 'individual.upsert_related_person',
|
|
33
|
+
IndividualMemberDisable: 'individual_member.disable',
|
|
34
|
+
IndividualMemberPurge: 'individual_member.purge',
|
|
35
|
+
ConsentGrantProfessionalAccess: 'consent.grant_professional_access',
|
|
36
|
+
ProfessionalMedication: 'professional.medication',
|
|
37
|
+
ProfessionalAppointment: 'professional.appointment',
|
|
38
|
+
ProfessionalRequestSmartToken: 'professional.request_smart_token',
|
|
39
|
+
TokenRequestSmart: 'token.request_smart',
|
|
40
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare const HL7_COMMUNICATION_CATEGORY_SYSTEM: "http://terminology.hl7.org/CodeSystem/communication-category";
|
|
2
|
+
export type CommunicationCategoryDescriptor = Readonly<{
|
|
3
|
+
system: typeof HL7_COMMUNICATION_CATEGORY_SYSTEM;
|
|
4
|
+
code: string;
|
|
5
|
+
claim: string;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const CommunicationCategoryCodes: Readonly<{
|
|
8
|
+
readonly Alert: Readonly<{
|
|
9
|
+
system: typeof HL7_COMMUNICATION_CATEGORY_SYSTEM;
|
|
10
|
+
code: string;
|
|
11
|
+
claim: string;
|
|
12
|
+
}>;
|
|
13
|
+
readonly Notification: Readonly<{
|
|
14
|
+
system: typeof HL7_COMMUNICATION_CATEGORY_SYSTEM;
|
|
15
|
+
code: string;
|
|
16
|
+
claim: string;
|
|
17
|
+
}>;
|
|
18
|
+
readonly Reminder: Readonly<{
|
|
19
|
+
system: typeof HL7_COMMUNICATION_CATEGORY_SYSTEM;
|
|
20
|
+
code: string;
|
|
21
|
+
claim: string;
|
|
22
|
+
}>;
|
|
23
|
+
readonly Instruction: Readonly<{
|
|
24
|
+
system: typeof HL7_COMMUNICATION_CATEGORY_SYSTEM;
|
|
25
|
+
code: string;
|
|
26
|
+
claim: string;
|
|
27
|
+
}>;
|
|
28
|
+
}>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const HL7_COMMUNICATION_CATEGORY_SYSTEM = 'http://terminology.hl7.org/CodeSystem/communication-category';
|
|
2
|
+
function defineCommunicationCategory(code) {
|
|
3
|
+
return Object.freeze({
|
|
4
|
+
system: HL7_COMMUNICATION_CATEGORY_SYSTEM,
|
|
5
|
+
code,
|
|
6
|
+
claim: `${HL7_COMMUNICATION_CATEGORY_SYSTEM}|${code}`,
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
export const CommunicationCategoryCodes = Object.freeze({
|
|
10
|
+
Alert: defineCommunicationCategory('alert'),
|
|
11
|
+
Notification: defineCommunicationCategory('notification'),
|
|
12
|
+
Reminder: defineCommunicationCategory('reminder'),
|
|
13
|
+
Instruction: defineCommunicationCategory('instruction'),
|
|
14
|
+
});
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { MldsaAlg, MlkemCurve } from '../interfaces/Cryptography.types';
|
|
2
|
+
/**
|
|
3
|
+
* Canonical JOSE/JWK `use` values used across GDC communication key material.
|
|
4
|
+
*/
|
|
5
|
+
export declare const JwkKeyUses: {
|
|
6
|
+
readonly Signature: "sig";
|
|
7
|
+
readonly Encryption: "enc";
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Canonical public-key purposes used by GW and SDKs to distinguish communication
|
|
11
|
+
* signing keys from VC signing keys.
|
|
12
|
+
*/
|
|
13
|
+
export declare const CommunicationKeyPurposes: {
|
|
14
|
+
readonly CommunicationSignature: "comm_sig";
|
|
15
|
+
readonly VerifiableCredentialSignature: "vc_sign";
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Classical JOSE signature algorithms currently recognized across GDC VP/JWT
|
|
19
|
+
* examples and gateway trust adapters.
|
|
20
|
+
*
|
|
21
|
+
* Notes:
|
|
22
|
+
* - `ES256K` is the JOSE name for ECDSA over `secp256k1`
|
|
23
|
+
* - `ES384` remains the common P-384 legacy example in current GW fixtures
|
|
24
|
+
*/
|
|
25
|
+
export declare const ClassicalJoseSignatureAlgorithms: {
|
|
26
|
+
readonly Es256: "ES256";
|
|
27
|
+
readonly Es256K: "ES256K";
|
|
28
|
+
readonly Es384: "ES384";
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* JOSE signature algorithms accepted by shared VP/JWT helpers.
|
|
32
|
+
*
|
|
33
|
+
* This intentionally covers both:
|
|
34
|
+
* - classical ECDSA JOSE algorithms (`ES256`, `ES256K`, `ES384`)
|
|
35
|
+
* - post-quantum ML-DSA JOSE algorithm labels already used by GW
|
|
36
|
+
*
|
|
37
|
+
* Use this type when a helper builds or documents a JWS/JWT/VP proof header.
|
|
38
|
+
*/
|
|
39
|
+
export type JoseSignatureAlgorithm = typeof ClassicalJoseSignatureAlgorithms[keyof typeof ClassicalJoseSignatureAlgorithms] | MldsaAlg;
|
|
40
|
+
/**
|
|
41
|
+
* Default post-quantum signing algorithms used for communication bootstrap.
|
|
42
|
+
*/
|
|
43
|
+
export declare const DefaultSigningAlgorithms: {
|
|
44
|
+
Communication: MldsaAlg;
|
|
45
|
+
VerifiableCredential: MldsaAlg;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Default post-quantum encryption curve used for communication bootstrap.
|
|
49
|
+
*/
|
|
50
|
+
export declare const DefaultEncryptionCurves: {
|
|
51
|
+
Communication: MlkemCurve;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Canonical JOSE content-encryption algorithms used by DIDComm/JWE envelopes.
|
|
55
|
+
*/
|
|
56
|
+
export declare const JoseContentEncryptionAlgorithms: {
|
|
57
|
+
readonly Aes256Gcm: "A256GCM";
|
|
58
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Copyright 2025 Antifraud Services Inc. under the Apache License, Version 2.0.
|
|
2
|
+
import { AES_GCM_JWA_ENC } from '../models/aes';
|
|
3
|
+
/**
|
|
4
|
+
* Canonical JOSE/JWK `use` values used across GDC communication key material.
|
|
5
|
+
*/
|
|
6
|
+
export const JwkKeyUses = {
|
|
7
|
+
Signature: 'sig',
|
|
8
|
+
Encryption: 'enc',
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Canonical public-key purposes used by GW and SDKs to distinguish communication
|
|
12
|
+
* signing keys from VC signing keys.
|
|
13
|
+
*/
|
|
14
|
+
export const CommunicationKeyPurposes = {
|
|
15
|
+
CommunicationSignature: 'comm_sig',
|
|
16
|
+
VerifiableCredentialSignature: 'vc_sign',
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Classical JOSE signature algorithms currently recognized across GDC VP/JWT
|
|
20
|
+
* examples and gateway trust adapters.
|
|
21
|
+
*
|
|
22
|
+
* Notes:
|
|
23
|
+
* - `ES256K` is the JOSE name for ECDSA over `secp256k1`
|
|
24
|
+
* - `ES384` remains the common P-384 legacy example in current GW fixtures
|
|
25
|
+
*/
|
|
26
|
+
export const ClassicalJoseSignatureAlgorithms = {
|
|
27
|
+
Es256: 'ES256',
|
|
28
|
+
Es256K: 'ES256K',
|
|
29
|
+
Es384: 'ES384',
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Default post-quantum signing algorithms used for communication bootstrap.
|
|
33
|
+
*/
|
|
34
|
+
export const DefaultSigningAlgorithms = {
|
|
35
|
+
Communication: 'ML-DSA-44',
|
|
36
|
+
VerifiableCredential: 'ML-DSA-44',
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Default post-quantum encryption curve used for communication bootstrap.
|
|
40
|
+
*/
|
|
41
|
+
export const DefaultEncryptionCurves = {
|
|
42
|
+
Communication: 'ML-KEM-768',
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Canonical JOSE content-encryption algorithms used by DIDComm/JWE envelopes.
|
|
46
|
+
*/
|
|
47
|
+
export const JoseContentEncryptionAlgorithms = {
|
|
48
|
+
Aes256Gcm: AES_GCM_JWA_ENC,
|
|
49
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared discovery-source policies used by backend/bootstrap layers that must
|
|
3
|
+
* decide whether to start from configured defaults or from live internet/ICA
|
|
4
|
+
* discovery.
|
|
5
|
+
*/
|
|
6
|
+
export declare const DataspaceDiscoverySourceMode: Readonly<{
|
|
7
|
+
readonly DefaultFirst: "default-first";
|
|
8
|
+
readonly DefaultsOnly: "defaults-only";
|
|
9
|
+
readonly InternetFirst: "internet-first";
|
|
10
|
+
}>;
|
|
11
|
+
export type DataspaceDiscoverySourceModeValue = typeof DataspaceDiscoverySourceMode[keyof typeof DataspaceDiscoverySourceMode];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
|
|
2
|
+
/**
|
|
3
|
+
* Shared discovery-source policies used by backend/bootstrap layers that must
|
|
4
|
+
* decide whether to start from configured defaults or from live internet/ICA
|
|
5
|
+
* discovery.
|
|
6
|
+
*/
|
|
7
|
+
export const DataspaceDiscoverySourceMode = Object.freeze({
|
|
8
|
+
DefaultFirst: 'default-first',
|
|
9
|
+
DefaultsOnly: 'defaults-only',
|
|
10
|
+
InternetFirst: 'internet-first',
|
|
11
|
+
});
|