@pagopa/io-react-native-wallet 2.0.0-next.4 → 2.0.0-next.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.
Files changed (76) hide show
  1. package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js +3 -3
  2. package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js.map +1 -1
  3. package/lib/commonjs/credential/status/{02-status-attestation.js → 02-status-assertion.js} +28 -22
  4. package/lib/commonjs/credential/status/02-status-assertion.js.map +1 -0
  5. package/lib/commonjs/credential/status/03-verify-and-parse-status-assertion.js +85 -0
  6. package/lib/commonjs/credential/status/03-verify-and-parse-status-assertion.js.map +1 -0
  7. package/lib/commonjs/credential/status/README.md +22 -20
  8. package/lib/commonjs/credential/status/index.js +6 -6
  9. package/lib/commonjs/credential/status/index.js.map +1 -1
  10. package/lib/commonjs/credential/status/types.js +48 -15
  11. package/lib/commonjs/credential/status/types.js.map +1 -1
  12. package/lib/commonjs/trust/types.js +2 -1
  13. package/lib/commonjs/trust/types.js.map +1 -1
  14. package/lib/commonjs/utils/credentials.js +33 -0
  15. package/lib/commonjs/utils/credentials.js.map +1 -0
  16. package/lib/commonjs/utils/crypto.js +1 -7
  17. package/lib/commonjs/utils/crypto.js.map +1 -1
  18. package/lib/commonjs/utils/jwk.js +12 -0
  19. package/lib/commonjs/utils/jwk.js.map +1 -1
  20. package/lib/module/credential/issuance/07-verify-and-parse-credential.js +4 -4
  21. package/lib/module/credential/issuance/07-verify-and-parse-credential.js.map +1 -1
  22. package/lib/module/credential/status/{02-status-attestation.js → 02-status-assertion.js} +28 -22
  23. package/lib/module/credential/status/02-status-assertion.js.map +1 -0
  24. package/lib/module/credential/status/03-verify-and-parse-status-assertion.js +78 -0
  25. package/lib/module/credential/status/03-verify-and-parse-status-assertion.js.map +1 -0
  26. package/lib/module/credential/status/README.md +22 -20
  27. package/lib/module/credential/status/index.js +3 -3
  28. package/lib/module/credential/status/index.js.map +1 -1
  29. package/lib/module/credential/status/types.js +43 -12
  30. package/lib/module/credential/status/types.js.map +1 -1
  31. package/lib/module/trust/types.js +2 -1
  32. package/lib/module/trust/types.js.map +1 -1
  33. package/lib/module/utils/credentials.js +26 -0
  34. package/lib/module/utils/credentials.js.map +1 -0
  35. package/lib/module/utils/crypto.js +2 -8
  36. package/lib/module/utils/crypto.js.map +1 -1
  37. package/lib/module/utils/jwk.js +11 -1
  38. package/lib/module/utils/jwk.js.map +1 -1
  39. package/lib/typescript/credential/issuance/07-verify-and-parse-credential.d.ts.map +1 -1
  40. package/lib/typescript/credential/status/02-status-assertion.d.ts +23 -0
  41. package/lib/typescript/credential/status/02-status-assertion.d.ts.map +1 -0
  42. package/lib/typescript/credential/status/03-verify-and-parse-status-assertion.d.ts +21 -0
  43. package/lib/typescript/credential/status/03-verify-and-parse-status-assertion.d.ts.map +1 -0
  44. package/lib/typescript/credential/status/index.d.ts +4 -4
  45. package/lib/typescript/credential/status/index.d.ts.map +1 -1
  46. package/lib/typescript/credential/status/types.d.ts +495 -18
  47. package/lib/typescript/credential/status/types.d.ts.map +1 -1
  48. package/lib/typescript/trust/build-chain.d.ts +2 -2
  49. package/lib/typescript/trust/types.d.ts +26 -26
  50. package/lib/typescript/utils/credentials.d.ts +11 -0
  51. package/lib/typescript/utils/credentials.d.ts.map +1 -0
  52. package/lib/typescript/utils/crypto.d.ts.map +1 -1
  53. package/lib/typescript/utils/jwk.d.ts +7 -0
  54. package/lib/typescript/utils/jwk.d.ts.map +1 -1
  55. package/package.json +6 -8
  56. package/src/credential/issuance/07-verify-and-parse-credential.ts +4 -6
  57. package/src/credential/status/{02-status-attestation.ts → 02-status-assertion.ts} +37 -28
  58. package/src/credential/status/03-verify-and-parse-status-assertion.ts +109 -0
  59. package/src/credential/status/README.md +22 -20
  60. package/src/credential/status/index.ts +7 -14
  61. package/src/credential/status/types.ts +62 -15
  62. package/src/trust/types.ts +1 -1
  63. package/src/utils/credentials.ts +29 -0
  64. package/src/utils/crypto.ts +12 -20
  65. package/src/utils/jwk.ts +15 -1
  66. package/lib/commonjs/credential/status/02-status-attestation.js.map +0 -1
  67. package/lib/commonjs/credential/status/03-verify-and-parse-status-attestation.js +0 -55
  68. package/lib/commonjs/credential/status/03-verify-and-parse-status-attestation.js.map +0 -1
  69. package/lib/module/credential/status/02-status-attestation.js.map +0 -1
  70. package/lib/module/credential/status/03-verify-and-parse-status-attestation.js +0 -49
  71. package/lib/module/credential/status/03-verify-and-parse-status-attestation.js.map +0 -1
  72. package/lib/typescript/credential/status/02-status-attestation.d.ts +0 -19
  73. package/lib/typescript/credential/status/02-status-attestation.d.ts.map +0 -1
  74. package/lib/typescript/credential/status/03-verify-and-parse-status-attestation.d.ts +0 -24
  75. package/lib/typescript/credential/status/03-verify-and-parse-status-attestation.d.ts.map +0 -1
  76. package/src/credential/status/03-verify-and-parse-status-attestation.ts +0 -70
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.verifyAndParseCredential = void 0;
7
7
  var _errors = require("../../utils/errors");
8
- var _types = require("../../sd-jwt/types");
9
8
  var _sdJwt = require("../../sd-jwt");
10
9
  var _converters = require("../../sd-jwt/converters");
10
+ var _jwk = require("../../utils/jwk");
11
11
  var _logging = require("../../utils/logging");
12
12
  // The credential as a collection of attributes in plain value
13
13
 
@@ -121,11 +121,11 @@ const parseCredentialSdJwt = function (credentialConfig, _ref) {
121
121
  async function verifyCredentialSdJwt(rawCredential, issuerKeys, holderBindingContext) {
122
122
  const [decodedCredential, holderBindingKey] =
123
123
  // parallel for optimization
124
- await Promise.all([(0, _sdJwt.verify)(rawCredential, issuerKeys, _types.SdJwt4VC), holderBindingContext.getPublicKey()]);
124
+ await Promise.all([(0, _sdJwt.verify)(rawCredential, issuerKeys, _sdJwt.SdJwt4VC), holderBindingContext.getPublicKey()]);
125
125
  const {
126
126
  cnf
127
127
  } = decodedCredential.sdJwt.payload;
128
- if (!cnf.jwk.kid || cnf.jwk.kid !== holderBindingKey.kid) {
128
+ if (!(await (0, _jwk.isSameThumbprint)(cnf.jwk, holderBindingKey))) {
129
129
  const message = `Failed to verify holder binding, expected kid: ${holderBindingKey.kid}, got: ${decodedCredential.sdJwt.payload.cnf.jwk.kid}`;
130
130
  _logging.Logger.log(_logging.LogLevel.ERROR, message);
131
131
  throw new _errors.IoWalletError(message);
@@ -1 +1 @@
1
- {"version":3,"names":["_errors","require","_types","_sdJwt","_converters","_logging","parseCredentialSdJwt","credentialConfig","_ref","sdJwt","disclosures","ignoreMissingAttributes","arguments","length","undefined","includeUndefinedAttributes","format","header","typ","message","Logger","log","LogLevel","ERROR","IoWalletError","claims","attrDefinitions","attrsNotInDisclosures","filter","definition","some","_ref2","name","path","missing","map","_","join","received","definedValues","Object","fromEntries","_ref3","_disclosures$find","value","find","_ref4","attrKey","display","reduce","names","_ref5","locale","undefinedValues","keys","includes","_ref6","key","verifyCredentialSdJwt","rawCredential","issuerKeys","holderBindingContext","decodedCredential","holderBindingKey","Promise","all","verifySdJwt","SdJwt4VC","getPublicKey","cnf","payload","jwk","kid","verifyAndParseCredentialSdJwt","issuerConf","credential","credentialConfigurationId","_ref7","credentialCryptoContext","decoded","openid_credential_issuer","jwks","DEBUG","JSON","stringify","credential_configurations_supported","parsedCredential","maybeIssuedAt","getValueFromDisclosures","expiration","Date","exp","issuedAt","verifyAndParseCredential","context","_issuerConf$openid_cr","exports"],"sourceRoot":"../../../../src","sources":["credential/issuance/07-verify-and-parse-credential.ts"],"mappings":";;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAGA,IAAAI,QAAA,GAAAJ,OAAA;AA2BA;;AAkBA;;AAKA,MAAMK,oBAAoB,GAAG,SAAAA,CAE3BC,gBAAgC,EAAAC,IAAA,EAIX;EAAA,IAHrB;IAAEC,KAAK;IAAEC;EAAoC,CAAC,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O,CAACqB,GAAG,GAAG,IAAI,CAAC;IACtDC,QAAQ,EACN,OAAOL,aAAa,KAAK,QAAQ,GAC7B,IAAIG,IAAI,CAACH,aAAa,GAAG,IAAI,CAAC,GAC9BzE;EACR,CAAC;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM+E,wBAAkD,GAAG,MAAAA,CAChEnB,UAAU,EACVC,UAAU,EACVC,yBAAyB,EACzBkB,OAAO,KACJ;EAAA,IAAAC,qBAAA;EACH,MAAM/E,MAAM,IAAA+E,qBAAA,GACVrB,UAAU,CAACM,wBAAwB,CAACK,mCAAmC,CACrET,yBAAyB,CAC1B,cAAAmB,qBAAA,uBAFDA,qBAAA,CAEG/E,MAAM;EAEX,IAAIA,MAAM,KAAK,WAAW,EAAE;IAC1BI,eAAM,CAACC,GAAG,CAACC,iBAAQ,CAAC4D,KAAK,EAAE,wCAAwC,CAAC;IACpE,OAAOT,6BAA6B,CAClCC,UAAU,EACVC,UAAU,EACVC,yBAAyB,EACzBkB,OACF,CAAC;EACH;EAEA,MAAM3E,OAAO,GAAI,kCAAiCH,MAAO,EAAC;EAC1DI,eAAM,CAACC,GAAG,CAACC,iBAAQ,CAACC,KAAK,EAAEJ,OAAO,CAAC;EACnC,MAAM,IAAIK,qBAAa,CAACL,OAAO,CAAC;AAClC,CAAC;AAAC6E,OAAA,CAAAH,wBAAA,GAAAA,wBAAA"}
1
+ {"version":3,"names":["_errors","require","_sdJwt","_converters","_jwk","_logging","parseCredentialSdJwt","credentialConfig","_ref","sdJwt","disclosures","ignoreMissingAttributes","arguments","length","undefined","includeUndefinedAttributes","format","header","typ","message","Logger","log","LogLevel","ERROR","IoWalletError","claims","attrDefinitions","attrsNotInDisclosures","filter","definition","some","_ref2","name","path","missing","map","_","join","received","definedValues","Object","fromEntries","_ref3","_disclosures$find","value","find","_ref4","attrKey","display","reduce","names","_ref5","locale","undefinedValues","keys","includes","_ref6","key","verifyCredentialSdJwt","rawCredential","issuerKeys","holderBindingContext","decodedCredential","holderBindingKey","Promise","all","verifySdJwt","SdJwt4VC","getPublicKey","cnf","payload","isSameThumbprint","jwk","kid","verifyAndParseCredentialSdJwt","issuerConf","credential","credentialConfigurationId","_ref7","credentialCryptoContext","decoded","openid_credential_issuer","jwks","DEBUG","JSON","stringify","credential_configurations_supported","parsedCredential","maybeIssuedAt","getValueFromDisclosures","expiration","Date","exp","issuedAt","verifyAndParseCredential","context","_issuerConf$openid_cr","exports"],"sourceRoot":"../../../../src","sources":["credential/issuance/07-verify-and-parse-credential.ts"],"mappings":";;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,IAAA,GAAAH,OAAA;AAEA,IAAAI,QAAA,GAAAJ,OAAA;AA2BA;;AAkBA;;AAKA,MAAMK,oBAAoB,GAAG,SAAAA,CAE3BC,gBAAgC,EAAAC,IAAA,EAIX;EAAA,IAHrB;IAAEC,KAAK;IAAEC;EAAoC,CAAC,GAAAF,IAAA;EAAA,IAC9CG,uBAAgC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,KAAK;EAAA,IACxCG,0BAAmC,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,KAAK;EAE3C,IAAIL,gBAAgB,CAACS,MAAM,KAAKP,KAAK,CAACQ,MAAM,CAACC,GAAG,EAAE;IAChD,MAAMC,OAAO,GAAI,gEAA+DZ,gBAAgB,CAACS,MAAO,gBAAeP,KAAK,CAACQ,MAAM,CAACC,GAAI,GAAE;IAC1IE,eAAM,CAACC,GAAG,CAACC,iBAAQ,CAACC,KAAK,EAAEJ,OAAO,CAAC;IACnC,MAAM,IAAIK,qBAAa,CAACL,OAAO,CAAC;EAClC;EAEA,IAAI,CAACZ,gBAAgB,C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,KAAK,EAAE,wCAAwC,CAAC;IACpE,OAAOT,6BAA6B,CAClCC,UAAU,EACVC,UAAU,EACVC,yBAAyB,EACzBkB,OACF,CAAC;EACH;EAEA,MAAM5E,OAAO,GAAI,kCAAiCH,MAAO,EAAC;EAC1DI,eAAM,CAACC,GAAG,CAACC,iBAAQ,CAACC,KAAK,EAAEJ,OAAO,CAAC;EACnC,MAAM,IAAIK,qBAAa,CAACL,OAAO,CAAC;AAClC,CAAC;AAAC8E,OAAA,CAAAH,wBAAA,GAAAA,wBAAA"}
@@ -3,40 +3,48 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.statusAttestation = void 0;
6
+ exports.statusAssertion = void 0;
7
7
  var _misc = require("../../utils/misc");
8
8
  var _ioReactNativeJwt = require("@pagopa/io-react-native-jwt");
9
9
  var _uuid = require("uuid");
10
10
  var _types = require("./types");
11
11
  var _errors = require("../../utils/errors");
12
12
  var _logging = require("../../utils/logging");
13
+ var _credentials = require("../../utils/credentials");
13
14
  /**
14
- * WARNING: This function must be called after {@link startFlow}.
15
- * Verify the status of the credential attestation.
15
+ * Get the status assertion of a digital credential.
16
16
  * @param issuerConf - The issuer's configuration
17
17
  * @param credential - The credential to be verified
18
- * @param credentialCryptoContext - The credential's crypto context
18
+ * @param format - The format of the credential, e.g. "sd-jwt"
19
+ * @param context.credentialCryptoContext - The credential's crypto context
20
+ * @param context.wiaCryptoContext - The Wallet Attestation's crypto context
19
21
  * @param context.appFetch (optional) fetch api implementation. Default: built-in fetch
20
22
  * @throws {IssuerResponseError} with a specific code for more context
21
- * @returns The credential status attestation
23
+ * @returns The credential status assertion
22
24
  */
23
- const statusAttestation = async function (issuerConf, credential, credentialCryptoContext) {
24
- let appFetch = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : fetch;
25
- const jwk = await credentialCryptoContext.getPublicKey();
25
+ const statusAssertion = async (issuerConf, credential, format, ctx) => {
26
+ const {
27
+ credentialCryptoContext,
28
+ wiaCryptoContext,
29
+ appFetch = fetch
30
+ } = ctx;
31
+ const jwk = await (0, _credentials.extractJwkFromCredential)(credential, format);
32
+ const issuerJwk = await wiaCryptoContext.getPublicKey();
26
33
  const credentialHash = await (0, _misc.getCredentialHashWithouDiscloures)(credential);
27
34
  const statusAttUrl = issuerConf.openid_credential_issuer.status_attestation_endpoint;
28
35
  const credentialPop = await new _ioReactNativeJwt.SignJWT(credentialCryptoContext).setPayload({
36
+ iss: issuerJwk.kid,
29
37
  aud: statusAttUrl,
30
38
  jti: (0, _uuid.v4)().toString(),
31
39
  credential_hash: credentialHash,
32
- credential_hash_alg: "S256"
40
+ credential_hash_alg: "sha-256"
33
41
  }).setProtectedHeader({
34
42
  alg: "ES256",
35
- typ: "status-attestation-request+jwt",
43
+ typ: "status-assertion-request+jwt",
36
44
  kid: jwk.kid
37
45
  }).setIssuedAt().setExpirationTime("5m").sign();
38
46
  const body = {
39
- credential_pop: credentialPop
47
+ status_assertion_requests: [credentialPop]
40
48
  };
41
49
  _logging.Logger.log(_logging.LogLevel.DEBUG, `Credential pop: ${credentialPop}`);
42
50
  const result = await appFetch(statusAttUrl, {
@@ -45,29 +53,27 @@ const statusAttestation = async function (issuerConf, credential, credentialCryp
45
53
  "Content-Type": "application/json"
46
54
  },
47
55
  body: JSON.stringify(body)
48
- }).then((0, _misc.hasStatusOrThrow)(201)).then(raw => raw.json()).then(json => _types.StatusAttestationResponse.parse(json)).catch(handleStatusAttestationError);
56
+ }).then((0, _misc.hasStatusOrThrow)(200)).then(raw => raw.json()).then(json => _types.StatusAssertionResponse.parse(json)).catch(handleStatusAssertionError);
57
+ const [statusAttestationJwt] = result.status_assertion_responses;
49
58
  return {
50
- statusAttestation: result.status_attestation
59
+ statusAssertion: statusAttestationJwt
51
60
  };
52
61
  };
53
62
 
54
63
  /**
55
- * Handle the status attestation error by mapping it to a custom exception.
64
+ * Handle the status assertion error by mapping it to a custom exception.
56
65
  * If the error is not an instance of {@link UnexpectedStatusCodeError}, it is thrown as is.
57
66
  * @param e - The error to be handled
58
67
  * @throws {IssuerResponseError} with a specific code for more context
59
68
  */
60
- exports.statusAttestation = statusAttestation;
61
- const handleStatusAttestationError = e => {
69
+ exports.statusAssertion = statusAssertion;
70
+ const handleStatusAssertionError = e => {
62
71
  if (!(e instanceof _errors.UnexpectedStatusCodeError)) {
63
72
  throw e;
64
73
  }
65
- throw new _errors.ResponseErrorBuilder(_errors.IssuerResponseError).handle(404, {
66
- code: _errors.IssuerResponseErrorCodes.CredentialInvalidStatus,
67
- message: "Invalid status found for the given credential"
68
- }).handle("*", {
74
+ throw new _errors.ResponseErrorBuilder(_errors.IssuerResponseError).handle("*", {
69
75
  code: _errors.IssuerResponseErrorCodes.StatusAttestationRequestFailed,
70
- message: `Unable to obtain the status attestation for the given credential`
76
+ message: `Unable to obtain the status assertion for the given credential`
71
77
  }).buildFrom(e);
72
78
  };
73
- //# sourceMappingURL=02-status-attestation.js.map
79
+ //# sourceMappingURL=02-status-assertion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_misc","require","_ioReactNativeJwt","_uuid","_types","_errors","_logging","_credentials","statusAssertion","issuerConf","credential","format","ctx","credentialCryptoContext","wiaCryptoContext","appFetch","fetch","jwk","extractJwkFromCredential","issuerJwk","getPublicKey","credentialHash","getCredentialHashWithouDiscloures","statusAttUrl","openid_credential_issuer","status_attestation_endpoint","credentialPop","SignJWT","setPayload","iss","kid","aud","jti","uuidv4","toString","credential_hash","credential_hash_alg","setProtectedHeader","alg","typ","setIssuedAt","setExpirationTime","sign","body","status_assertion_requests","Logger","log","LogLevel","DEBUG","result","method","headers","JSON","stringify","then","hasStatusOrThrow","raw","json","StatusAssertionResponse","parse","catch","handleStatusAssertionError","statusAttestationJwt","status_assertion_responses","exports","e","UnexpectedStatusCodeError","ResponseErrorBuilder","IssuerResponseError","handle","code","IssuerResponseErrorCodes","StatusAttestationRequestFailed","message","buildFrom"],"sourceRoot":"../../../../src","sources":["credential/status/02-status-assertion.ts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AAC;EAET,MAAMC,IAAI,GAAG;IACXC,yBAAyB,EAAE,CAAClB,aAAa;EAC3C,CAAC;EAEDmB,eAAM,CAACC,GAAG,CAACC,iBAAQ,CAACC,KAAK,EAAG,mBAAkBtB,aAAc,EAAC,CAAC;EAE9D,MAAMuB,MAAM,GAAG,MAAMlC,QAAQ,CAACQ,YAAY,EAAE;IAC1C2B,MAAM,EAAE,MAAM;IACdC,OAAO,EAAE;MACP,cAAc,EAAE;IAClB,CAAC;IACDR,IAAI,EAAES,IAAI,CAACC,SAAS,CAACV,IAAI;EAC3B,CAAC,CAAC,CACCW,IAAI,CAAC,IAAAC,sBAAgB,EAAC,GAAG,CAAC,CAAC,CAC3BD,IAAI,CAAEE,GAAG,IAAKA,GAAG,CAACC,IAAI,CAAC,CAAC,CAAC,CACzBH,IAAI,CAAEG,IAAI,IAAKC,8BAAuB,CAACC,KAAK,CAACF,IAAI,CAAC,CAAC,CACnDG,KAAK,CAACC,0BAA0B,CAAC;EAEpC,MAAM,CAACC,oBAAoB,CAAC,GAAGb,MAAM,CAACc,0BAA0B;EAEhE,OAAO;IAAEvD,eAAe,EAAEsD;EAAsB,CAAC;AACnD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AALAE,OAAA,CAAAxD,eAAA,GAAAA,eAAA;AAMA,MAAMqD,0BAA0B,GAAII,CAAU,IAAK;EACjD,IAAI,EAAEA,CAAC,YAAYC,iCAAyB,CAAC,EAAE;IAC7C,MAAMD,CAAC;EACT;EAEA,MAAM,IAAIE,4BAAoB,CAACC,2BAAmB,CAAC,CAChDC,MAAM,CAAC,GAAG,EAAE;IACXC,IAAI,EAAEC,gCAAwB,CAACC,8BAA8B;IAC7DC,OAAO,EAAG;EACZ,CAAC,CAAC,CACDC,SAAS,CAACT,CAAC,CAAC;AACjB,CAAC"}
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.verifyAndParseStatusAssertion = void 0;
7
+ var _errors = require("../../utils/errors");
8
+ var _ioReactNativeJwt = require("@pagopa/io-react-native-jwt");
9
+ var _types = require("./types");
10
+ var _logging = require("../../utils/logging");
11
+ var _credentials = require("../../utils/credentials");
12
+ var _jwk = require("../../utils/jwk");
13
+ /**
14
+ * Given a status assertion, verifies that:
15
+ * - It's in the supported format;
16
+ * - The assertion is correctly signed;
17
+ * - It's bound to the given key.
18
+ * @param issuerConf The Issuer configuration returned by {@link evaluateIssuerTrust}
19
+ * @param statusAssertion The encoded status assertion returned by {@link statusAssertion}
20
+ * @param context.credentialCryptoContext The crypto context used to obtain the credential in {@link obtainCredential}
21
+ * @returns A parsed status assertion
22
+ * @throws {IoWalletError} If the credential signature is not verified with the Issuer key set
23
+ * @throws {IssuerResponseError} If the status assertion contains an error or the credential status is invalid
24
+ */
25
+ const verifyAndParseStatusAssertion = async (issuerConf, rawStatusAssertion, credential, format) => {
26
+ const {
27
+ statusAssertion
28
+ } = rawStatusAssertion;
29
+ await (0, _ioReactNativeJwt.verify)(statusAssertion, issuerConf.openid_credential_issuer.jwks.keys);
30
+ const decodedJwt = (0, _ioReactNativeJwt.decode)(statusAssertion);
31
+ const parsedStatusAssertion = _types.ParsedStatusAssertionResponse.parse({
32
+ header: decodedJwt.protectedHeader,
33
+ payload: decodedJwt.payload
34
+ });
35
+ _logging.Logger.log(_logging.LogLevel.DEBUG, `Parsed status assertion: ${JSON.stringify(parsedStatusAssertion)}`);
36
+
37
+ // Errors are transmitted in the JWT and use a 200 HTTP status code
38
+ if (isStatusAssertionError(parsedStatusAssertion)) {
39
+ throw new _errors.IssuerResponseError({
40
+ code: _errors.IssuerResponseErrorCodes.CredentialInvalidStatus,
41
+ message: "The status assertion contains an error",
42
+ statusCode: 200,
43
+ reason: buildErrorReason(parsedStatusAssertion)
44
+ });
45
+ }
46
+ const {
47
+ cnf,
48
+ credential_status_type
49
+ } = parsedStatusAssertion.payload;
50
+ const holderBindingKey = await (0, _credentials.extractJwkFromCredential)(credential, format);
51
+ if (!(await (0, _jwk.isSameThumbprint)(cnf.jwk, holderBindingKey))) {
52
+ const errorMessage = `Failed to verify holder binding for status assertion: the thumbprints of keys ${cnf.jwk.kid} and ${holderBindingKey.kid} do not match`;
53
+ _logging.Logger.log(_logging.LogLevel.ERROR, errorMessage);
54
+ throw new _errors.IoWalletError(errorMessage);
55
+ }
56
+ if (credential_status_type !== _types.StatusType.VALID) {
57
+ throw new _errors.IssuerResponseError({
58
+ code: _errors.IssuerResponseErrorCodes.CredentialInvalidStatus,
59
+ message: "Invalid status found for the given credential",
60
+ statusCode: 200,
61
+ reason: buildErrorReason(parsedStatusAssertion)
62
+ });
63
+ }
64
+ return {
65
+ parsedStatusAssertion
66
+ };
67
+ };
68
+ exports.verifyAndParseStatusAssertion = verifyAndParseStatusAssertion;
69
+ const isStatusAssertionError = assertion => assertion.header.typ === "status-assertion-error+jwt";
70
+
71
+ /**
72
+ * Build an object containing the details on the error to use as the IssuerResponseError's reason
73
+ * @param assertion The status assertion response, both success or failure
74
+ * @returns The error's reason object
75
+ */
76
+ const buildErrorReason = _ref => {
77
+ let {
78
+ payload
79
+ } = _ref;
80
+ return "error" in payload ? payload : {
81
+ error: payload.credential_status_detail.state,
82
+ error_description: payload.credential_status_detail.description
83
+ };
84
+ };
85
+ //# sourceMappingURL=03-verify-and-parse-status-assertion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_errors","require","_ioReactNativeJwt","_types","_logging","_credentials","_jwk","verifyAndParseStatusAssertion","issuerConf","rawStatusAssertion","credential","format","statusAssertion","verify","openid_credential_issuer","jwks","keys","decodedJwt","decodeJwt","parsedStatusAssertion","ParsedStatusAssertionResponse","parse","header","protectedHeader","payload","Logger","log","LogLevel","DEBUG","JSON","stringify","isStatusAssertionError","IssuerResponseError","code","IssuerResponseErrorCodes","CredentialInvalidStatus","message","statusCode","reason","buildErrorReason","cnf","credential_status_type","holderBindingKey","extractJwkFromCredential","isSameThumbprint","jwk","errorMessage","kid","ERROR","IoWalletError","StatusType","VALID","exports","assertion","typ","_ref","error","credential_status_detail","state","error_description","description"],"sourceRoot":"../../../../src","sources":["credential/status/03-verify-and-parse-status-assertion.ts"],"mappings":";;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AAKA,IAAAC,iBAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AAOA,IAAAG,QAAA,GAAAH,OAAA;AAEA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,IAAA,GAAAL,OAAA;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMM,6BAA4D,GACvE,MAAAA,CAAOC,UAAU,EAAEC,kBAAkB,EAAEC,UAAU,EAAEC,MAAM,KAAK;EAC5D,MAAM;IAAEC;EAAgB,CAAC,GAAGH,kBAAkB;EAE9C,MAAM,IAAAI,wBAAM,EACVD,eAAe,EACfJ,UAAU,CAACM,wBAAwB,CAACC,IAAI,CAACC,IAC3C,CAAC;EAED,MAAMC,UAAU,GAAG,IAAAC,wBAAS,EAACN,eAAe,CAAC;EAC7C,MAAMO,qBAAqB,GAAGC,oCAA6B,CAACC,KAAK,CAAC;IAChEC,MAAM,EAAEL,UAAU,CAACM,eAAe;IAClCC,OAAO,EAAEP,UAAU,CAACO;EACtB,CAAC,CAAC;EAEFC,eAAM,CAACC,GAAG,CACRC,iBAAQ,CAACC,KAAK,EACb,4BAA2BC,IAAI,CAACC,SAAS,CAACX,qBAAqB,CAAE,EACpE,CAAC;;EAED;EACA,IAAIY,sBAAsB,CAACZ,qBAAqB,CAAC,EAAE;IACjD,MAAM,IAAIa,2BAAmB,CAAC;MAC5BC,IAAI,EAAEC,gCAAwB,CAACC,uBAAuB;MACtDC,OAAO,EAAE,wCAAwC;MACjDC,UAAU,EAAE,GAAG;MACfC,MAAM,EAAEC,gBAAgB,CAACpB,qBAAqB;IAChD,CAAC,CAAC;EACJ;EAEA,MAAM;IAAEqB,GAAG;IAAEC;E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
2
2
 
3
- This flow is used to obtain a credential status attestation from its credential issuer. Each step in the flow is imported from the related file which is named with a sequential number.
4
- The credential status attestation is a JWT which contains the credential status which indicates if the credential is valid or not.
5
- The status attestation is supposed to be stored securely along with the credential. It has a limited lifetime and should be refreshed periodically according to the `exp` field in the JWT payload.
3
+ This flow is used to obtain a credential status assertion from its credential issuer. Each step in the flow is imported from the related file which is named with a sequential number.
4
+ The credential status assertion is a JWT which contains the credential status which indicates if the credential is valid or not (see [OAuth Status Assertions](https://italia.github.io/eid-wallet-it-docs/versione-corrente/en/credential-revocation.html#oauth-status-assertions)).
5
+ The status assertion is supposed to be stored securely along with the credential. It has a limited lifetime and should be refreshed periodically according to the `exp` field in the JWT payload.
6
6
 
7
7
  ## Sequence Diagram
8
8
 
9
9
  ```mermaid
10
10
  graph TD;
11
11
  0[startFlow]
12
- 1[statusAttestation]
13
- 2[verifyAndParseStatusAttestation]
12
+ 1[statusAssertion]
13
+ 2[verifyAndParseStatusAssertion]
14
14
 
15
15
  0 --> 1
16
16
  1 --> 2
@@ -21,14 +21,14 @@ graph TD;
21
21
 
22
22
  The following errors are mapped to a `IssuerResponseError` with specific codes.
23
23
 
24
- |HTTP Status|Error Code|Description|
25
- |-----------|----------|-----------|
26
- |`404 Not Found`|`ERR_CREDENTIAL_INVALID_STATUS`|This response is returned by the credential issuer when the status attestation is invalid. It might contain more details in the `reason` property.|
24
+ |Error Code|Description|
25
+ |----------|-----------|
26
+ |`ERR_CREDENTIAL_INVALID_STATUS`|This error is thrown when the status assertion for a given credential is invalid. It might contain more details in the `reason` property.|
27
27
 
28
28
  ## Example
29
29
 
30
30
  <details>
31
- <summary>Credential status attestation flow</summary>
31
+ <summary>Credential status assertion flow</summary>
32
32
 
33
33
  ```ts
34
34
  // Start the issuance flow
@@ -42,24 +42,26 @@ const { issuerUrl } = startFlow();
42
42
  // Evaluate issuer trust
43
43
  const { issuerConf } = await Credential.Status.evaluateIssuerTrust(issuerUrl);
44
44
 
45
- // Get the credential attestation
46
- const res = await Credential.Status.statusAttestation(
45
+ // Get the credential assertion
46
+ const res = await Credential.Status.statusAssertion(
47
47
  issuerConf,
48
48
  credential,
49
- credentialCryptoContext
49
+ format,
50
+ { credentialCryptoContext, wiaCryptoContext }
50
51
  );
51
52
 
52
- // Verify and parse the status attestation
53
- const { parsedStatusAttestation } =
54
- await Credential.Status.verifyAndParseStatusAttestation(
53
+ // Verify and parse the status assertion
54
+ const { parsedStatusAssertion } =
55
+ await Credential.Status.verifyAndParseStatusAssertion(
55
56
  issuerConf,
56
- res.statusAttestation,
57
- { credentialCryptoContext }
57
+ res.statusAssertion,
58
+ credential,
59
+ format
58
60
  );
59
61
 
60
62
  return {
61
- statusAttestation: res.statusAttestation,
62
- parsedStatusAttestation,
63
+ statusAssertion: res.statusAssertion,
64
+ parsedStatusAssertion,
63
65
  };
64
66
  ```
65
67
 
@@ -9,19 +9,19 @@ Object.defineProperty(exports, "evaluateIssuerTrust", {
9
9
  return _issuance.evaluateIssuerTrust;
10
10
  }
11
11
  });
12
- Object.defineProperty(exports, "statusAttestation", {
12
+ Object.defineProperty(exports, "statusAssertion", {
13
13
  enumerable: true,
14
14
  get: function () {
15
- return _statusAttestation.statusAttestation;
15
+ return _statusAssertion.statusAssertion;
16
16
  }
17
17
  });
18
- Object.defineProperty(exports, "verifyAndParseStatusAttestation", {
18
+ Object.defineProperty(exports, "verifyAndParseStatusAssertion", {
19
19
  enumerable: true,
20
20
  get: function () {
21
- return _verifyAndParseStatusAttestation.verifyAndParseStatusAttestation;
21
+ return _verifyAndParseStatusAssertion.verifyAndParseStatusAssertion;
22
22
  }
23
23
  });
24
- var _statusAttestation = require("./02-status-attestation");
24
+ var _statusAssertion = require("./02-status-assertion");
25
25
  var _issuance = require("../issuance");
26
- var _verifyAndParseStatusAttestation = require("./03-verify-and-parse-status-attestation");
26
+ var _verifyAndParseStatusAssertion = require("./03-verify-and-parse-status-assertion");
27
27
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_statusAttestation","require","_issuance","_verifyAndParseStatusAttestation"],"sourceRoot":"../../../../src","sources":["credential/status/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,kBAAA,GAAAC,OAAA;AAIA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,gCAAA,GAAAF,OAAA"}
1
+ {"version":3,"names":["_statusAssertion","require","_issuance","_verifyAndParseStatusAssertion"],"sourceRoot":"../../../../src","sources":["credential/status/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,gBAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,8BAAA,GAAAF,OAAA"}
@@ -3,38 +3,40 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.StatusAttestationResponse = exports.ParsedStatusAttestation = void 0;
6
+ exports.StatusType = exports.StatusAssertionResponse = exports.ParsedStatusAssertionResponse = exports.ParsedStatusAssertionError = exports.ParsedStatusAssertion = void 0;
7
7
  var _types = require("../../sd-jwt/types");
8
8
  var _jwk = require("../../utils/jwk");
9
9
  var z = _interopRequireWildcard(require("zod"));
10
10
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
11
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
12
12
  /**
13
- * Shape from parsing a status attestation response in case of 201.
13
+ * Shape from parsing a status assertion response in case of 201.
14
14
  */
15
- const StatusAttestationResponse = z.object({
16
- status_attestation: z.string()
15
+ const StatusAssertionResponse = z.object({
16
+ status_assertion_responses: z.array(z.string())
17
17
  });
18
18
 
19
19
  /**
20
- * Type from parsing a status attestation response in case of 201.
21
- * Inferred from {@link StatusAttestationResponse}.
20
+ * Type from parsing a status assertion response in case of 201.
21
+ * Inferred from {@link StatusAssertionResponse}.
22
22
  */
23
-
24
- /**
25
- * Type for a parsed status attestation.
26
- */
27
- exports.StatusAttestationResponse = StatusAttestationResponse;
23
+ exports.StatusAssertionResponse = StatusAssertionResponse;
28
24
  /**
29
- * Shape for parsing a status attestation in a JWT.
25
+ * Shape for parsing a successful status assertion in a JWT.
30
26
  */
31
- const ParsedStatusAttestation = z.object({
27
+ const ParsedStatusAssertion = z.object({
32
28
  header: z.object({
33
- typ: z.literal("status-attestation+jwt"),
29
+ typ: z.literal("status-assertion+jwt"),
34
30
  alg: z.string(),
35
31
  kid: z.string().optional()
36
32
  }),
37
33
  payload: z.object({
34
+ iss: z.string(),
35
+ credential_status_type: z.string(),
36
+ credential_status_detail: z.object({
37
+ state: z.string(),
38
+ description: z.string()
39
+ }).optional(),
38
40
  credential_hash_alg: z.string(),
39
41
  credential_hash: z.string(),
40
42
  cnf: z.object({
@@ -44,5 +46,36 @@ const ParsedStatusAttestation = z.object({
44
46
  iat: _types.UnixTime
45
47
  })
46
48
  });
47
- exports.ParsedStatusAttestation = ParsedStatusAttestation;
49
+ exports.ParsedStatusAssertion = ParsedStatusAssertion;
50
+ /**
51
+ * The JWT that contains the errors occurred for the status assertion request.
52
+ * @see https://italia.github.io/eid-wallet-it-docs/versione-corrente/en/credential-revocation.html#http-status-assertion-response
53
+ */
54
+ const ParsedStatusAssertionError = z.object({
55
+ header: z.object({
56
+ typ: z.literal("status-assertion-error+jwt"),
57
+ alg: z.string(),
58
+ kid: z.string().optional()
59
+ }),
60
+ payload: z.object({
61
+ credential_hash_alg: z.string(),
62
+ credential_hash: z.string(),
63
+ error: z.string(),
64
+ error_description: z.string()
65
+ })
66
+ });
67
+
68
+ /**
69
+ * The status assertion response that might include either a successful assertion or an error
70
+ */
71
+ exports.ParsedStatusAssertionError = ParsedStatusAssertionError;
72
+ const ParsedStatusAssertionResponse = z.union([ParsedStatusAssertion, ParsedStatusAssertionError]);
73
+ exports.ParsedStatusAssertionResponse = ParsedStatusAssertionResponse;
74
+ let StatusType = /*#__PURE__*/function (StatusType) {
75
+ StatusType["VALID"] = "0x00";
76
+ StatusType["INVALID"] = "0x01";
77
+ StatusType["SUSPENDED"] = "0x02";
78
+ return StatusType;
79
+ }({});
80
+ exports.StatusType = StatusType;
48
81
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_types","require","_jwk","z","_interopRequireWildcard","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","StatusAttestationResponse","object","status_attestation","string","exports","ParsedStatusAttestation","header","typ","literal","alg","kid","optional","payload","credential_hash_alg","credential_hash","cnf","jwk","JWK","exp","UnixTime","iat"],"sourceRoot":"../../../../src","sources":["credential/status/types.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,CAAA,GAAAC,uBAAA,CAAAH,OAAA;AAAyB,SAAAI,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,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MAAM,CAAC;EAC9CK,MAAM,EAAE9B,CAAC,CAACyB,MAAM,CAAC;IACfM,GAAG,EAAE/B,CAAC,CAACgC,OAAO,CAAC,wBAAwB,CAAC;IACxCC,GAAG,EAAEjC,CAAC,CAAC2B,MAAM,CAAC,CAAC;IACfO,GAAG,EAAElC,CAAC,CAAC2B,MAAM,CAAC,CAAC,CAACQ,QAAQ,CAAC;EAC3B,CAAC,CAAC;EACFC,OAAO,EAAEpC,CAAC,CAACyB,MAAM,CAAC;IAChBY,mBAAmB,EAAErC,CAAC,CAAC2B,MAAM,CAAC,CAAC;IAC/BW,eAAe,EAAEtC,CAAC,CAAC2B,MAAM,CAAC,CAAC;IAC3BY,GAAG,EAAEvC,CAAC,CAACyB,MAAM,CAAC;MACZe,GAAG,EAAEC;IACP,CAAC,CAAC;IACFC,GAAG,EAAEC,eAAQ;IACbC,GAAG,EAAED;EACP,CAAC;AACH,CAAC,CAAC;AAACf,OAAA,CAAAC,uBAAA,GAAAA,uBAAA"}
1
+ {"version":3,"names":["_types","require","_jwk","z","_interopRequireWildcard","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","StatusAssertionResponse","object","status_assertion_responses","array","string","exports","ParsedStatusAssertion","header","typ","literal","alg","kid","optional","payload","iss","credential_status_type","credential_status_detail","state","description","credential_hash_alg","credential_hash","cnf","jwk","JWK","exp","UnixTime","iat","ParsedStatusAssertionError","error","error_description","ParsedStatusAssertionResponse","union","StatusType"],"sourceRoot":"../../../../src","sources":["credential/status/types.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,CAAA,GAAAC,uBAAA,CAAAH,OAAA;AAAyB,SAAAI,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAA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C,CAAC4B,MAAM,CAAC,CAAC;IACfO,GAAG,EAAEnC,CAAC,CAAC4B,MAAM,CAAC,CAAC,CAACQ,QAAQ,CAAC;EAC3B,CAAC,CAAC;EACFC,OAAO,EAAErC,CAAC,CAACyB,MAAM,CAAC;IAChBkB,mBAAmB,EAAE3C,CAAC,CAAC4B,MAAM,CAAC,CAAC;IAC/BgB,eAAe,EAAE5C,CAAC,CAAC4B,MAAM,CAAC,CAAC;IAC3BwB,KAAK,EAAEpD,CAAC,CAAC4B,MAAM,CAAC,CAAC;IACjByB,iBAAiB,EAAErD,CAAC,CAAC4B,MAAM,CAAC;EAC9B,CAAC;AACH,CAAC,CAAC;;AAEF;AACA;AACA;AAFAC,OAAA,CAAAsB,0BAAA,GAAAA,0BAAA;AAMO,MAAMG,6BAA6B,GAAGtD,CAAC,CAACuD,KAAK,CAAC,CACnDzB,qBAAqB,EACrBqB,0BAA0B,CAC3B,CAAC;AAACtB,OAAA,CAAAyB,6BAAA,GAAAA,6BAAA;AAAA,IAESE,UAAU,0BAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA;AAAA3B,OAAA,CAAA2B,UAAA,GAAAA,UAAA"}
@@ -44,7 +44,8 @@ const CredentialIssuerDisplayMetadata = z.object({
44
44
  locale: z.string()
45
45
  });
46
46
  const ClaimsMetadata = z.object({
47
- path: z.array(z.string()),
47
+ path: z.array(z.union([z.string(), z.number(), z.null()])),
48
+ // https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0-15.html#name-claims-path-pointer
48
49
  display: z.array(CredentialDisplayMetadata)
49
50
  });
50
51
  const IssuanceErrorSupported = z.object({
@@ -1 +1 @@
1
- {"version":3,"names":["_types","require","_jwk","z","_interopRequireWildcard","_types2","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","TrustMark","object","id","string","trust_mark","exports","RelyingPartyMetadata","application_type","optional","client_id","client_name","jwks","keys","array","JWK","contacts","presentation_definition","PresentationDefinition","request_uris","authorization_signed_response_alg","authorization_encrypted_response_alg","authorization_encrypted_response_enc","CredentialDisplayMetadata","name","locale","CredentialIssuerDisplayMetadata","ClaimsMetadata","path","display","IssuanceErrorSupported","title","description","SupportedCredentialMetadata","intersection","discriminatedUnion","format","literal","vct","doctype","scope","claims","cryptographic_binding_methods_supported","credential_signing_alg_values_supported","authentic_source","issuance_errors_supported","record","EntityStatement","header","typ","alg","kid","payload","iss","sub","trust_marks","iat","number","exp","EntityConfigurationHeader","FederationEntityMetadata","federation_fetch_endpoint","federation_list_endpoint","federation_resolve_endpoint","federation_trust_mark_status_endpoint","federation_trust_mark_list_endpoint","federation_trust_mark_endpoint","federation_historical_keys_endpoint","endpoint_auth_signing_alg_values_supported","organization_name","homepage_uri","policy_uri","logo_uri","passthrough","BaseEntityConfiguration","UnixTime","authority_hints","metadata","federation_entity","TrustAnchorEntityConfiguration","CredentialIssuerEntityConfiguration","and","openid_credential_issuer","credential_issuer","credential_endpoint","revocation_endpoint","nonce_endpoint","status_attestation_endpoint","credential_configurations_supported","trust_frameworks_supported","evidence_supported","oauth_authorization_server","authorization_endpoint","pushed_authorization_request_endpoint","token_endpoint","client_registration_types_supported","code_challenge_methods_supported","acr_values_supported","grant_types_supported","issuer","scopes_supported","response_modes_supported","token_endpoint_auth_methods_supported","token_endpoint_auth_signing_alg_values_supported","request_object_signing_alg_values_supported","openid_credential_verifier","RelyingPartyEntityConfiguration","WalletProviderEntityConfiguration","wallet_provider","aal_values_supported","EntityConfiguration","union","FederationListResponse"],"sourceRoot":"../../../src","sources":["trust/types.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,CAAA,GAAAC,uBAAA,CAAAH,OAAA;AACA,IAAAI,OA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GAAGtI,CAAC,CAACuI,KAAK,CACxC,CACEJ,iCAAiC,EACjC3B,mCAAmC,EACnCD,8BAA8B,EAC9B2B,+BAA+B,CAChC,EACD;EACE1E,WAAW,EAAE;AACf,CACF,CAAC;AAAC1B,OAAA,CAAAwG,mBAAA,GAAAA,mBAAA;AAEK,MAAME,sBAAsB,GAAGxI,CAAC,CAACsC,KAAK,CAACtC,CAAC,CAAC4B,MAAM,CAAC,CAAC,CAAC;AAACE,OAAA,CAAA0G,sBAAA,GAAAA,sBAAA"}
1
+ {"version":3,"names":["_types","require","_jwk","z","_interopRequireWildcard","_types2","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","TrustMark","object","id","string","trust_mark","exports","RelyingPartyMetadata","application_type","optional","client_id","client_name","jwks","keys","array","JWK","contacts","presentation_definition","PresentationDefinition","request_uris","authorization_signed_response_alg","authorization_encrypted_response_alg","authorization_encrypted_response_enc","CredentialDisplayMetadata","name","locale","CredentialIssuerDisplayMetadata","ClaimsMetadata","path","union","number","null","display","IssuanceErrorSupported","title","description","SupportedCredentialMetadata","intersection","discriminatedUnion","format","literal","vct","doctype","scope","claims","cryptographic_binding_methods_supported","credential_signing_alg_values_supported","authentic_source","issuance_errors_supported","record","EntityStatement","header","typ","alg","kid","payload","iss","sub","trust_marks","iat","exp","EntityConfigurationHeader","FederationEntityMetadata","federation_fetch_endpoint","federation_list_endpoint","federation_resolve_endpoint","federation_trust_mark_status_endpoint","federation_trust_mark_list_endpoint","federation_trust_mark_endpoint","federation_historical_keys_endpoint","endpoint_auth_signing_alg_values_supported","organization_name","homepage_uri","policy_uri","logo_uri","passthrough","BaseEntityConfiguration","UnixTime","authority_hints","metadata","federation_entity","TrustAnchorEntityConfiguration","CredentialIssuerEntityConfiguration","and","openid_credential_issuer","credential_issuer","credential_endpoint","revocation_endpoint","nonce_endpoint","status_attestation_endpoint","credential_configurations_supported","trust_frameworks_supported","evidence_supported","oauth_authorization_server","authorization_endpoint","pushed_authorization_request_endpoint","token_endpoint","client_registration_types_supported","code_challenge_methods_supported","acr_values_supported","grant_types_supported","issuer","scopes_supported","response_modes_supported","token_endpoint_auth_methods_supported","token_endpoint_auth_signing_alg_values_supported","request_object_signing_alg_values_supported","openid_credential_verifier","RelyingPartyEntityConfiguration","WalletProviderEntityConfiguration","wallet_provider","aal_values_supported","EntityConfiguration","FederationListResponse"],"sourceRoot":"../../../src","sources":["trust/types.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,CAAA,GAAAC,uBAAA,CAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAA0E,SAAAK,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAH,wBAAAO,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAA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AAoB,EAAEvI,CAAC,CAACsC,KAAK,CAACtC,CAAC,CAAC4B,MAAM,CAAC,CAAC,CAAC,CAACK,QAAQ,CAAC,CAAC;QACpD2F,qBAAqB,EAAE5H,CAAC,CAACsC,KAAK,CAACtC,CAAC,CAAC4B,MAAM,CAAC,CAAC,CAAC;QAC1CoG,qCAAqC,EAAEhI,CAAC,CAACsC,KAAK,CAACtC,CAAC,CAAC4B,MAAM,CAAC,CAAC,CAAC;QAC1DqG,gDAAgD,EAAEjI,CAAC,CAACsC,KAAK,CACvDtC,CAAC,CAAC4B,MAAM,CAAC,CACX,CAAC;QACDQ,IAAI,EAAEpC,CAAC,CAAC0B,MAAM,CAAC;UAAEW,IAAI,EAAErC,CAAC,CAACsC,KAAK,CAACC,QAAG;QAAE,CAAC;MACvC,CAAC,CAAC,CACD4D,WAAW,CAAC;IACjB,CAAC;EACH,CAAC;AACH,CAAC,CACH,CAAC;;AAED;AAAArE,OAAA,CAAAuG,iCAAA,GAAAA,iCAAA;AAEO,MAAMG,mBAAmB,GAAGxI,CAAC,CAACqD,KAAK,CACxC,CACEgF,iCAAiC,EACjC3B,mCAAmC,EACnCD,8BAA8B,EAC9B2B,+BAA+B,CAChC,EACD;EACEzE,WAAW,EAAE;AACf,CACF,CAAC;AAAC7B,OAAA,CAAA0G,mBAAA,GAAAA,mBAAA;AAEK,MAAMC,sBAAsB,GAAGzI,CAAC,CAACsC,KAAK,CAACtC,CAAC,CAAC4B,MAAM,CAAC,CAAC,CAAC;AAACE,OAAA,CAAA2G,sBAAA,GAAAA,sBAAA"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.extractJwkFromCredential = void 0;
7
+ var _sdJwt = require("../sd-jwt");
8
+ var _ioReactNativeJwt = require("@pagopa/io-react-native-jwt");
9
+ var _errors = require("./errors");
10
+ const SD_JWT = ["vc+sd-jwt", "dc+sd-jwt"];
11
+
12
+ /**
13
+ * Extracts a JWK from a credential.
14
+ * @param credential - The credential string, which can be in SD-JWT or CBOR format.
15
+ * @param format - The format of the credential
16
+ * @return A Promise that resolves to a JWK object if the credential is in SD-JWT format and contains a JWK, or undefined otherwise.
17
+ */
18
+ const extractJwkFromCredential = async (credential, format) => {
19
+ if (SD_JWT.includes(format)) {
20
+ // 1. SD-JWT case
21
+ const decoded = (0, _sdJwt.decode)(credential);
22
+ const jwk = decoded.sdJwt.payload.cnf.jwk;
23
+ if (jwk) {
24
+ return {
25
+ ...jwk,
26
+ kid: await (0, _ioReactNativeJwt.thumbprint)(jwk)
27
+ };
28
+ }
29
+ }
30
+ throw new _errors.IoWalletError(`Credential format ${format} not supported`);
31
+ };
32
+ exports.extractJwkFromCredential = extractJwkFromCredential;
33
+ //# sourceMappingURL=credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_sdJwt","require","_ioReactNativeJwt","_errors","SD_JWT","extractJwkFromCredential","credential","format","includes","decoded","decode","jwk","sdJwt","payload","cnf","kid","thumbprint","IoWalletError","exports"],"sourceRoot":"../../../src","sources":["utils/credentials.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AAIA,IAAAE,OAAA,GAAAF,OAAA;AAEA,MAAMG,MAAM,GAAG,CAAC,WAAW,EAAE,WAAW,CAAC;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,wBAAwB,GAAG,MAAAA,CACtCC,UAA+C,EAC/CC,MAAuC,KACtB;EACjB,IAAIH,MAAM,CAACI,QAAQ,CAACD,MAAM,CAAC,EAAE;IAC3B;IACA,MAAME,OAAO,GAAG,IAAAC,aAAM,EAACJ,UAAU,CAAC;IAClC,MAAMK,GAAG,GAAGF,OAAO,CAACG,KAAK,CAACC,OAAO,CAACC,GAAG,CAACH,GAAG;IACzC,IAAIA,GAAG,EAAE;MACP,OAAO;QAAE,GAAGA,GAAG;QAAEI,GAAG,EAAE,MAAM,IAAAC,4BAAU,EAACL,GAAG;MAAE,CAAC;IAC/C;EACF;EACA,MAAM,IAAIM,qBAAa,CAAE,qBAAoBV,MAAO,gBAAe,CAAC;AACtE,CAAC;AAACW,OAAA,CAAAb,wBAAA,GAAAA,wBAAA"}