@pagopa/io-react-native-wallet 3.2.0 → 3.4.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/README.md +1 -1
- package/lib/commonjs/credential/issuance/README.md +32 -14
- package/lib/commonjs/credential/issuance/api/IssuerConfig.js +1 -0
- package/lib/commonjs/credential/issuance/api/IssuerConfig.js.map +1 -1
- package/lib/commonjs/credential/issuance/common/02-start-user-authorization.js +4 -3
- package/lib/commonjs/credential/issuance/common/02-start-user-authorization.js.map +1 -1
- package/lib/commonjs/credential/issuance/common/06-verify-and-parse-credential.sdjwt.js +39 -8
- package/lib/commonjs/credential/issuance/common/06-verify-and-parse-credential.sdjwt.js.map +1 -1
- package/lib/commonjs/credential/issuance/mrtd-pop/02-init-challenge.js +46 -38
- package/lib/commonjs/credential/issuance/mrtd-pop/02-init-challenge.js.map +1 -1
- package/lib/commonjs/credential/issuance/mrtd-pop/03-validate-challenge.js +58 -51
- package/lib/commonjs/credential/issuance/mrtd-pop/03-validate-challenge.js.map +1 -1
- package/lib/commonjs/credential/issuance/mrtd-pop/index.js +21 -5
- package/lib/commonjs/credential/issuance/mrtd-pop/index.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.0.0/02-start-user-authorization.js +5 -4
- package/lib/commonjs/credential/issuance/v1.0.0/02-start-user-authorization.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.0.0/03-complete-user-authorization.js +8 -5
- package/lib/commonjs/credential/issuance/v1.0.0/03-complete-user-authorization.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.0.0/index.js +3 -2
- package/lib/commonjs/credential/issuance/v1.0.0/index.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.0.0/mappers.js +4 -2
- package/lib/commonjs/credential/issuance/v1.0.0/mappers.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.3.3/01-evaluate-issuer-trust.js +0 -2
- package/lib/commonjs/credential/issuance/v1.3.3/01-evaluate-issuer-trust.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.3.3/02-start-user-authorization.js +21 -17
- package/lib/commonjs/credential/issuance/v1.3.3/02-start-user-authorization.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.3.3/03-complete-user-authorization.js +108 -69
- package/lib/commonjs/credential/issuance/v1.3.3/03-complete-user-authorization.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.3.3/04-authorize-access.js +20 -19
- package/lib/commonjs/credential/issuance/v1.3.3/04-authorize-access.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.3.3/05-obtain-credential.js +5 -7
- package/lib/commonjs/credential/issuance/v1.3.3/05-obtain-credential.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.3.3/06-verify-and-parse-credential.js +4 -1
- package/lib/commonjs/credential/issuance/v1.3.3/06-verify-and-parse-credential.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.3.3/index.js +3 -2
- package/lib/commonjs/credential/issuance/v1.3.3/index.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.3.3/mappers.js +10 -11
- package/lib/commonjs/credential/issuance/v1.3.3/mappers.js.map +1 -1
- package/lib/commonjs/credential/presentation/api/types.js.map +1 -1
- package/lib/commonjs/credential/presentation/common/utils/http.js +9 -4
- package/lib/commonjs/credential/presentation/common/utils/http.js.map +1 -1
- package/lib/commonjs/credential/presentation/{v1.3.3/utils.mdoc.js → common/utils/mdoc.js} +2 -2
- package/lib/commonjs/credential/presentation/common/utils/mdoc.js.map +1 -0
- package/lib/commonjs/credential/presentation/v1.0.0/07-send-authorization-response.js +3 -1
- package/lib/commonjs/credential/presentation/v1.0.0/07-send-authorization-response.js.map +1 -1
- package/lib/commonjs/credential/presentation/v1.3.3/05-verify-request-object.js +11 -10
- package/lib/commonjs/credential/presentation/v1.3.3/05-verify-request-object.js.map +1 -1
- package/lib/commonjs/credential/presentation/v1.3.3/06-evaluate-dcql-query.js +2 -2
- package/lib/commonjs/credential/presentation/v1.3.3/06-evaluate-dcql-query.js.map +1 -1
- package/lib/commonjs/credential/presentation/v1.3.3/07-send-authorization-response.js +2 -0
- package/lib/commonjs/credential/presentation/v1.3.3/07-send-authorization-response.js.map +1 -1
- package/lib/commonjs/credential/presentation/v1.3.3/mappers.js +1 -1
- package/lib/commonjs/credential/presentation/v1.3.3/mappers.js.map +1 -1
- package/lib/commonjs/credential/status/README.md +3 -2
- package/lib/commonjs/credential/status/v1.3.3/01-status-list.js +27 -5
- package/lib/commonjs/credential/status/v1.3.3/01-status-list.js.map +1 -1
- package/lib/commonjs/credential/status/v1.3.3/02-verify-and-parse-status-list.js +17 -6
- package/lib/commonjs/credential/status/v1.3.3/02-verify-and-parse-status-list.js.map +1 -1
- package/lib/commonjs/credentials-catalogue/api/DigitalCredentialsCatalogue.js +2 -1
- package/lib/commonjs/credentials-catalogue/api/DigitalCredentialsCatalogue.js.map +1 -1
- package/lib/commonjs/credentials-catalogue/common/get-status-l10n-ids.js +23 -0
- package/lib/commonjs/credentials-catalogue/common/get-status-l10n-ids.js.map +1 -0
- package/lib/commonjs/credentials-catalogue/v1.0.0/index.js +3 -1
- package/lib/commonjs/credentials-catalogue/v1.0.0/index.js.map +1 -1
- package/lib/commonjs/credentials-catalogue/v1.3.3/index.js +3 -1
- package/lib/commonjs/credentials-catalogue/v1.3.3/index.js.map +1 -1
- package/lib/commonjs/mdoc/index.js +3 -24
- package/lib/commonjs/mdoc/index.js.map +1 -1
- package/lib/commonjs/sd-jwt/__test__/types.test.js +2 -14
- package/lib/commonjs/sd-jwt/__test__/types.test.js.map +1 -1
- package/lib/commonjs/sd-jwt/__test__/utils.test.js +0 -12
- package/lib/commonjs/sd-jwt/__test__/utils.test.js.map +1 -1
- package/lib/commonjs/sd-jwt/types.js +1 -14
- package/lib/commonjs/sd-jwt/types.js.map +1 -1
- package/lib/commonjs/utils/callbacks.js +20 -1
- package/lib/commonjs/utils/callbacks.js.map +1 -1
- package/lib/commonjs/utils/config.js +9 -1
- package/lib/commonjs/utils/config.js.map +1 -1
- package/lib/commonjs/utils/x509.js +34 -0
- package/lib/commonjs/utils/x509.js.map +1 -0
- package/lib/commonjs/wallet-instance-attestation/api/types.js +0 -2
- package/lib/commonjs/wallet-instance-attestation/api/types.js.map +1 -1
- package/lib/commonjs/wallet-instance-attestation/v1.3.3/mappers.js +1 -14
- package/lib/commonjs/wallet-instance-attestation/v1.3.3/mappers.js.map +1 -1
- package/lib/commonjs/wallet-instance-attestation/v1.3.3/types.js +2 -7
- package/lib/commonjs/wallet-instance-attestation/v1.3.3/types.js.map +1 -1
- package/lib/commonjs/wallet-unit-attestation/api/types.js +0 -11
- package/lib/commonjs/wallet-unit-attestation/api/types.js.map +1 -1
- package/lib/module/credential/issuance/README.md +32 -14
- package/lib/module/credential/issuance/api/IssuerConfig.js +1 -0
- package/lib/module/credential/issuance/api/IssuerConfig.js.map +1 -1
- package/lib/module/credential/issuance/common/02-start-user-authorization.js +4 -3
- package/lib/module/credential/issuance/common/02-start-user-authorization.js.map +1 -1
- package/lib/module/credential/issuance/common/06-verify-and-parse-credential.sdjwt.js +41 -10
- package/lib/module/credential/issuance/common/06-verify-and-parse-credential.sdjwt.js.map +1 -1
- package/lib/module/credential/issuance/mrtd-pop/02-init-challenge.js +47 -34
- package/lib/module/credential/issuance/mrtd-pop/02-init-challenge.js.map +1 -1
- package/lib/module/credential/issuance/mrtd-pop/03-validate-challenge.js +58 -47
- package/lib/module/credential/issuance/mrtd-pop/03-validate-challenge.js.map +1 -1
- package/lib/module/credential/issuance/mrtd-pop/index.js +20 -5
- package/lib/module/credential/issuance/mrtd-pop/index.js.map +1 -1
- package/lib/module/credential/issuance/v1.0.0/02-start-user-authorization.js +3 -2
- package/lib/module/credential/issuance/v1.0.0/02-start-user-authorization.js.map +1 -1
- package/lib/module/credential/issuance/v1.0.0/03-complete-user-authorization.js +6 -4
- package/lib/module/credential/issuance/v1.0.0/03-complete-user-authorization.js.map +1 -1
- package/lib/module/credential/issuance/v1.0.0/index.js +5 -4
- package/lib/module/credential/issuance/v1.0.0/index.js.map +1 -1
- package/lib/module/credential/issuance/v1.0.0/mappers.js +4 -2
- package/lib/module/credential/issuance/v1.0.0/mappers.js.map +1 -1
- package/lib/module/credential/issuance/v1.3.3/01-evaluate-issuer-trust.js +0 -2
- package/lib/module/credential/issuance/v1.3.3/01-evaluate-issuer-trust.js.map +1 -1
- package/lib/module/credential/issuance/v1.3.3/02-start-user-authorization.js +21 -17
- package/lib/module/credential/issuance/v1.3.3/02-start-user-authorization.js.map +1 -1
- package/lib/module/credential/issuance/v1.3.3/03-complete-user-authorization.js +108 -70
- package/lib/module/credential/issuance/v1.3.3/03-complete-user-authorization.js.map +1 -1
- package/lib/module/credential/issuance/v1.3.3/04-authorize-access.js +22 -19
- package/lib/module/credential/issuance/v1.3.3/04-authorize-access.js.map +1 -1
- package/lib/module/credential/issuance/v1.3.3/05-obtain-credential.js +6 -8
- package/lib/module/credential/issuance/v1.3.3/05-obtain-credential.js.map +1 -1
- package/lib/module/credential/issuance/v1.3.3/06-verify-and-parse-credential.js +4 -1
- package/lib/module/credential/issuance/v1.3.3/06-verify-and-parse-credential.js.map +1 -1
- package/lib/module/credential/issuance/v1.3.3/index.js +5 -4
- package/lib/module/credential/issuance/v1.3.3/index.js.map +1 -1
- package/lib/module/credential/issuance/v1.3.3/mappers.js +10 -11
- package/lib/module/credential/issuance/v1.3.3/mappers.js.map +1 -1
- package/lib/module/credential/presentation/api/types.js.map +1 -1
- package/lib/module/credential/presentation/common/utils/http.js +9 -4
- package/lib/module/credential/presentation/common/utils/http.js.map +1 -1
- package/lib/module/credential/presentation/{v1.3.3/utils.mdoc.js → common/utils/mdoc.js} +2 -2
- package/lib/module/credential/presentation/common/utils/mdoc.js.map +1 -0
- package/lib/module/credential/presentation/v1.0.0/07-send-authorization-response.js +3 -1
- package/lib/module/credential/presentation/v1.0.0/07-send-authorization-response.js.map +1 -1
- package/lib/module/credential/presentation/v1.3.3/05-verify-request-object.js +11 -10
- package/lib/module/credential/presentation/v1.3.3/05-verify-request-object.js.map +1 -1
- package/lib/module/credential/presentation/v1.3.3/06-evaluate-dcql-query.js +2 -3
- package/lib/module/credential/presentation/v1.3.3/06-evaluate-dcql-query.js.map +1 -1
- package/lib/module/credential/presentation/v1.3.3/07-send-authorization-response.js +2 -0
- package/lib/module/credential/presentation/v1.3.3/07-send-authorization-response.js.map +1 -1
- package/lib/module/credential/presentation/v1.3.3/mappers.js +1 -1
- package/lib/module/credential/presentation/v1.3.3/mappers.js.map +1 -1
- package/lib/module/credential/status/README.md +3 -2
- package/lib/module/credential/status/v1.3.3/01-status-list.js +27 -5
- package/lib/module/credential/status/v1.3.3/01-status-list.js.map +1 -1
- package/lib/module/credential/status/v1.3.3/02-verify-and-parse-status-list.js +17 -6
- package/lib/module/credential/status/v1.3.3/02-verify-and-parse-status-list.js.map +1 -1
- package/lib/module/credentials-catalogue/api/DigitalCredentialsCatalogue.js +1 -1
- package/lib/module/credentials-catalogue/api/DigitalCredentialsCatalogue.js.map +1 -1
- package/lib/module/credentials-catalogue/common/get-status-l10n-ids.js +16 -0
- package/lib/module/credentials-catalogue/common/get-status-l10n-ids.js.map +1 -0
- package/lib/module/credentials-catalogue/v1.0.0/index.js +3 -1
- package/lib/module/credentials-catalogue/v1.0.0/index.js.map +1 -1
- package/lib/module/credentials-catalogue/v1.3.3/index.js +3 -1
- package/lib/module/credentials-catalogue/v1.3.3/index.js.map +1 -1
- package/lib/module/mdoc/index.js +3 -24
- package/lib/module/mdoc/index.js.map +1 -1
- package/lib/module/sd-jwt/__test__/types.test.js +2 -14
- package/lib/module/sd-jwt/__test__/types.test.js.map +1 -1
- package/lib/module/sd-jwt/__test__/utils.test.js +0 -12
- package/lib/module/sd-jwt/__test__/utils.test.js.map +1 -1
- package/lib/module/sd-jwt/types.js +1 -14
- package/lib/module/sd-jwt/types.js.map +1 -1
- package/lib/module/utils/callbacks.js +19 -1
- package/lib/module/utils/callbacks.js.map +1 -1
- package/lib/module/utils/config.js +7 -0
- package/lib/module/utils/config.js.map +1 -1
- package/lib/module/utils/x509.js +28 -0
- package/lib/module/utils/x509.js.map +1 -0
- package/lib/module/wallet-instance-attestation/api/types.js +0 -2
- package/lib/module/wallet-instance-attestation/api/types.js.map +1 -1
- package/lib/module/wallet-instance-attestation/v1.3.3/mappers.js +1 -14
- package/lib/module/wallet-instance-attestation/v1.3.3/mappers.js.map +1 -1
- package/lib/module/wallet-instance-attestation/v1.3.3/types.js +2 -7
- package/lib/module/wallet-instance-attestation/v1.3.3/types.js.map +1 -1
- package/lib/module/wallet-unit-attestation/api/types.js +0 -11
- package/lib/module/wallet-unit-attestation/api/types.js.map +1 -1
- package/lib/typescript/credential/issuance/api/02-start-user-authorization.d.ts +1 -0
- package/lib/typescript/credential/issuance/api/02-start-user-authorization.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/api/03-complete-user-authorization.d.ts +19 -5
- package/lib/typescript/credential/issuance/api/03-complete-user-authorization.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/api/06-verify-and-parse-credential.d.ts +4 -0
- package/lib/typescript/credential/issuance/api/06-verify-and-parse-credential.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/api/IssuerConfig.d.ts +1 -0
- package/lib/typescript/credential/issuance/api/IssuerConfig.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/common/02-start-user-authorization.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/common/06-verify-and-parse-credential.sdjwt.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/mrtd-pop/02-init-challenge.d.ts +12 -1
- package/lib/typescript/credential/issuance/mrtd-pop/02-init-challenge.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/mrtd-pop/03-validate-challenge.d.ts +12 -1
- package/lib/typescript/credential/issuance/mrtd-pop/03-validate-challenge.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/mrtd-pop/index.d.ts +2 -1
- package/lib/typescript/credential/issuance/mrtd-pop/index.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/v1.0.0/02-start-user-authorization.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/v1.0.0/03-complete-user-authorization.d.ts +2 -1
- package/lib/typescript/credential/issuance/v1.0.0/03-complete-user-authorization.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/v1.0.0/index.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/v1.0.0/mappers.d.ts +1 -0
- package/lib/typescript/credential/issuance/v1.0.0/mappers.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/v1.3.3/01-evaluate-issuer-trust.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/v1.3.3/02-start-user-authorization.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/v1.3.3/03-complete-user-authorization.d.ts +2 -1
- package/lib/typescript/credential/issuance/v1.3.3/03-complete-user-authorization.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/v1.3.3/04-authorize-access.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/v1.3.3/05-obtain-credential.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/v1.3.3/06-verify-and-parse-credential.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/v1.3.3/index.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/v1.3.3/mappers.d.ts +7 -4
- package/lib/typescript/credential/issuance/v1.3.3/mappers.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/api/05-verify-request-object.d.ts +1 -1
- package/lib/typescript/credential/presentation/api/types.d.ts +3 -7
- package/lib/typescript/credential/presentation/api/types.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/common/utils/http.d.ts +1 -1
- package/lib/typescript/credential/presentation/common/utils/http.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/{v1.3.3/utils.mdoc.d.ts → common/utils/mdoc.d.ts} +2 -2
- package/lib/typescript/credential/presentation/common/utils/mdoc.d.ts.map +1 -0
- package/lib/typescript/credential/presentation/v1.3.3/05-verify-request-object.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/v1.3.3/06-evaluate-dcql-query.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/v1.3.3/07-send-authorization-response.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/v1.3.3/mappers.d.ts +8 -8
- package/lib/typescript/credential/presentation/v1.3.3/types.d.ts +8 -8
- package/lib/typescript/credential/status/api/status-list.d.ts +8 -4
- package/lib/typescript/credential/status/api/status-list.d.ts.map +1 -1
- package/lib/typescript/credential/status/v1.3.3/01-status-list.d.ts.map +1 -1
- package/lib/typescript/credential/status/v1.3.3/02-verify-and-parse-status-list.d.ts.map +1 -1
- package/lib/typescript/credentials-catalogue/api/DigitalCredentialsCatalogue.d.ts +6 -0
- package/lib/typescript/credentials-catalogue/api/DigitalCredentialsCatalogue.d.ts.map +1 -1
- package/lib/typescript/credentials-catalogue/api/index.d.ts +14 -2
- package/lib/typescript/credentials-catalogue/api/index.d.ts.map +1 -1
- package/lib/typescript/credentials-catalogue/common/get-status-l10n-ids.d.ts +9 -0
- package/lib/typescript/credentials-catalogue/common/get-status-l10n-ids.d.ts.map +1 -0
- package/lib/typescript/credentials-catalogue/v1.0.0/index.d.ts.map +1 -1
- package/lib/typescript/credentials-catalogue/v1.3.3/index.d.ts.map +1 -1
- package/lib/typescript/mdoc/index.d.ts +1 -1
- package/lib/typescript/mdoc/index.d.ts.map +1 -1
- package/lib/typescript/mdoc/utils.d.ts +0 -24
- package/lib/typescript/mdoc/utils.d.ts.map +1 -1
- package/lib/typescript/sd-jwt/types.d.ts +0 -12
- package/lib/typescript/sd-jwt/types.d.ts.map +1 -1
- package/lib/typescript/trust/v1.3.3/types.d.ts +6 -4
- package/lib/typescript/trust/v1.3.3/types.d.ts.map +1 -1
- package/lib/typescript/utils/callbacks.d.ts +7 -0
- package/lib/typescript/utils/callbacks.d.ts.map +1 -1
- package/lib/typescript/utils/config.d.ts +4 -0
- package/lib/typescript/utils/config.d.ts.map +1 -1
- package/lib/typescript/utils/x509.d.ts +10 -0
- package/lib/typescript/utils/x509.d.ts.map +1 -0
- package/lib/typescript/wallet-instance-attestation/api/types.d.ts +0 -2
- package/lib/typescript/wallet-instance-attestation/api/types.d.ts.map +1 -1
- package/lib/typescript/wallet-instance-attestation/v1.0.0/mappers.d.ts +0 -2
- package/lib/typescript/wallet-instance-attestation/v1.0.0/mappers.d.ts.map +1 -1
- package/lib/typescript/wallet-instance-attestation/v1.3.3/mappers.d.ts +2 -9
- package/lib/typescript/wallet-instance-attestation/v1.3.3/mappers.d.ts.map +1 -1
- package/lib/typescript/wallet-instance-attestation/v1.3.3/types.d.ts +2 -7
- package/lib/typescript/wallet-instance-attestation/v1.3.3/types.d.ts.map +1 -1
- package/lib/typescript/wallet-unit-attestation/api/types.d.ts +0 -11
- package/lib/typescript/wallet-unit-attestation/api/types.d.ts.map +1 -1
- package/lib/typescript/wallet-unit-attestation/v1.3.3/mappers.d.ts +0 -22
- package/lib/typescript/wallet-unit-attestation/v1.3.3/mappers.d.ts.map +1 -1
- package/lib/typescript/wallet-unit-attestation/v1.3.3/types.d.ts +0 -11
- package/lib/typescript/wallet-unit-attestation/v1.3.3/types.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/credential/issuance/README.md +32 -14
- package/src/credential/issuance/api/02-start-user-authorization.ts +1 -0
- package/src/credential/issuance/api/03-complete-user-authorization.ts +26 -5
- package/src/credential/issuance/api/06-verify-and-parse-credential.ts +4 -0
- package/src/credential/issuance/api/IssuerConfig.ts +1 -0
- package/src/credential/issuance/common/02-start-user-authorization.ts +6 -3
- package/src/credential/issuance/common/06-verify-and-parse-credential.sdjwt.ts +47 -10
- package/src/credential/issuance/mrtd-pop/02-init-challenge.ts +69 -45
- package/src/credential/issuance/mrtd-pop/03-validate-challenge.ts +84 -62
- package/src/credential/issuance/mrtd-pop/index.ts +13 -5
- package/src/credential/issuance/v1.0.0/02-start-user-authorization.ts +8 -2
- package/src/credential/issuance/v1.0.0/03-complete-user-authorization.ts +16 -4
- package/src/credential/issuance/v1.0.0/index.ts +6 -4
- package/src/credential/issuance/v1.0.0/mappers.ts +9 -1
- package/src/credential/issuance/v1.3.3/01-evaluate-issuer-trust.ts +0 -2
- package/src/credential/issuance/v1.3.3/02-start-user-authorization.ts +25 -21
- package/src/credential/issuance/v1.3.3/03-complete-user-authorization.ts +138 -94
- package/src/credential/issuance/v1.3.3/04-authorize-access.ts +28 -23
- package/src/credential/issuance/v1.3.3/05-obtain-credential.ts +9 -9
- package/src/credential/issuance/v1.3.3/06-verify-and-parse-credential.ts +2 -1
- package/src/credential/issuance/v1.3.3/index.ts +6 -4
- package/src/credential/issuance/v1.3.3/mappers.ts +13 -11
- package/src/credential/presentation/api/05-verify-request-object.ts +1 -1
- package/src/credential/presentation/api/types.ts +3 -7
- package/src/credential/presentation/common/utils/http.ts +2 -2
- package/src/credential/presentation/{v1.3.3/utils.mdoc.ts → common/utils/mdoc.ts} +2 -2
- package/src/credential/presentation/v1.0.0/07-send-authorization-response.ts +1 -1
- package/src/credential/presentation/v1.3.3/05-verify-request-object.ts +15 -14
- package/src/credential/presentation/v1.3.3/06-evaluate-dcql-query.ts +3 -3
- package/src/credential/presentation/v1.3.3/07-send-authorization-response.ts +2 -0
- package/src/credential/presentation/v1.3.3/mappers.ts +1 -1
- package/src/credential/status/README.md +3 -2
- package/src/credential/status/api/status-list.ts +10 -7
- package/src/credential/status/v1.3.3/01-status-list.ts +21 -7
- package/src/credential/status/v1.3.3/02-verify-and-parse-status-list.ts +19 -5
- package/src/credentials-catalogue/api/DigitalCredentialsCatalogue.ts +4 -1
- package/src/credentials-catalogue/api/index.ts +15 -0
- package/src/credentials-catalogue/common/get-status-l10n-ids.ts +25 -0
- package/src/credentials-catalogue/v1.0.0/index.ts +2 -0
- package/src/credentials-catalogue/v1.3.3/index.ts +2 -0
- package/src/mdoc/index.ts +5 -41
- package/src/sd-jwt/__test__/types.test.ts +1 -13
- package/src/sd-jwt/__test__/utils.test.ts +0 -12
- package/src/sd-jwt/types.ts +0 -13
- package/src/utils/callbacks.ts +28 -1
- package/src/utils/config.ts +7 -0
- package/src/utils/x509.ts +43 -0
- package/src/wallet-instance-attestation/api/types.ts +0 -2
- package/src/wallet-instance-attestation/v1.3.3/mappers.ts +3 -11
- package/src/wallet-instance-attestation/v1.3.3/types.ts +2 -7
- package/src/wallet-unit-attestation/api/types.ts +0 -11
- package/lib/commonjs/credential/issuance/common/authorization.js +0 -56
- package/lib/commonjs/credential/issuance/common/authorization.js.map +0 -1
- package/lib/commonjs/credential/presentation/common/utils.js +0 -28
- package/lib/commonjs/credential/presentation/common/utils.js.map +0 -1
- package/lib/commonjs/credential/presentation/v1.3.3/utils.mdoc.js.map +0 -1
- package/lib/module/credential/issuance/common/authorization.js +0 -48
- package/lib/module/credential/issuance/common/authorization.js.map +0 -1
- package/lib/module/credential/presentation/common/utils.js +0 -21
- package/lib/module/credential/presentation/common/utils.js.map +0 -1
- package/lib/module/credential/presentation/v1.3.3/utils.mdoc.js.map +0 -1
- package/lib/typescript/credential/issuance/common/authorization.d.ts +0 -21
- package/lib/typescript/credential/issuance/common/authorization.d.ts.map +0 -1
- package/lib/typescript/credential/presentation/common/utils.d.ts +0 -11
- package/lib/typescript/credential/presentation/common/utils.d.ts.map +0 -1
- package/lib/typescript/credential/presentation/v1.3.3/utils.mdoc.d.ts.map +0 -1
- package/src/credential/issuance/common/authorization.ts +0 -89
- package/src/credential/presentation/common/utils.ts +0 -30
|
@@ -41,6 +41,7 @@ export const mapToIssuerConfig = createMapper<
|
|
|
41
41
|
const {
|
|
42
42
|
oauth_authorization_server,
|
|
43
43
|
openid_credential_issuer,
|
|
44
|
+
openid_credential_verifier,
|
|
44
45
|
federation_entity,
|
|
45
46
|
} = x.metadata;
|
|
46
47
|
|
|
@@ -60,14 +61,19 @@ export const mapToIssuerConfig = createMapper<
|
|
|
60
61
|
credential_configurations_supported: mapCredentialConfigurationsSupported(
|
|
61
62
|
openid_credential_issuer
|
|
62
63
|
),
|
|
63
|
-
keys:
|
|
64
|
+
keys: [
|
|
65
|
+
...openid_credential_issuer.jwks.keys,
|
|
66
|
+
...oauth_authorization_server.jwks.keys,
|
|
67
|
+
] as JWK[],
|
|
64
68
|
pushed_authorization_request_endpoint:
|
|
65
69
|
oauth_authorization_server.pushed_authorization_request_endpoint,
|
|
66
70
|
token_endpoint: oauth_authorization_server.token_endpoint,
|
|
67
|
-
nonce_endpoint: openid_credential_issuer.nonce_endpoint
|
|
71
|
+
nonce_endpoint: openid_credential_issuer.nonce_endpoint ?? "",
|
|
68
72
|
federation_entity: federation_entity ?? {},
|
|
69
73
|
credential_issuance_batch_size:
|
|
70
74
|
openid_credential_issuer.batch_credential_issuance?.batch_size,
|
|
75
|
+
encrypted_response_enc_values_supported:
|
|
76
|
+
openid_credential_verifier?.encrypted_response_enc_values_supported,
|
|
71
77
|
};
|
|
72
78
|
},
|
|
73
79
|
{ outputSchema: IssuerConfig } // Output validation for extra-safety
|
|
@@ -76,13 +82,9 @@ export const mapToIssuerConfig = createMapper<
|
|
|
76
82
|
export const mapToRequestObject = createMapper<
|
|
77
83
|
ParsedAuthorizeRequestResult,
|
|
78
84
|
RequestObject
|
|
79
|
-
>(({ payload }) => ({
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
response_uri: payload.response_uri,
|
|
85
|
-
state: payload.state,
|
|
86
|
-
response_mode: payload.response_mode,
|
|
87
|
-
response_type: payload.response_type,
|
|
85
|
+
>(({ header, payload }) => ({
|
|
86
|
+
...payload,
|
|
87
|
+
iss: payload.iss ?? "",
|
|
88
|
+
trust_chain: header.trust_chain,
|
|
89
|
+
x5c: header.x5c as string[] | undefined,
|
|
88
90
|
}));
|
|
@@ -7,7 +7,7 @@ export interface VerifyRequestObjectApi {
|
|
|
7
7
|
* @since 1.0.0
|
|
8
8
|
*
|
|
9
9
|
* @param requestObjectEncodedJwt The Request Object in JWT format
|
|
10
|
-
* @param params.clientId The client ID to verify
|
|
10
|
+
* @param params.clientId The client ID to verify (it may include a prefix)
|
|
11
11
|
* @param params.rpConf Optional Relying Party configuration (OpenID Federation clients only)
|
|
12
12
|
* @param params.state Optional state
|
|
13
13
|
* @returns The verified Request Object
|
|
@@ -72,13 +72,9 @@ export type RemotePresentationDetails = {
|
|
|
72
72
|
type ClientMetadata = {
|
|
73
73
|
jwks: jsonWebKeySet;
|
|
74
74
|
encrypted_response_enc_values_supported: string[];
|
|
75
|
-
client_id: string;
|
|
76
|
-
client_name: string;
|
|
77
|
-
logo_uri: string;
|
|
78
|
-
application_type: "web";
|
|
79
|
-
request_uris: string[];
|
|
80
|
-
response_uris: string[];
|
|
81
75
|
vp_formats_supported: Record<string, { "sd-jwt_alg_values"?: string[] }>;
|
|
76
|
+
client_name?: string;
|
|
77
|
+
logo_uri?: string;
|
|
82
78
|
};
|
|
83
79
|
|
|
84
80
|
/**
|
|
@@ -88,7 +84,7 @@ export type RequestObject = {
|
|
|
88
84
|
iss: string;
|
|
89
85
|
response_uri: string;
|
|
90
86
|
nonce: string;
|
|
91
|
-
state
|
|
87
|
+
state?: string;
|
|
92
88
|
client_id: string;
|
|
93
89
|
dcql_query: Record<string, unknown>;
|
|
94
90
|
response_type: "vp_token";
|
|
@@ -9,11 +9,11 @@ import type { DirectAuthorizationBodyPayload } from "../../v1.0.0/types";
|
|
|
9
9
|
* @returns A URL-encoded string suitable for an `application/x-www-form-urlencoded` POST body.
|
|
10
10
|
*/
|
|
11
11
|
export const buildDirectPostBody = async (
|
|
12
|
-
|
|
12
|
+
{ state }: RequestObject,
|
|
13
13
|
payload: DirectAuthorizationBodyPayload
|
|
14
14
|
): Promise<string> => {
|
|
15
15
|
const formUrlEncodedBody = new URLSearchParams({
|
|
16
|
-
state
|
|
16
|
+
...(state && { state }),
|
|
17
17
|
...Object.entries(payload).reduce(
|
|
18
18
|
(acc, [key, value]) => ({
|
|
19
19
|
...acc,
|
|
@@ -5,8 +5,8 @@ import type {
|
|
|
5
5
|
Credential4Dcql,
|
|
6
6
|
EvaluatedDisclosure,
|
|
7
7
|
PresentationFrame,
|
|
8
|
-
} from "
|
|
9
|
-
import { getValidDcqlClaims } from "
|
|
8
|
+
} from "../../api";
|
|
9
|
+
import { getValidDcqlClaims } from "./dcql";
|
|
10
10
|
|
|
11
11
|
type CustomDcqlMdocCredential = DcqlMdocCredential & {
|
|
12
12
|
original_credential: Credential4Dcql;
|
|
@@ -81,7 +81,7 @@ export const buildDirectPostJwtBody = async (
|
|
|
81
81
|
// Build the x-www-form-urlencoded form body
|
|
82
82
|
const formBody = new URLSearchParams({
|
|
83
83
|
response: encryptedResponse,
|
|
84
|
-
state: requestObject.state,
|
|
84
|
+
...(requestObject.state && { state: requestObject.state }),
|
|
85
85
|
});
|
|
86
86
|
return formBody.toString();
|
|
87
87
|
};
|
|
@@ -14,7 +14,7 @@ import { mapToRequestObject } from "./mappers";
|
|
|
14
14
|
import type { RawRequestObject } from "./types";
|
|
15
15
|
|
|
16
16
|
export const verifyRequestObject: RemotePresentationApi["verifyRequestObject"] =
|
|
17
|
-
async (requestObjectEncodedJwt, { clientId, rpConf }) => {
|
|
17
|
+
async (requestObjectEncodedJwt, { clientId: fullClientId, rpConf }) => {
|
|
18
18
|
const parsedRequestObject = await sdkParseAuthorizeRequest({
|
|
19
19
|
config: sdkConfigV1_3,
|
|
20
20
|
requestObjectJwt: requestObjectEncodedJwt,
|
|
@@ -25,17 +25,22 @@ export const verifyRequestObject: RemotePresentationApi["verifyRequestObject"] =
|
|
|
25
25
|
|
|
26
26
|
const rawRequestObject = parsedRequestObject as RawRequestObject;
|
|
27
27
|
|
|
28
|
-
const
|
|
28
|
+
const { prefix, clientId } = extractClientIdPrefix(fullClientId);
|
|
29
29
|
|
|
30
|
-
if (
|
|
30
|
+
if (prefix === ClientIdPrefix.X509_HASH) {
|
|
31
31
|
validateX509HashClient(rawRequestObject.header.x5c, clientId);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
if (
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
prefix === ClientIdPrefix.OPENID_FEDERATION ||
|
|
36
|
+
prefix === ClientIdPrefix.NONE
|
|
37
37
|
) {
|
|
38
|
-
validateOpenIDFederationClient(
|
|
38
|
+
validateOpenIDFederationClient(
|
|
39
|
+
rawRequestObject,
|
|
40
|
+
fullClientId,
|
|
41
|
+
clientId,
|
|
42
|
+
rpConf
|
|
43
|
+
);
|
|
39
44
|
}
|
|
40
45
|
|
|
41
46
|
return {
|
|
@@ -45,6 +50,7 @@ export const verifyRequestObject: RemotePresentationApi["verifyRequestObject"] =
|
|
|
45
50
|
|
|
46
51
|
const validateOpenIDFederationClient = (
|
|
47
52
|
requestObject: RawRequestObject,
|
|
53
|
+
fullClientId: string,
|
|
48
54
|
clientId: string,
|
|
49
55
|
rpConf: RelyingPartyConfig | undefined
|
|
50
56
|
) => {
|
|
@@ -55,8 +61,8 @@ const validateOpenIDFederationClient = (
|
|
|
55
61
|
}
|
|
56
62
|
|
|
57
63
|
const isClientIdMatch =
|
|
58
|
-
|
|
59
|
-
|
|
64
|
+
fullClientId === requestObject.payload.client_id &&
|
|
65
|
+
clientId === rpConf.subject;
|
|
60
66
|
|
|
61
67
|
if (!isClientIdMatch) {
|
|
62
68
|
throw new InvalidRequestObjectError(
|
|
@@ -67,10 +73,8 @@ const validateOpenIDFederationClient = (
|
|
|
67
73
|
|
|
68
74
|
const validateX509HashClient = (
|
|
69
75
|
certificateChain: string[],
|
|
70
|
-
|
|
76
|
+
x509Hash: string
|
|
71
77
|
) => {
|
|
72
|
-
const [, x509Hash] = clientId.split(":");
|
|
73
|
-
|
|
74
78
|
const calculatedHash = QuickCrypto.createHash("sha-256")
|
|
75
79
|
.update(certificateChain[0]!, "base64")
|
|
76
80
|
.digest("base64url");
|
|
@@ -81,6 +85,3 @@ const validateX509HashClient = (
|
|
|
81
85
|
);
|
|
82
86
|
}
|
|
83
87
|
};
|
|
84
|
-
|
|
85
|
-
const stripOpenIdFederationPrefix = (clientId: string) =>
|
|
86
|
-
clientId.replace("openid_federation:", "");
|
|
@@ -2,13 +2,13 @@ import { DcqlQuery, DcqlError } from "dcql";
|
|
|
2
2
|
import { isValiError } from "valibot";
|
|
3
3
|
import { CredentialsNotFoundError } from "../common/errors";
|
|
4
4
|
import type { CredentialPurpose } from "../api/06-evaluate-dcql-query";
|
|
5
|
-
import * as mdocUtils from "./utils.mdoc";
|
|
6
|
-
import type { Credential4Dcql, RemotePresentationApi } from "../api";
|
|
7
5
|
import * as sdJwtUtils from "../common/utils/sd-jwt";
|
|
8
|
-
import
|
|
6
|
+
import * as mdocUtils from "../common/utils/mdoc";
|
|
7
|
+
import type { Credential4Dcql, RemotePresentationApi } from "../api";
|
|
9
8
|
import {
|
|
10
9
|
extractFailedCredentialsDetails,
|
|
11
10
|
getDcqlQueryMatches,
|
|
11
|
+
getClaimsFromDcqlMatch,
|
|
12
12
|
getPresentationFrameFromDcqlMatch,
|
|
13
13
|
} from "../common/utils/dcql";
|
|
14
14
|
|
|
@@ -17,6 +17,7 @@ import { AuthorizationResponse } from "./types";
|
|
|
17
17
|
import { buildDirectPostBody } from "../common/utils/http";
|
|
18
18
|
import { prepareVpToken } from "../../../sd-jwt";
|
|
19
19
|
import { createCryptoContextFor } from "../../../utils/crypto";
|
|
20
|
+
import { sdkConfigV1_3 } from "../../../utils/config";
|
|
20
21
|
import { prepareVpTokenMdoc } from "../../../mdoc";
|
|
21
22
|
|
|
22
23
|
/**
|
|
@@ -126,6 +127,7 @@ export const sendAuthorizationResponse: RemotePresentationApi["sendAuthorization
|
|
|
126
127
|
);
|
|
127
128
|
|
|
128
129
|
const { jarm } = await sdkCreateAuthorizationResponse({
|
|
130
|
+
config: sdkConfigV1_3,
|
|
129
131
|
requestObject,
|
|
130
132
|
rpJwks,
|
|
131
133
|
vp_token,
|
|
@@ -21,7 +21,7 @@ export const mapToRelyingPartyConfig = createMapper<
|
|
|
21
21
|
|
|
22
22
|
export const mapToRequestObject = createMapper<RawRequestObject, RequestObject>(
|
|
23
23
|
({ payload, header }) => ({
|
|
24
|
-
iss: payload.iss,
|
|
24
|
+
iss: payload.iss ?? "",
|
|
25
25
|
client_id: payload.client_id,
|
|
26
26
|
dcql_query: payload.dcql_query,
|
|
27
27
|
nonce: payload.nonce,
|
|
@@ -111,15 +111,16 @@ const res = await wallet.CredentialStatus.statusList.get(
|
|
|
111
111
|
);
|
|
112
112
|
|
|
113
113
|
// Verify and parse the status list response to get the credential status
|
|
114
|
-
const { status } =
|
|
114
|
+
const { status, statusBit } =
|
|
115
115
|
await wallet.CredentialStatus.statusList.verifyAndParse(
|
|
116
|
-
issuerConf,
|
|
116
|
+
issuerConf.keys,
|
|
117
117
|
res
|
|
118
118
|
);
|
|
119
119
|
|
|
120
120
|
return {
|
|
121
121
|
statusList: res.statusList,
|
|
122
122
|
status,
|
|
123
|
+
statusBit,
|
|
123
124
|
};
|
|
124
125
|
```
|
|
125
126
|
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { Out } from "../../../utils/misc";
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
IssuerConfig,
|
|
5
|
-
} from "../../../credential/issuance/api";
|
|
2
|
+
import type { CredentialFormat } from "../../../credential/issuance/api";
|
|
3
|
+
import type { JWK } from "../../../utils/jwk";
|
|
6
4
|
|
|
7
5
|
export interface StatusListApi {
|
|
8
6
|
isSupported: true;
|
|
@@ -22,6 +20,7 @@ export interface StatusListApi {
|
|
|
22
20
|
* @since 1.3.3
|
|
23
21
|
* @param credential The credential to get the status list for
|
|
24
22
|
* @param format The credential format
|
|
23
|
+
* @param context.appFetch Optional fetch function to use for the network request
|
|
25
24
|
* @returns The raw status list, the index of the credential and other metadata
|
|
26
25
|
*/
|
|
27
26
|
get(
|
|
@@ -40,11 +39,15 @@ export interface StatusListApi {
|
|
|
40
39
|
/**
|
|
41
40
|
* Verifies the signature of a status list and extract the status at the specified index.
|
|
42
41
|
* @since 1.3.3
|
|
43
|
-
* @param
|
|
42
|
+
* @param keys The JSON Web Key Set to verify the status list signature
|
|
44
43
|
* @param statusListParams The raw status list, the index to read and other metadata
|
|
44
|
+
* @return The status of the credential and the raw status bit in hexadecimal format (e.g. "0x01")
|
|
45
45
|
*/
|
|
46
46
|
verifyAndParse(
|
|
47
|
-
|
|
47
|
+
keys: JWK[],
|
|
48
48
|
statusListParams: Out<StatusListApi["get"]>
|
|
49
|
-
): Promise<{
|
|
49
|
+
): Promise<{
|
|
50
|
+
statusBit: string;
|
|
51
|
+
status: string;
|
|
52
|
+
}>;
|
|
50
53
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CBOR } from "@pagopa/io-react-native-iso18013";
|
|
2
|
+
import { decode as decodeJwt } from "@pagopa/io-react-native-jwt";
|
|
2
3
|
import {
|
|
3
4
|
getStatusListFromJWT,
|
|
4
5
|
type StatusListEntry,
|
|
@@ -38,13 +39,26 @@ export const getStatusList: StatusListApi["get"] = async (
|
|
|
38
39
|
) => {
|
|
39
40
|
const { uri, idx } = await getStatusListEntry(credential, format);
|
|
40
41
|
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
const fetchStatusList = (options: { cacheDisabled?: boolean } = {}) =>
|
|
43
|
+
appFetch(uri, {
|
|
44
|
+
headers: {
|
|
45
|
+
Accept: "application/statuslist+jwt",
|
|
46
|
+
...(options.cacheDisabled && { "Cache-Control": "no-cache" }),
|
|
47
|
+
},
|
|
48
|
+
})
|
|
49
|
+
.then(hasStatusOrThrow(200))
|
|
50
|
+
.then((response) => response.text());
|
|
48
51
|
|
|
52
|
+
// When the HTTP response includes cache headers, fetch will return a cached response and the JWT might be expired
|
|
53
|
+
let statusList = await fetchStatusList();
|
|
54
|
+
const decoded = decodeJwt(statusList);
|
|
55
|
+
|
|
56
|
+
const { exp } = decoded.payload;
|
|
57
|
+
|
|
58
|
+
// If the status list JWT is expired, try to fetch it again bypassing the HTTP cache.
|
|
59
|
+
// If it is still expired after the refetch, `verifyAndParseStatusList` will throw.
|
|
60
|
+
if (exp && exp < Math.floor(Date.now() / 1000)) {
|
|
61
|
+
statusList = await fetchStatusList({ cacheDisabled: true });
|
|
62
|
+
}
|
|
49
63
|
return { statusList, uri, idx, format: "jwt" };
|
|
50
64
|
};
|
|
@@ -2,18 +2,32 @@ import { verify } from "@pagopa/io-react-native-jwt";
|
|
|
2
2
|
import { getListFromStatusListJWT } from "@sd-jwt/jwt-status-list";
|
|
3
3
|
import type { StatusListApi } from "../api/status-list";
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Mapping of status bits to their corresponding meaning as defined in the specification.
|
|
7
|
+
* @see https://italia.github.io/eid-wallet-it-docs/releases/1.3.3/en/credential-revocation.html#token-status-lists
|
|
8
|
+
*/
|
|
9
|
+
const CredentialStatusMap = {
|
|
10
|
+
0x00: "VALID",
|
|
11
|
+
0x01: "INVALID",
|
|
12
|
+
0x02: "SUSPENDED",
|
|
13
|
+
0x03: "UPDATE",
|
|
14
|
+
0x0b: "ATTRIBUTE_UPDATE",
|
|
15
|
+
} as const;
|
|
16
|
+
|
|
17
|
+
type CredentialStatusBit = keyof typeof CredentialStatusMap;
|
|
18
|
+
|
|
5
19
|
export const verifyAndParseStatusList: StatusListApi["verifyAndParse"] = async (
|
|
6
|
-
|
|
20
|
+
keys,
|
|
7
21
|
{ statusList: rawStatusList, idx }
|
|
8
22
|
) => {
|
|
9
|
-
await verify(rawStatusList,
|
|
23
|
+
await verify(rawStatusList, keys);
|
|
10
24
|
|
|
11
25
|
const statusList = getListFromStatusListJWT(rawStatusList);
|
|
26
|
+
const statusBit = statusList.getStatus(idx) as CredentialStatusBit;
|
|
27
|
+
const status = CredentialStatusMap[statusBit];
|
|
12
28
|
|
|
13
|
-
const status = statusList.getStatus(idx);
|
|
14
|
-
|
|
15
|
-
// TODO: [SIW-3992] Improve the return object with additional data, throw CredentialInvalidStatus when invalid
|
|
16
29
|
return {
|
|
17
30
|
status,
|
|
31
|
+
statusBit: `0x${statusBit.toString(16).padStart(2, "0").toUpperCase()}`,
|
|
18
32
|
};
|
|
19
33
|
};
|
|
@@ -20,13 +20,15 @@ const AdministrativeExpirationUserInfo = z.object({
|
|
|
20
20
|
description_l10n_id: z.string(),
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
-
const AllowedState = z
|
|
23
|
+
export const AllowedState = z
|
|
24
24
|
.object({
|
|
25
25
|
title_l10n_id: z.string(),
|
|
26
26
|
description_l10n_id: z.string(),
|
|
27
27
|
})
|
|
28
28
|
.catchall(z.string());
|
|
29
29
|
|
|
30
|
+
export type AllowedState = z.infer<typeof AllowedState>;
|
|
31
|
+
|
|
30
32
|
const CredentialPurpose = z.object({
|
|
31
33
|
id: z.string(),
|
|
32
34
|
description: z.string().optional(),
|
|
@@ -116,6 +118,7 @@ export const DigitalCredential = z.object({
|
|
|
116
118
|
formats: z.array(CredentialFormat).optional(),
|
|
117
119
|
// claims: z.array(Claim), // TODO: [SIW-3978] Should we keep claims?
|
|
118
120
|
});
|
|
121
|
+
export type DigitalCredential = z.infer<typeof DigitalCredential>;
|
|
119
122
|
|
|
120
123
|
const TaxonomyPurpose = z.object({
|
|
121
124
|
id: z.string(),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
type CatalogueTranslations,
|
|
3
|
+
type DigitalCredential,
|
|
3
4
|
type DigitalCredentialsCatalogue,
|
|
4
5
|
type LocalizationInfo,
|
|
5
6
|
type Taxonomy,
|
|
@@ -48,10 +49,24 @@ export interface CredentialsCatalogueApi {
|
|
|
48
49
|
locales: string[],
|
|
49
50
|
ctx?: FetchContext
|
|
50
51
|
): Promise<CatalogueTranslations>;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Given a statusBit (e.g. "0x00", "0x0B") and a DigitalCredential from the
|
|
55
|
+
* catalogue, returns the matching l10n IDs or undefined if not found.
|
|
56
|
+
* The comparison is case-insensitive to handle uppercase statusBit values
|
|
57
|
+
* returned by verifyAndParseStatusList against lowercase keys in the catalogue.
|
|
58
|
+
*
|
|
59
|
+
* @since 1.0.0
|
|
60
|
+
*/
|
|
61
|
+
getStatusL10nIds(
|
|
62
|
+
statusBit: string,
|
|
63
|
+
credentialConfig: DigitalCredential
|
|
64
|
+
): { titleL10nId: string; descriptionL10nId: string } | undefined;
|
|
51
65
|
}
|
|
52
66
|
|
|
53
67
|
export {
|
|
54
68
|
type CatalogueTranslations,
|
|
69
|
+
type DigitalCredential,
|
|
55
70
|
type DigitalCredentialsCatalogue,
|
|
56
71
|
type LocalizationInfo,
|
|
57
72
|
type Taxonomy,
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { AllowedState } from "../api/DigitalCredentialsCatalogue";
|
|
2
|
+
import { type CredentialsCatalogueApi } from "../api";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Given a statusBit (e.g. "0x00", "0x0B") and a DigitalCredential from the
|
|
6
|
+
* catalogue, returns the matching l10n IDs or undefined if not found.
|
|
7
|
+
* The comparison is case-insensitive to handle uppercase statusBit values
|
|
8
|
+
* returned by verifyAndParseStatusList against lowercase keys in the catalogue.
|
|
9
|
+
*/
|
|
10
|
+
export const getStatusL10nIds: CredentialsCatalogueApi["getStatusL10nIds"] = (
|
|
11
|
+
statusBit,
|
|
12
|
+
credentialConfig
|
|
13
|
+
) => {
|
|
14
|
+
const normalizedBit = statusBit.toLowerCase();
|
|
15
|
+
const match = credentialConfig.validity_info.allowed_states.find(
|
|
16
|
+
(s): s is AllowedState =>
|
|
17
|
+
typeof s === "object" &&
|
|
18
|
+
Object.keys(s).some((k) => k.toLowerCase() === normalizedBit)
|
|
19
|
+
);
|
|
20
|
+
if (!match) return undefined;
|
|
21
|
+
return {
|
|
22
|
+
titleL10nId: match.title_l10n_id,
|
|
23
|
+
descriptionL10nId: match.description_l10n_id,
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { CredentialsCatalogueApi } from "../api";
|
|
2
2
|
import { fetchAndParseCatalogue } from "./fetch-and-parse-catalogue";
|
|
3
|
+
import { getStatusL10nIds } from "../common/get-status-l10n-ids";
|
|
3
4
|
|
|
4
5
|
export const CredentialsCatalogue: CredentialsCatalogueApi = {
|
|
5
6
|
fetchAndParseCatalogue,
|
|
7
|
+
getStatusL10nIds,
|
|
6
8
|
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { CredentialsCatalogueApi } from "../api";
|
|
2
2
|
import { fetchAndParseCatalogue } from "./fetch-and-parse-catalogue";
|
|
3
3
|
import { fetchTranslations } from "./fetch-translations";
|
|
4
|
+
import { getStatusL10nIds } from "../common/get-status-l10n-ids";
|
|
4
5
|
|
|
5
6
|
export const CredentialsCatalogue: CredentialsCatalogueApi = {
|
|
6
7
|
fetchAndParseCatalogue,
|
|
7
8
|
fetchTranslations,
|
|
9
|
+
getStatusL10nIds,
|
|
8
10
|
};
|
package/src/mdoc/index.ts
CHANGED
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
import { CBOR, COSE, ISO18013_7 } from "@pagopa/io-react-native-iso18013";
|
|
2
2
|
import { b64utob64 } from "jsrsasign";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
type CertificateValidationResult,
|
|
6
|
-
type PublicKey,
|
|
7
|
-
type X509CertificateOptions,
|
|
8
|
-
} from "@pagopa/io-react-native-crypto";
|
|
9
|
-
import {
|
|
10
|
-
MissingX509CertsError,
|
|
11
|
-
X509ValidationError,
|
|
12
|
-
} from "../trust/common/errors";
|
|
3
|
+
import { type PublicKey } from "@pagopa/io-react-native-crypto";
|
|
4
|
+
import { MissingX509CertsError } from "../trust/common/errors";
|
|
13
5
|
import { IoWalletError } from "../utils/errors";
|
|
14
6
|
import { convertBase64DerToPem, getSigninJwkFromCert } from "../utils/crypto";
|
|
15
|
-
import type { Presentation } from "
|
|
7
|
+
import type { Presentation } from "../credential/presentation";
|
|
16
8
|
import { removePadding } from "@pagopa/io-react-native-jwt";
|
|
9
|
+
import { verifyX509Chain } from "../utils/x509";
|
|
17
10
|
export * from "./utils";
|
|
18
11
|
|
|
19
12
|
export const verify = async (
|
|
@@ -37,7 +30,7 @@ export const verify = async (
|
|
|
37
30
|
const x5chain =
|
|
38
31
|
issuerSigned.issuerAuth.unprotectedHeader.x5chain.map(b64utob64);
|
|
39
32
|
// Verify the x5chain
|
|
40
|
-
await
|
|
33
|
+
await verifyX509Chain(x5chain, x509CertRoot);
|
|
41
34
|
|
|
42
35
|
const coseSign1 = issuerSigned.issuerAuth.rawValue;
|
|
43
36
|
|
|
@@ -50,35 +43,6 @@ export const verify = async (
|
|
|
50
43
|
return { issuerSigned };
|
|
51
44
|
};
|
|
52
45
|
|
|
53
|
-
/**
|
|
54
|
-
* This function checks whether the x509 certificate chain is valid against a specified Certificate Authority (CA)
|
|
55
|
-
*
|
|
56
|
-
* @param x5chain The mdoc's x509 certificate chain
|
|
57
|
-
* @param x509CertRoot The Trust Anchor CA
|
|
58
|
-
* @param options Options for certificate validation
|
|
59
|
-
*/
|
|
60
|
-
const verifyX5chain = async (
|
|
61
|
-
x5chain: string[],
|
|
62
|
-
x509CertRoot: string,
|
|
63
|
-
options: X509CertificateOptions = {
|
|
64
|
-
connectTimeout: 10000,
|
|
65
|
-
readTimeout: 10000,
|
|
66
|
-
requireCrl: true,
|
|
67
|
-
}
|
|
68
|
-
) => {
|
|
69
|
-
const x509ValidationResult: CertificateValidationResult =
|
|
70
|
-
await verifyCertificateChain(x5chain, x509CertRoot, options);
|
|
71
|
-
|
|
72
|
-
if (!x509ValidationResult.isValid) {
|
|
73
|
-
throw new X509ValidationError(
|
|
74
|
-
`X.509 certificate chain validation failed. Status: ${x509ValidationResult.validationStatus}. Error: ${x509ValidationResult.errorMessage}`,
|
|
75
|
-
{
|
|
76
|
-
x509ValidationStatus: x509ValidationResult.validationStatus,
|
|
77
|
-
x509ErrorMessage: x509ValidationResult.errorMessage,
|
|
78
|
-
}
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
46
|
/**
|
|
83
47
|
* This function verifies that the signature is valid for the given certificate.
|
|
84
48
|
* If not, it throws an error
|
|
@@ -28,20 +28,8 @@ describe("Verification.time", () => {
|
|
|
28
28
|
|
|
29
29
|
it("rejects invalid type", () => {
|
|
30
30
|
const value = {
|
|
31
|
-
trust_framework: "eidas",
|
|
31
|
+
trust_framework: ["eidas"],
|
|
32
32
|
assurance_level: "high",
|
|
33
|
-
evidence: [
|
|
34
|
-
{
|
|
35
|
-
type: "vouch",
|
|
36
|
-
time: null,
|
|
37
|
-
attestation: {
|
|
38
|
-
type: "digital_attestation",
|
|
39
|
-
reference_number: "abc",
|
|
40
|
-
date_of_issuance: "2025-09-02",
|
|
41
|
-
voucher: { organization: "IPZS" },
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
],
|
|
45
33
|
};
|
|
46
34
|
|
|
47
35
|
expect(Verification.safeParse(value).success).toBe(false);
|
|
@@ -4,18 +4,6 @@ import { getVerification } from "..";
|
|
|
4
4
|
describe("SD-JWT getVerification", () => {
|
|
5
5
|
it("extracts the verification claims correctly", () => {
|
|
6
6
|
expect(getVerification(pid)).toEqual({
|
|
7
|
-
evidence: [
|
|
8
|
-
{
|
|
9
|
-
attestation: {
|
|
10
|
-
date_of_issuance: "2025-06-23",
|
|
11
|
-
voucher: { organization: "Ministero dell'Interno" },
|
|
12
|
-
type: "digital_attestation",
|
|
13
|
-
reference_number: "123456789",
|
|
14
|
-
},
|
|
15
|
-
time: "2025-06-23T13:14:25Z",
|
|
16
|
-
type: "vouch",
|
|
17
|
-
},
|
|
18
|
-
],
|
|
19
7
|
trust_framework: "it_cie",
|
|
20
8
|
assurance_level: "high",
|
|
21
9
|
});
|
package/src/sd-jwt/types.ts
CHANGED
|
@@ -64,19 +64,6 @@ export type Verification = z.infer<typeof Verification>;
|
|
|
64
64
|
export const Verification = z.object({
|
|
65
65
|
trust_framework: z.string(),
|
|
66
66
|
assurance_level: z.string(),
|
|
67
|
-
evidence: z.array(
|
|
68
|
-
z.object({
|
|
69
|
-
type: z.literal("vouch"),
|
|
70
|
-
// Support both string and UNIX timestamp for backward compatibility
|
|
71
|
-
time: z.union([z.string(), z.number()]),
|
|
72
|
-
attestation: z.object({
|
|
73
|
-
type: z.literal("digital_attestation"),
|
|
74
|
-
reference_number: z.string(),
|
|
75
|
-
date_of_issuance: z.string(),
|
|
76
|
-
voucher: z.object({ organization: z.string() }),
|
|
77
|
-
}),
|
|
78
|
-
})
|
|
79
|
-
),
|
|
80
67
|
});
|
|
81
68
|
|
|
82
69
|
/**
|
package/src/utils/callbacks.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
EncryptJwe,
|
|
3
|
+
getJwkFromHeader,
|
|
4
|
+
SignJWT,
|
|
5
|
+
type CryptoContext,
|
|
6
|
+
} from "@pagopa/io-react-native-jwt";
|
|
2
7
|
import { verify } from "@pagopa/io-react-native-jwt";
|
|
3
8
|
import { type CallbackContext, type JwtSigner } from "@pagopa/io-wallet-oauth2";
|
|
4
9
|
import { digest } from "@sd-jwt/crypto-nodejs";
|
|
@@ -109,3 +114,25 @@ export const createVerifyJwtFromJwks = (
|
|
|
109
114
|
}
|
|
110
115
|
};
|
|
111
116
|
};
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Create a signJwt implementation that signs a JWT using the provided CryptoContext.
|
|
120
|
+
* @param cryptoContext The CryptoContext to use for signing the JWT
|
|
121
|
+
* @returns Function that implements `signJwt` callback
|
|
122
|
+
*/
|
|
123
|
+
export const createSignJwtFromCryptoContext = (
|
|
124
|
+
cryptoContext: CryptoContext
|
|
125
|
+
): CallbackContext["signJwt"] => {
|
|
126
|
+
return async function signJwt(jwtSigner, { header, payload }) {
|
|
127
|
+
return {
|
|
128
|
+
jwt: await new SignJWT(cryptoContext)
|
|
129
|
+
.setProtectedHeader(header)
|
|
130
|
+
.setPayload(payload)
|
|
131
|
+
.sign(),
|
|
132
|
+
signerJwk:
|
|
133
|
+
jwtSigner.method === "jwk"
|
|
134
|
+
? jwtSigner.publicJwk
|
|
135
|
+
: await cryptoContext.getPublicKey(),
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
};
|
package/src/utils/config.ts
CHANGED
|
@@ -16,3 +16,10 @@ export const sdkConfigV1_0 = new IoWalletSdkConfig({
|
|
|
16
16
|
export const sdkConfigV1_3 = new IoWalletSdkConfig({
|
|
17
17
|
itWalletSpecsVersion: ItWalletSpecsVersion.V1_3,
|
|
18
18
|
});
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* IO Wallet SDK configuration object for v1.4 specs.
|
|
22
|
+
*/
|
|
23
|
+
export const sdkConfigV1_4 = new IoWalletSdkConfig({
|
|
24
|
+
itWalletSpecsVersion: ItWalletSpecsVersion.V1_4,
|
|
25
|
+
});
|