@open-charging-cloud/wwcp-poi 0.2.0 → 0.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.
Files changed (91) hide show
  1. package/CHANGELOG.md +658 -1
  2. package/README.md +106 -38
  3. package/dist/common.d.ts +11 -0
  4. package/dist/common.d.ts.map +1 -1
  5. package/dist/crypto/ber.d.ts +48 -0
  6. package/dist/crypto/ber.d.ts.map +1 -0
  7. package/dist/crypto/certificates.d.ts +21 -0
  8. package/dist/crypto/certificates.d.ts.map +1 -0
  9. package/dist/crypto/curves.d.ts +25 -0
  10. package/dist/crypto/curves.d.ts.map +1 -0
  11. package/dist/crypto/ecc.d.ts +34 -0
  12. package/dist/crypto/ecc.d.ts.map +1 -0
  13. package/dist/crypto/publicKeys.d.ts +51 -0
  14. package/dist/crypto/publicKeys.d.ts.map +1 -0
  15. package/dist/crypto/rsa.d.ts +30 -0
  16. package/dist/crypto/rsa.d.ts.map +1 -0
  17. package/dist/encoding/text.d.ts +9 -0
  18. package/dist/encoding/text.d.ts.map +1 -1
  19. package/dist/evTaler/amounts.d.ts +89 -0
  20. package/dist/evTaler/amounts.d.ts.map +1 -0
  21. package/dist/evTaler/contractTerms.d.ts +126 -0
  22. package/dist/evTaler/contractTerms.d.ts.map +1 -0
  23. package/dist/evTaler/meterValue.d.ts +65 -0
  24. package/dist/evTaler/meterValue.d.ts.map +1 -0
  25. package/dist/evTaler/payURI.d.ts +28 -0
  26. package/dist/evTaler/payURI.d.ts.map +1 -0
  27. package/dist/evTaler/settlement.d.ts +85 -0
  28. package/dist/evTaler/settlement.d.ts.map +1 -0
  29. package/dist/evTaler/step.d.ts +72 -0
  30. package/dist/evTaler/step.d.ts.map +1 -0
  31. package/dist/history/apply.d.ts +6 -1
  32. package/dist/history/apply.d.ts.map +1 -1
  33. package/dist/history/changeSet.d.ts +30 -4
  34. package/dist/history/changeSet.d.ts.map +1 -1
  35. package/dist/history/checkpoint.d.ts +7 -0
  36. package/dist/history/checkpoint.d.ts.map +1 -1
  37. package/dist/history/commit.d.ts +21 -3
  38. package/dist/history/commit.d.ts.map +1 -1
  39. package/dist/history/elements.d.ts +19 -0
  40. package/dist/history/elements.d.ts.map +1 -0
  41. package/dist/history/history.d.ts +46 -6
  42. package/dist/history/history.d.ts.map +1 -1
  43. package/dist/history/preconditions.d.ts +23 -0
  44. package/dist/history/preconditions.d.ts.map +1 -0
  45. package/dist/index.d.ts +11 -4
  46. package/dist/index.d.ts.map +1 -1
  47. package/dist/index.js +10170 -2047
  48. package/dist/index.js.map +1 -1
  49. package/dist/json/canonical.d.ts.map +1 -1
  50. package/dist/keys.d.ts.map +1 -1
  51. package/dist/network/certificates.d.ts +16 -4
  52. package/dist/network/certificates.d.ts.map +1 -1
  53. package/dist/network/countries.d.ts +16 -0
  54. package/dist/network/countries.d.ts.map +1 -0
  55. package/dist/network/evTaler.d.ts +7 -14
  56. package/dist/network/evTaler.d.ts.map +1 -1
  57. package/dist/network/identifications.d.ts +6 -6
  58. package/dist/network/identifications.d.ts.map +1 -1
  59. package/dist/network/measurementPublicKey.d.ts +7 -0
  60. package/dist/network/measurementPublicKey.d.ts.map +1 -0
  61. package/dist/network/offers.d.ts +53 -0
  62. package/dist/network/offers.d.ts.map +1 -0
  63. package/dist/network/partyKeys.d.ts +8 -5
  64. package/dist/network/partyKeys.d.ts.map +1 -1
  65. package/dist/network/poiJSON.d.ts +175 -0
  66. package/dist/network/poiJSON.d.ts.map +1 -0
  67. package/dist/network/poiValues.d.ts +55 -0
  68. package/dist/network/poiValues.d.ts.map +1 -0
  69. package/dist/network/reading.d.ts +58 -0
  70. package/dist/network/reading.d.ts.map +1 -0
  71. package/dist/network/references.d.ts +43 -0
  72. package/dist/network/references.d.ts.map +1 -0
  73. package/dist/network/roamingNetwork.d.ts +17 -12
  74. package/dist/network/roamingNetwork.d.ts.map +1 -1
  75. package/dist/network/timeZones.d.ts +8 -0
  76. package/dist/network/timeZones.d.ts.map +1 -0
  77. package/dist/network/tree.d.ts +14 -0
  78. package/dist/network/tree.d.ts.map +1 -1
  79. package/dist/network/versionTexts.d.ts +1 -7
  80. package/dist/network/versionTexts.d.ts.map +1 -1
  81. package/dist/network/writtenForm.d.ts +27 -1
  82. package/dist/network/writtenForm.d.ts.map +1 -1
  83. package/dist/proofs/keyStatement.d.ts.map +1 -1
  84. package/dist/proofs/priceStatement.d.ts.map +1 -1
  85. package/dist/verifier/checkpoints.d.ts +6 -0
  86. package/dist/verifier/checkpoints.d.ts.map +1 -1
  87. package/dist/verifier/grossRates.d.ts +11 -0
  88. package/dist/verifier/grossRates.d.ts.map +1 -0
  89. package/dist/verifier/sessionPrices.d.ts +3 -0
  90. package/dist/verifier/sessionPrices.d.ts.map +1 -1
  91. package/package.json +14 -13
package/README.md CHANGED
@@ -24,15 +24,19 @@ ML-DSA-44/65/87.
24
24
 
25
25
  ## Status
26
26
 
27
- **0.2.0 is prepared, not yet published to npm.** It includes the shared trust and session verification APIs previously
28
- supplied as 0.1.2-dev.0 development packages. See [the changelog](CHANGELOG.md#020-prepared-not-yet-published) for the
29
- changes and migration requirements. The experimental profiles below remain experimental; a package release does not
30
- establish production witness services or independently verified actual measurement time.
31
-
32
- **Milestone 1: the examples of WWCP_POI, checked in TypeScript.** The examples A1 to A14 of
33
- [WWCP_POI/examples](https://github.com/OpenChargingCloud/WWCP_POI/tree/master/examples) at commit `33447ac` are checked
34
- from what the C# examples publish, as their `Validate()` methods check them, and the same for proofs of charging stations
35
- the C# implementation makes; also from a second run of the C# examples, with new keys. See [Tests](#tests).
27
+ **0.4.0 is prepared, not yet published to npm.** It identifies and signs change sets and commits as WWCP_POI3 writes
28
+ them again, reads every change as WWCP_POI3 does, in its words, and adds EV Taler phase 3, the web payment page and the
29
+ profile of contracts. See [the changelog](CHANGELOG.md#040-prepared-not-yet-published) for the changes and migration
30
+ requirements: versions and change sets 0.3.0 took are refused. Until then 0.3.0, published to npm on 8 November 2026,
31
+ is the latest release. The experimental profiles below remain experimental; a package release does not establish
32
+ production witness services or independently verified actual measurement time.
33
+
34
+ **Milestone 1: the examples of WWCP_POI, checked in TypeScript.** The examples A1 to A16 of
35
+ [WWCP_POI/examples](https://github.com/OpenChargingCloud/WWCP_POI/tree/master/examples) are checked from what the C#
36
+ examples publish, as their `Validate()` methods check them, and the same for proofs of charging stations the C#
37
+ implementation makes: in the tests from the run of WWCP_POI `76d3653` vendored here, and every night from a new run of
38
+ WWCP_POI master, with new keys. EV Taler phase 2, which example A16 shows, is also checked on the proof of example A15
39
+ and probed against WWCP_POI3. See [Tests](#tests).
36
40
 
37
41
  What a review of the C# implementation found while porting it is in
38
42
  [docs/csharp-review.md of WWCPPOIConformanceTests](https://github.com/OpenChargingCloud/WWCPPOIConformanceTests/blob/master/docs/csharp-review.md),
@@ -181,7 +185,8 @@ const history = History.fromSnapshot(checkpointSnapshotJSON, {
181
185
  trust.verifyOperatorSignatures(commit.signatures, (s, key) => commit.verifySignature(s, key), 'the commit');
182
186
  trust = trust.followedBy(after); // the keys its operator states anew, signed by those trusted
183
187
  },
184
- verifyCheckpoint: checkpoint => verifyCheckpointSignatures(checkpoint, trust, { witnesses, requiredWitnesses: 2 }),
188
+ // A checkpoint is taken with the signatures that verified here, the others left out (S39).
189
+ verifyCheckpoint: checkpoint => verifyCheckpointSignatures(checkpoint, trust, { witnesses, requiredWitnesses: 2 }).verified,
185
190
  });
186
191
 
187
192
  for (const commit of commitsSince)
@@ -200,20 +205,21 @@ epoch2.root.commit.id; // the published genesis of epoch 2, 128 hexadecimal d
200
205
  | | |
201
206
  |---|---|
202
207
  | Canonical JSON, deterministic CBOR (Styx) | complete, including Styx's string escaping and decimals as `System.Decimal` holds them |
203
- | Keys, thumbprints, signatures | EC2, OKP and AKP COSE keys, read in the words of WWCP_POI; all signature algorithms of section 4; the key usages `infrastructure`, `tariffs`, `priceStatements`, `models`, `software`, `certificates`, `payments`, `party` |
208
+ | Keys, thumbprints, signatures | EC2, OKP, AKP and RSA COSE keys, read in the words of WWCP_POI; all signature algorithms of section 4; the key usages `infrastructure`, `tariffs`, `priceStatements`, `models`, `software`, `certificates`, `payments`, `party` |
204
209
  | Trust anchors | QR code (`WWCP/TA-2:` and Base45 of CBOR), URL and JSON forms, read and written; key statements followed by succession |
205
- | Roaming networks | ETags `json`, `cbor`, `effectiveTree`; the roaming network operator, its key statement and certificates; the keys of every party and of the roaming network operator as WWCP_POI reads them, none twice, none both a signing and an identity key, no identity key naming usages; the identifications unique within the network (grid connection points, energy meters, parking entities, transparency software releases and certificates, energy meter templates and groups, groups of operators and providers, offers), each once, compared as the C# types compare them; hardware revisions, firmware versions and serial numbers as WWCP_POI reads them, not empty, no whitespace at either end, those of a model each once; certificates as WWCP_POI reads them, for exactly one model, with its versions and releases; the conformity assessment bodies issuing them as WWCP_POI reads them, a notified body number of four digits for one body only, the legislations they are notified for neither empty nor twice, in their ordinal order, a certificate only under one of them; the content as WWCP_POI writes it (SPECIFICATION.md 2): what it takes and writes otherwise is refused, as written again it would be another text than the one hashed (ordered lists out of their order or with untrimmed texts, lists it leaves out given empty or writes also empty left out, properties given as null, embedded objects naming a JSON-LD context, texts in languages not as Styx writes them or empty, timestamps not UTC to the millisecond, entities without their lastChange, parties without their name, identifications given as numbers, properties of keys and of EV Taler merchants and exchanges it does not read, their base URLs and currencies not as it writes them); the roaming network operator, its key statement and certificates, the tree hash algorithms and the identifications of entities in the words of WWCP_POI.; of every entity what its type in WWCP_POI3 neither writes nor reads, and values it writes otherwise (trimmed, with a scheme, in its case, coordinates as doubles), in the words of its written form since 3de830a ("the content leaves it out", "the content holds it as …"). Not yet: properties of another JSON type or missing, the formats of identifications, and the references, which WWCP_POI refuses |
210
+ | Roaming networks | ETags `json`, `cbor`, `effectiveTree`; the roaming network operator, its key statement and certificates; the keys of every party and of the roaming network operator as WWCP_POI reads them, none twice, none both a signing and an identity key, no identity key naming usages; the identifications unique within the network (grid connection points, energy meters, parking entities, transparency software releases and certificates, energy meter templates and groups, groups of operators and providers, offers), each once, compared as the C# types compare them; transparency software releases and certificates identified under the manufacturer or body that has them (SPECIFICATION.md 4.1): its `@id`, a colon and a name without one, the prefix compared without case, also after a change set; hardware revisions, firmware versions and serial numbers as WWCP_POI reads them, not empty, no whitespace at either end, those of a model each once; certificates as WWCP_POI reads them, for exactly one model, with its versions and releases; the conformity assessment bodies issuing them as WWCP_POI reads them, a notified body number of four digits for one body only, the legislations they are notified for neither empty nor twice, in their ordinal order, a certificate only under one of them; the content as WWCP_POI writes it (SPECIFICATION.md 2): what it takes and writes otherwise is refused, as written again it would be another text than the one hashed (ordered lists out of their order or with untrimmed texts, lists it leaves out given empty or writes also empty left out, properties given as null, embedded objects naming a JSON-LD context, texts in languages not as Styx writes them or empty, timestamps not UTC to the millisecond, entities without their lastChange, parties without their name, identifications given as numbers, properties of keys and of EV Taler merchants and exchanges it does not read, their base URLs and currencies not as it writes them); the roaming network operator, its key statement and certificates, the tree hash algorithms and the identifications of entities in the words of WWCP_POI.; of every entity what its type in WWCP_POI3 neither writes nor reads, and values it writes otherwise (trimmed, with a scheme, in its case, coordinates as doubles, numbers, booleans and texts as their types, durations in whole ticks, opening times as Styx writes them, NUTS codes in upper case, countries of addresses by their alpha-3 codes, flags in the order of their values, each once, languages given by their numbers by their names), in the words of its written form since 3de830a ("the content leaves it out", "the content holds it as …"). Every entity WWCP_POI3 reads, as it reads it, refused in its words and order (`reading.ts`): JSON types, mandatory properties, values, identifications, names of enumerations, currencies, URLs, timestamps, texts in languages, data licenses, and what the constructor of each entity refuses of what it read; the references the constructor of the roaming network checks, with the identifications unique within it, in its order (`references.ts`): manufacturers, models, hardware revisions, firmware versions, releases, certificates, grid connection points, charging stations, parking spaces and maintainers the network has, stations and meters within what their models allow, no key of two parties; time zones of charging pools and their templates of a region of the IANA time zone database, as it writes them, which the platform knows; charging tariff offers of an operator not overlapping, in the time zones of their EVSEs, and of an e-mobility provider not made to overlap by a change set of it (`offers.ts`); measurement public keys and their certificates as WWCP_POI3 checks them with BouncyCastle (`measurementPublicKey.ts`): DER, RSA, EC of the 84 named curves BouncyCastle knows, Ed25519, Ed448, X25519, X448, DSA, ML-DSA, ML-KEM, SLH-DSA, each certificate issued by the next one. Taken as given, where WWCP_POI3 checks them: points on curves over binary fields, explicit curve parameters, keys of Diffie-Hellman, ElGamal, GOST and DSTU |
206
211
  | Effective members (9.2) | EVSEs, charging stations, charging pools, charging tariffs, energy meters. Parking spaces and energy meters of grid connection points taking templates are refused, not calculated |
207
- | Proofs (8.4), attestations (8.5) | complete, with the manufacturers and models of the station and its meters, the transparency software releases and certificates of the meters; subject attestations do not count for a whole proof |
208
- | Change sets (4) | `Add`, `Remove`, `UpdateProperty`, `RemoveProperty` of parties (charging station operators, e-mobility providers, grid and parking operators, charging station and energy meter manufacturers, transparency software manufacturers, conformity assessment bodies), the roaming network and its operator, of charging pools, stations, EVSEs, tariffs, templates and groups of charging station operators, energy meter templates and groups, models of manufacturers, transparency software releases and certificates, with their owners' signatures, quorum and proof of possession, and the properties a change set may change: not the version of a release, also not by removing it and adding it again; the `notifiedBodyNumber` and `notifiedFor` of a conformity assessment body by the roaming network operator only. Element changes, preconditions, offers and the entities of providers, grid and parking operators are refused, not applied. The references the C# implementation checks after every change set (a manufacturer, model, release or certificate a station, meter or certificate names) are not checked again: the `afterETags` of the change set pin the version it leads to. The identifications unique within the network are, as in every version |
209
- | Histories (5, 10, 11) | linear histories from snapshots, anchored in the trust anchor as a peer of WWCP_POI starts (10.5): a snapshot of a checkpoint by the checkpoint, signed as the roaming network operator, a snapshot of the head by its attestations, none without a trust anchor unless taken unanchored explicitly; commits, checkpoints, their lines and signatures, signed ones only with a verifier; proofs of commits, archive segments; epochs: their profiles, the final checkpoint, the genesis of the next epoch, its first checkpoint. Merges are not taken yet; no peer, no server |
212
+ | Proofs (8.4), attestations (8.5) | complete, with the manufacturers and models of the station and its meters, the transparency software releases and certificates of the meters; subject attestations do not count for a whole proof; whether a proof gives a child array of an entity completely, and its size also where it gives some or none (`givesCompletely`, `sizeOf`) |
213
+ | Change sets (4) | `Add`, `Remove`, `UpdateProperty`, `RemoveProperty` of parties (charging station operators, e-mobility providers, grid and parking operators, charging station and energy meter manufacturers, transparency software manufacturers, conformity assessment bodies), the roaming network and its operator, of charging pools, stations, EVSEs, tariffs, templates and groups of charging station operators, energy meter templates and groups, models of manufacturers, transparency software releases and certificates, with their owners' signatures, quorum and proof of possession, and the properties a change set may change: not the version of a release, also not by removing it and adding it again; the `notifiedBodyNumber` and `notifiedFor` of a conformity assessment body by the roaming network operator only. The charging tariff offers of operators and providers, the groups of providers, the grid connection points of grid operators, the parking data of parking operators and the parking spaces of operators, owned by the party embedding them, a grid connection point by its maintainer. `AddElement`, `RemoveElement`, `ReplaceElement`, `UpdateElementProperty`, `RemoveElementProperty` of all of these, by their element path, as WWCP_POI3 applies them (`elements.ts`): as the change of the property of the entity their path starts with, owned and checked as that change, their old value compared with the element they address; keys and tree hash algorithms changed as a whole only. The properties of infrastructure a change set may change, as WWCP_POI3 names them. Preconditions as WWCP_POI3 checks them (`preconditions.ts`): the ETag an entity still has in the version a change set is applied to, over its representation as the roaming network embeds it, in JSON or CBOR, the entity found by its type and identification as its type compares it. A change is read as the C# implementation reads it, its texts and the segments of its element path, and refused as `Change N: …` in the words of its refusal, the same whether it is read or created; a change set is identified by its changes as the C# implementation writes them again: without the context of a change or of a segment, without an empty element path, its texts trimmed where it reads them trimmed. Stamped as WWCP_POI 12e993a stamps it (S5): the lastChange of the network, of what it changes, adds and embeds, and the created of what it adds without one, are its createdAt, or the lastChange of the version it is applied to where that is later, so that no lastChange goes back; its keys are checked at its createdAt. An old value no longer there is refused naming the value found, as its canonical JSON or `absent`, as the C# implementation names it. A new value not given as the content holds it is refused as the C# implementation refuses it (`TryHeldAsGiven`), after the party it changed is read again, naming what the content holds, or that it holds none. The party a change changed is read again right after the change, as the C# implementation reads it, and refused as `Change N: …` in its words, also where a later change would make it valid again; the groups, offers and payment options of charging station operators, the references and the identifications unique within the network are checked after the last change, as the C# implementation checks them there, in its words and order |
214
+ | Histories (5, 10, 11) | linear histories from snapshots, anchored in the trust anchor as a peer of WWCP_POI starts (10.5): a snapshot of a checkpoint by the checkpoint, signed as the roaming network operator, a snapshot of the head by its attestations, none without a trust anchor unless taken unanchored explicitly; its `effectiveLastChanges` read as WWCP_POI reads them, not taken, as the effective tree takes none (8.1); commits, checkpoints, their lines and signatures, signatures read as WWCP_POI reads them (texts trimmed, none empty), signed ones only with a verifier, checkpoints taken with the signatures that verify here, the others left out (S39), the roles they must be signed in (`requiredSignatureRoles`, `requiredCheckpointSignatureRoles`), a role of a commit only by a key its version lets sign in it (`keyMaySignIn`), the signatures of one key in one role counted once; proofs of commits, archive segments; epochs: their profiles, the final checkpoint, the genesis of the next epoch, its first checkpoint. Merges are not taken yet; no peer, no server |
210
215
  | Price statements (12) | statements, chains, checkpoint trees and proofs in every epoch |
211
216
  | Runtime status (12.5) | status updates, frames of the WebSocket, the runtime status of a snapshot. No WebSocket client: the app brings its own |
212
217
  | QI-Digital documents | a proof of concept of WWCP_POI, as example A14 uses it: digital calibration certificates, digital certificates of conformity of a model or of the quality system of a manufacturer, digital declarations of conformity, read in the words of WWCP_POI and checked against a roaming network (the keys of their issuers, the models, the charging stations and energy meters as they are at runtime) and against each other (a declaration and the certificates it names, a certificate and the meter it covers). Their signature input is what WWCP_POI writes again of what it read, numbers without trailing zeros. Read and checked, not signed |
213
- | EV Taler | phase 1 of WWCP_POI's concept of paying for charging with GNU Taler: the merchant of a charging station operator (`evTaler`), read and refused as WWCP_POI reads it, changed by a key that may sign `payments`; payment options an open set of names, none twice whatever its case; the payment option EVTaler of a charging pool or template only with a merchant; the EV Taler tariff of an EVSE and the exchanges in its currency, from the proof of its station (`evTalerTariffOf`, `evTalerExchangesAt`, `paymentOptionName`). Nothing here takes or makes a payment |
218
+ | EV Taler | phase 1 of WWCP_POI's concept of paying for charging with GNU Taler: the merchant of a charging station operator (`evTaler`), read and refused as WWCP_POI reads it, changed by a key that may sign `payments`; payment options an open set of names, none twice whatever its case; the payment option EVTaler of a charging pool or template only with a merchant, and of a charging pool as it is at runtime only with the authentication mode SecureDynamicQRCode (WWCP_POI 76d3653, decision D8), whose channels `BLE`, `Display` and `NFC` are read as WWCP_POI reads them; the EV Taler tariff of an EVSE and the exchanges in its currency, from the proof of its station (`evTalerTariffOf`, `evTalerExchangesAt`, `paymentOptionName`). Phase 2, as WWCP_POI c2d39e5 checks it (`src/evTaler`): the contract terms of the steps of a session (`EVTalerContractTerms`, version 0), their step in `extra.wwcp` (`EVTalerStep`), a `taler://pay` URI (`EVTalerPayURI`), checked against the proof of the station: the operator's merchant and exchanges, the EV Taler tariff of the EVSE (`evTalerTariff`), the price statement current when the session began, each step following the one before, from step 2 on the signed meter value at the start verified with a measurement key the proof gives by a transparency software passed in (`EVTalerMeterValueVerifier`; WWCP_POI reads no format of a meter), the amount of a step recalculated where the prices are of the simple profile (`EVTalerRates`), as System.Decimal calculates it (`NetDecimal`); the settlement statement (`EVTalerSettlement`), signed by the operator with a key for `payments`, refused without both signed meter values, its price recalculated. Phase 3, as WWCP_POI 62390ca takes it: where drivers ask the operator for offers (`offersURL` of its merchant), and what prices a session as the backend of an operator makes its steps (`evTalerSessionPrices`). Nothing here takes or makes a payment, nor signs a settlement |
219
+ | Web payment page | the URL where an EV driver pays ad hoc, without an e-mobility provider, and starts a session (`webPaymentURL`, WWCP_POI 848cc52), of a charging station operator, a charging pool, a charging station and their templates: read, written and refused as WWCP_POI reads it, taken by the members of a template without their own, changed by a key that may sign `payments`; a pool, a station or a template added with one, a pool by one of its stations as well, by a key that may sign `infrastructure` and `payments`. Not the URL in the dynamic QR code of a station, which is never part of the static data |
214
220
 
215
- Whatever is not ported is refused with a `POIError` saying so, but for the references named above: the library never
216
- takes as checked what it can not check.
221
+ Whatever is not ported is refused with a `POIError` saying so, but for what the row of roaming networks names as not
222
+ yet ported: the library takes no other version the C# implementation refuses.
217
223
  And whatever it calculated otherwise than the C# implementation would end in other ETags or identifications, and be
218
224
  refused as well.
219
225
 
@@ -310,13 +316,22 @@ never edit them here, and its `VendoredCopiesTests` fail when these copies drift
310
316
  - `tests/vectors/poi-*.json`, the golden vectors: canonical JSON and CBOR, Base64 and Base45, the examples of section 6
311
317
  of the specification, station proofs of its example network signed with its keys against a trust anchor, what to
312
318
  calculate of the documents of the run below, documents to refuse, the QI-Digital documents of example A14 of that run
313
- taken and refused as WWCP_POI checks them, and small histories WWCPPOIConformanceTests signs itself, replayed step by
314
- step (the format: the
319
+ taken and refused as WWCP_POI checks them, small histories WWCPPOIConformanceTests signs itself, replayed step by
320
+ step, the amounts of EV Taler (`poi-evtaler.json`: the rates of a charging tariff, what a step and a session cost),
321
+ and the verifier extensions (`poi-verifier.json`) checked against the fixtures of ChargyWebApp below as
322
+ WWCP_POI3 checks them (the format: the
315
323
  [README of the vectors](https://github.com/OpenChargingCloud/WWCPPOIConformanceTests/blob/master/test-vectors/README.md));
316
- - `tests/vectors/csharp-33447ac`, what one run of the C# examples of WWCP_POI at commit `33447ac` published (public data
317
- only; its output is `csharp-output.log` there), and in `proofs/`, what `proofs/MakeProofs.cs.txt` made of the same
318
- history with the C# implementation: proofs of charging stations of epoch 2, the commits of epoch 2 up to the head, and
319
- the ECDSA twin of a price statement.
324
+ - `tests/vectors/csharp-76d3653`, what one run of the C# examples A1 to A16 of WWCP_POI at commit `76d3653` published
325
+ (public data only; its output is `csharp-output.log` there), the EV Taler session of example A16 among it, and in
326
+ `proofs/`, what `proofs/MakeProofs.cs.txt` made of the same history with the C# implementation: proofs of charging
327
+ stations of epoch 2, the commits of epoch 2 up to the head, revision 11 after the EV Taler merchant of example A15 and
328
+ Jena Paradies naming EV Taler with a secure dynamic QR code, and
329
+ the ECDSA twin of a price statement;
330
+ - `tests/vectors/chargy-fc513cd`, the POI fixtures of ChargyWebApp at commit `fc513cd`, which `poi-verifier.json` names
331
+ its documents in: histories, prices, publications, sessions and trust transitions;
332
+ - `tests/vectors/chargy`, what WWCPPOIConformanceTests makes of them itself, which `poi-verifier.json` names with
333
+ `"documents": "chargy"`: in `POIPrices/`, the price evidence of sessions as ChargyWebApp made it, every signature
334
+ deterministic.
320
335
 
321
336
  - `tests/conformance.test.ts`: the golden vectors, as the C# implementation runs them in WWCPPOIConformanceTests.
322
337
  - `tests/canonical.test.ts`, `tests/specification.test.ts`: the test vectors of Styx and of section 6 of the
@@ -331,7 +346,54 @@ never edit them here, and its `VendoredCopiesTests` fail when these copies drift
331
346
  - `tests/qidigital.test.ts`: example A14, the QI-Digital documents of a meter as WWCP_POI signed them, and others signed
332
347
  with the keys of section 6 of the specification, to change them at will.
333
348
  - `tests/chargingStation.test.ts`, `tests/client.test.ts`: proofs of charging stations of epoch 2, as an app checks them.
349
+ - `tests/evTaler.test.ts`: EV Taler, phase 1 (WWCP_POI `ec3dace`): the merchant of a charging station operator and the
350
+ exchanges it accepts, where drivers ask for offers (phase 3, WWCP_POI `62390ca`), the payment option `EVTaler` and the
351
+ secure dynamic QR code it needs (WWCP_POI `76d3653`), keys that may sign `payments`, and the EV Taler tariff of an EVSE
352
+ as an app reads it from the proof of its station.
353
+ - `tests/evTalerSessions.test.ts`: EV Taler, phase 2 (WWCP_POI `c2d39e5`): the steps of a session in their contract
354
+ terms, checked against the station proof of example A15, the settlement statement, amounts as `System.Decimal`
355
+ calculates them, and what prices a session (phase 3, WWCP_POI `62390ca`).
356
+ - `tests/webPaymentURL.test.ts`: the web payment page of a charging station operator, a pool, a station and their
357
+ templates (WWCP_POI `848cc52`), signed by a key that may sign `payments`.
334
358
  - `tests/replay.test.ts`: the whole history of `QA`, both epochs, commit by commit, with every checkpoint.
359
+ - `tests/snapshots.test.ts`: starting from a snapshot of the head or of a checkpoint, anchored in the trust anchor
360
+ alone (10.5), and signatures without a verifier (O3).
361
+ - `tests/epochAlgorithms.test.ts`: the algorithms the first checkpoint of a later epoch takes (11.3).
362
+ - `tests/signatureRoles.test.ts`: the roles a commit is signed in (S24), a checkpoint taken with the signatures that
363
+ verify (S39), how a signature is read, and what a proof gives of a child array (S29).
364
+ - `tests/lastChange.test.ts`: the `lastChange` of everything embedding a changed entity, which never goes back (S5).
365
+ - `tests/reading.test.ts`, `tests/references.test.ts`: `QA`, and `QA` with an entity of every kind
366
+ (`tests/richNetwork.ts`), changed as WWCP_POI3 at 89d2e02 refuses them, in its words.
367
+ - `tests/operator.test.ts`, `tests/partyKeys.test.ts`: the roaming network and its operator, its key statement and the
368
+ certificates of its signing keys, and the keys of the parties (D12), read as WWCP_POI3 reads them.
369
+ - `tests/writtenForm.test.ts`: the content as WWCP_POI writes it; what WWCP_POI3 takes and writes otherwise is refused.
370
+ - `tests/identifications.test.ts`, `tests/releaseIdentifications.test.ts`: identifications unique within the roaming
371
+ network, and releases and certificates identified under their owners (S36).
372
+ - `tests/certificates.test.ts`, `tests/releasesAndBodies.test.ts`: certificates of conformity, a release keeping its
373
+ version (S31), and what a conformity assessment body is notified for (S32).
374
+ - `tests/versionTexts.test.ts`: hardware revisions, firmware versions and serial numbers.
375
+ - `tests/chargingStationMeasurement.test.ts`: a charging station signing measurements itself, and the ISO 15118
376
+ certificate of an EVSE.
377
+ - `tests/measurementPublicKey.test.ts`: measurement public keys and their certificates, as BouncyCastle makes them.
378
+ - `tests/offers.test.ts`: charging tariff offers of one owner, which must not overlap (9.4).
379
+ - `tests/changeSet.test.ts`: change sets identified by their content, and a rebased one naming those it was rebased
380
+ from.
381
+ - `tests/changeReading.test.ts`: a change read as WWCP_POI3 reads it, refused after "Change N: ", and the changes a
382
+ change set is identified by.
383
+ - `tests/newValues.test.ts`, `tests/heldAsGiven.test.ts`, `tests/oldValues.test.ts`: new values given as the content
384
+ holds them, and old values no longer there, refused naming what the content holds.
385
+ - `tests/readAgain.test.ts`: what a change set changes, read again right after each change.
386
+ - `tests/elementChanges.test.ts`, `tests/embeddedChanges.test.ts`: changes of one element by its element path, and of
387
+ the entities a party embeds: charging tariff offers, groups of providers, grid connection points, parking data.
388
+ - `tests/infrastructureChanges.test.ts`: infrastructure named in every spelling its identification type considers
389
+ equal, and who must sign its change.
390
+ - `tests/preconditions.test.ts`: the ETag an entity must still have when a change set is applied.
391
+ - `tests/ownership.test.ts`, `tests/certificateStatedBy.test.ts`: the roaming network operator signing in place of a
392
+ party without signing keys (4.1), and who states a certificate.
393
+ - `tests/trustContext.test.ts`: local authorization and shared trust contexts, as above.
394
+ - `tests/measurementKeys.test.ts`, `tests/historicalMeasurements.test.ts`, `tests/sessionPrices.test.ts`,
395
+ `tests/observedVersions.test.ts`, `tests/trustTransitions.test.ts`, `tests/pricePublication.test.ts`: the APIs of
396
+ 0.2.0 below, in the order of their sections; `tests/sessionPrices.test.ts` also the simple profile of gross rates.
335
397
  - `tests/build/bundle.test.js`, `tests/browser/browser.test.ts`: the bundle and the browser, as above.
336
398
 
337
399
  To check a run of your own of the C# examples, with its new keys:
@@ -408,7 +470,12 @@ generic algorithms (including Ed25519 and ML-DSA), usage/validity, entity/tariff
408
470
  explicit selection. `SessionPriceAgreement` binds the exact original start document SHA-256, meter/EVSE, time, tariff,
409
471
  statement digest, mode and binding/profile in a CPO signature. This is a CPO assertion, not customer consent. Unknown
410
472
  agreements never authorize themselves. The experimental `chargy-gross-rates/v1` profile fixes unconditional gross rates
411
- at start. EMP contracts, variable bindings and unsupported restrictions stay unproven.
473
+ at start: one element without restrictions, of an energy, a flat and a time component each once at most, energy and
474
+ time in a step size of at least one, a flat fee in none, as a FLAT price component has none - of a session paid ad hoc
475
+ (`adhoc`). The profile of contracts, `chargy-contract-gross-rates/v1`, fixes the same rates of a session started
476
+ through an e-mobility provider (`contract`): the price the CPO charges the provider. A charging mode of the other
477
+ profile is not established. What the provider charges its customer, variable bindings and unsupported restrictions stay
478
+ unproven.
412
479
 
413
480
  Checkpoint authority is shared with historical meter verification. Price inclusion, `after` links/continuity, selected
414
481
  statement identity and related checkpoint forks are checked separately. A later checkpoint never proves pre-start
@@ -479,8 +546,10 @@ signature encodings nor changed tariff definitions reuse another original's rece
479
546
 
480
547
  ## Publishing
481
548
 
482
- Version 0.2.0 is prepared locally. Preparation does not publish to npm, create a release tag or change a consumer's
483
- pinned development package. Validate the source and inspect the package before approving a release:
549
+ Version 0.3.0 is available on npm; 0.4.0 is prepared. The commands below are its release procedure. For a later
550
+ release, choose a new version and replace the version, tag and archive names below; published versions are immutable.
551
+ Update package.json, package-lock.json and the release notes, then validate the source and inspect the package before
552
+ approving a release:
484
553
 
485
554
  ```bash
486
555
  npm ci
@@ -491,15 +560,15 @@ npm pack --dry-run
491
560
  npm pack
492
561
  ```
493
562
 
494
- After release approval, replace the prepared-release markers in this README and the changelog with the actual release
495
- status and date, rebuild and check the final archive. Commit the reviewed release files, then tag and push that exact
496
- commit to each configured remote:
563
+ After release approval, finalize this README and the changelog with the actual release status and date, rebuild and
564
+ check the final archive. Commit the reviewed release files, then tag and push that exact commit to each configured
565
+ remote:
497
566
 
498
567
  ```bash
499
- git tag -s v0.2.0 -m "v0.2.0"
500
- git push origin master v0.2.0
501
- git push git1 master v0.2.0
502
- git push git2 master v0.2.0
568
+ git tag -s v0.4.0 -m "v0.4.0"
569
+ git push origin master v0.4.0
570
+ git push git1 master v0.4.0
571
+ git push git2 master v0.4.0
503
572
  ```
504
573
 
505
574
  Publish the inspected archive only after that separate approval:
@@ -507,12 +576,11 @@ Publish the inspected archive only after that separate approval:
507
576
  ```bash
508
577
  npm login
509
578
  npm whoami
510
- npm publish ./open-charging-cloud-wwcp-poi-0.2.0.tgz --access public
579
+ npm publish ./open-charging-cloud-wwcp-poi-0.4.0.tgz --access public
511
580
  ```
512
581
 
513
- After publication, consumers can replace their local POI development archive with
514
- `@open-charging-cloud/wwcp-poi@^0.2.0`, refresh their lockfile and verify a clean install. Their separate ChargyCore
515
- candidate still needs its own release; publishing POI alone does not replace it.
582
+ Consumers read [Migration](CHANGELOG.md#migration) and move to `@open-charging-cloud/wwcp-poi@^0.4.0`, which a range of
583
+ `^0.3.0` does not take, then refresh their lockfile and verify a clean install.
516
584
 
517
585
 
518
586
  ## License
package/dist/common.d.ts CHANGED
@@ -40,4 +40,15 @@ export declare function nonemptyText(object: JSONObject, property: string): stri
40
40
  export declare const timeOf: (at?: number | Date | string) => number;
41
41
  /** The first text of a multilingual text, e.g. `{"en": "Quality Assurance"}`. */
42
42
  export declare function firstText(i18n: JSONValue | undefined): string | undefined;
43
+ /**
44
+ * The given noun phrase with its indefinite article, as it is spoken before its first letter: "An EVSE group", "An
45
+ * e-mobility provider", "An ENERGY price component", "A public key", "A user interface feature". A, E, I and O take
46
+ * "an", every other letter "a" (`POIJSON.WithArticle` of WWCP_POI3).
47
+ */
48
+ export declare const withArticle: (nounPhrase: string, capitalized?: boolean) => string;
49
+ /**
50
+ * A number, to say it in an error: without trailing zeros, e.g. "22000.5", not "22000.50" (`POIJSON.NumberText` of
51
+ * WWCP_POI3).
52
+ */
53
+ export declare function numberText(value: Decimal): string;
43
54
  //# sourceMappingURL=common.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,OAAO,EAAE,MAAwC,mBAAmB,CAAC;AAC9E,OAAO,EAA0B,KAAK,SAAS,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI1G,iFAAiF;AACjF,eAAO,MAAM,cAAc,+CAA+C,CAAC;AAM3E,wBAAgB,aAAa,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,CAIpF;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,CAIlF;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAKzF;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAA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EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAUpF;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAIzF;AAED,qEAAqE;AACrE,wBAAgB,YAAY,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGrF;AAED,mEAAmE;AACnE,eAAO,MAAM,MAAM,GAAI,KAAK,MAAM,GAAG,IAAI,GAAG,MAAM,KAAG,MAIT,CAAC;AAG7C,iFAAiF;AACjF,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAKzE;AAGD;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,YAAY,MAAM,EAAE,qBAAkB,KAAG,MACwC,CAAC;AAG9G;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAGjD"}
@@ -0,0 +1,48 @@
1
+ /** Universal tags. */
2
+ export declare const TAG: {
3
+ readonly boolean: 1;
4
+ readonly integer: 2;
5
+ readonly bitString: 3;
6
+ readonly octetString: 4;
7
+ readonly null: 5;
8
+ readonly objectIdentifier: 6;
9
+ readonly sequence: 16;
10
+ readonly set: 17;
11
+ };
12
+ export declare const CONTEXT = 2;
13
+ /** A record of BER. */
14
+ export interface BER {
15
+ /** Universal 0, application 1, context-specific 2, private 3. */
16
+ readonly tagClass: number;
17
+ readonly tagNumber: number;
18
+ readonly constructed: boolean;
19
+ /** The value of a primitive record, of a string in segments its segments joined. */
20
+ readonly content: Uint8Array;
21
+ readonly children: readonly BER[];
22
+ /** Whether DER writes it and what it holds as given. */
23
+ readonly der: boolean;
24
+ /** The record as given. */
25
+ readonly encoded: Uint8Array;
26
+ }
27
+ export declare class BERError extends Error {
28
+ }
29
+ export declare const isSequence: (record: BER) => boolean;
30
+ export declare const isInteger: (record: BER) => boolean;
31
+ export declare const isNull: (record: BER) => boolean;
32
+ export declare const isOID: (record: BER) => boolean;
33
+ export declare const isBitString: (record: BER) => boolean;
34
+ /** The one record of the given bytes, as `Asn1Object.FromByteArray` reads it: nothing after it. */
35
+ export declare function readBER(bytes: Uint8Array): BER;
36
+ /** The first record of the given bytes, as `Asn1InputStream.ReadObject` reads it from a stream: what follows it left. */
37
+ export declare function readFirstBER(bytes: Uint8Array): BER;
38
+ /** What `GetInstance` of a class throws of a record of another one. */
39
+ export declare const illegal: (record: BER) => BERError;
40
+ /** An integer as `DerInteger` reads it: two's complement in its fewest octets. */
41
+ export declare function integerOf(record: BER): bigint;
42
+ /** An object identifier in dotted decimal, as `DerObjectIdentifier` reads it: each arc in its fewest octets. */
43
+ export declare function oidOf(record: BER): string;
44
+ /** The octets of a bit string, as `DerBitString.GetOctets` gives them: of whole octets. */
45
+ export declare function octetsOf(record: BER): Uint8Array;
46
+ /** The children of a sequence of the given sizes, as a `GetInstance` of a sequence takes them. */
47
+ export declare function sequenceOf(record: BER, sizes: readonly number[]): readonly BER[];
48
+ //# sourceMappingURL=ber.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ber.d.ts","sourceRoot":"","sources":["../../src/crypto/ber.ts"],"names":[],"mappings":"AAuBA,sBAAsB;AACtB,eAAO,MAAM,GAAG;;;;;;;;;CASN,CAAC;AAEX,eAAO,MAAM,OAAO,IAAI,CAAC;AAEzB,uBAAuB;AACvB,MAAM,WAAW,GAAG;IAChB,iEAAiE;IACjE,QAAQ,CAAC,QAAQ,EAAM,MAAM,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAK,MAAM,CAAC;IAC9B,QAAQ,CAAC,WAAW,EAAG,OAAO,CAAC;IAC/B,oFAAoF;IACpF,QAAQ,CAAC,OAAO,EAAO,UAAU,CAAC;IAClC,QAAQ,CAAC,QAAQ,EAAM,SAAS,GAAG,EAAE,CAAC;IACtC,wDAAwD;IACxD,QAAQ,CAAC,GAAG,EAAW,OAAO,CAAC;IAC/B,2BAA2B;IAC3B,QAAQ,CAAC,OAAO,EAAO,UAAU,CAAC;CACrC;AAED,qBAAa,QAAS,SAAQ,KAAK;CAAG;AAKtC,eAAO,MAAM,UAAU,GAAI,QAAQ,GAAG,KAAG,OAA4C,CAAC;AACtF,eAAO,MAAM,SAAS,GAAK,QAAQ,GAAG,KAAG,OAA2C,CAAC;AACrF,eAAO,MAAM,MAAM,GAAQ,QAAQ,GAAG,KAAG,OAAwC,CAAC;AAClF,eAAO,MAAM,KAAK,GAAS,QAAQ,GAAG,KAAG,OAAoD,CAAC;AAC9F,eAAO,MAAM,WAAW,GAAI,QAAQ,GAAG,KAAG,OAA6C,CAAC;AAwLxF,mGAAmG;AACnG,wBAAgB,OAAO,CAAC,KAAK,EAAE,UAAU,GAAG,GAAG,CAY9C;AAED,yHAAyH;AACzH,wBAAgB,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,GAAG,CAOnD;AAuBD,uEAAuE;AACvE,eAAO,MAAM,OAAO,GAAI,QAAQ,GAAG,KAAG,QACsE,CAAC;AAE7G,kFAAkF;AAClF,wBAAgB,SAAS,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,CAgB7C;AAED,gHAAgH;AAChH,wBAAgB,KAAK,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,CAgCzC;AAED,2FAA2F;AAC3F,wBAAgB,QAAQ,CAAC,MAAM,EAAE,GAAG,GAAG,UAAU,CAkBhD;AAED,kGAAkG;AAClG,wBAAgB,UAAU,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,GAAG,EAAE,CAUhF"}
@@ -0,0 +1,21 @@
1
+ import { type BER } from './ber.ts';
2
+ import { type SubjectPublicKeyInfo } from './publicKeys.ts';
3
+ export interface Certificate {
4
+ /** Its content, the TBSCertificate the signature is of. */
5
+ readonly tbs: BER;
6
+ readonly signatureAlgorithm: BER;
7
+ readonly tbsAlgorithm: BER;
8
+ readonly signature: BER;
9
+ readonly subjectPublicKeyInfo: SubjectPublicKeyInfo;
10
+ }
11
+ /** The DER of a certificate, as `ReadCertificate` reads it: undefined where it gives none, as it does of what is no sequence. */
12
+ export declare function certificateOf(bytes: Uint8Array): {
13
+ certificate: Certificate;
14
+ der: boolean;
15
+ } | undefined;
16
+ /**
17
+ * Whether the certificate is issued by the other one, as `X509Certificate.Verify` with the public key of the other one
18
+ * tells: of a key BouncyCastle makes, the signature algorithm the one of the content, the signature verified.
19
+ */
20
+ export declare function issuedBy(certificate: Certificate, issuer: Certificate): boolean;
21
+ //# sourceMappingURL=certificates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"certificates.d.ts","sourceRoot":"","sources":["../../src/crypto/certificates.ts"],"names":[],"mappings":"AAmBA,OAAO,EAA0H,KAAK,GAAG,EAAE,MAAM,UAAU,CAAC;AAE5J,OAAO,EAAuD,KAAK,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAWjH,MAAM,WAAW,WAAW;IACxB,2DAA2D;IAC3D,QAAQ,CAAC,GAAG,EAAmB,GAAG,CAAC;IACnC,QAAQ,CAAC,kBAAkB,EAAI,GAAG,CAAC;IACnC,QAAQ,CAAC,YAAY,EAAU,GAAG,CAAC;IACnC,QAAQ,CAAC,SAAS,EAAa,GAAG,CAAC;IACnC,QAAQ,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;CACvD;AAqFD,iIAAiI;AACjI,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG;IAAE,WAAW,EAAE,WAAW,CAAC;IAAC,GAAG,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,CAgEvG;AA6JD;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAQ/E"}
@@ -0,0 +1,25 @@
1
+ export interface PrimeCurve {
2
+ readonly oid: string;
3
+ readonly name: string;
4
+ /** What BouncyCastle names its field elements, e.g. `SecP256R1FieldElement`, `Fp field element`. */
5
+ readonly field: string;
6
+ readonly bits: number;
7
+ readonly p: bigint;
8
+ readonly a: bigint;
9
+ readonly b: bigint;
10
+ readonly n: bigint;
11
+ readonly h: bigint;
12
+ readonly gx: bigint;
13
+ readonly gy: bigint;
14
+ }
15
+ export interface BinaryCurve {
16
+ readonly oid: string;
17
+ readonly name: string;
18
+ readonly field: string;
19
+ readonly bits: number;
20
+ }
21
+ /** The prime curves by their object identifiers. */
22
+ export declare const PRIME_CURVES: ReadonlyMap<string, PrimeCurve>;
23
+ /** The curves over binary fields by their object identifiers, of which this library tells the lengths of points only. */
24
+ export declare const BINARY_CURVES: ReadonlyMap<string, BinaryCurve>;
25
+ //# sourceMappingURL=curves.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"curves.d.ts","sourceRoot":"","sources":["../../src/crypto/curves.ts"],"names":[],"mappings":"AAwBA,MAAM,WAAW,UAAU;IACvB,QAAQ,CAAC,GAAG,EAAK,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAI,MAAM,CAAC;IACxB,oGAAoG;IACpG,QAAQ,CAAC,KAAK,EAAG,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAI,MAAM,CAAC;IACxB,QAAQ,CAAC,CAAC,EAAO,MAAM,CAAC;IACxB,QAAQ,CAAC,CAAC,EAAO,MAAM,CAAC;IACxB,QAAQ,CAAC,CAAC,EAAO,MAAM,CAAC;IACxB,QAAQ,CAAC,CAAC,EAAO,MAAM,CAAC;IACxB,QAAQ,CAAC,CAAC,EAAO,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,EAAM,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,EAAM,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,WAAW;IACxB,QAAQ,CAAC,GAAG,EAAK,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAI,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAG,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAI,MAAM,CAAC;CAC3B;AA8bD,oDAAoD;AACpD,eAAO,MAAM,YAAY,EAAE,WAAW,CAAC,MAAM,EAAE,UAAU,CACiE,CAAC;AAE3H,yHAAyH;AACzH,eAAO,MAAM,aAAa,EAAE,WAAW,CAAC,MAAM,EAAE,WAAW,CAClB,CAAC"}
@@ -0,0 +1,34 @@
1
+ import type { PrimeCurve } from './curves.ts';
2
+ export declare const mod: (value: bigint, modulus: bigint) => bigint;
3
+ export declare function modPow(base: bigint, exponent: bigint, modulus: bigint): bigint;
4
+ /** The inverse modulo the given modulus; undefined, where there is none. */
5
+ export declare function modInverse(value: bigint, modulus: bigint): bigint | undefined;
6
+ export declare function gcd(a: bigint, b: bigint): bigint;
7
+ export declare const bitLength: (value: bigint) => number;
8
+ export declare const bigintOf: (bytes: Uint8Array) => bigint;
9
+ /** The square root modulo an odd prime (Tonelli and Shanks); undefined, where there is none. */
10
+ export declare function sqrtMod(value: bigint, p: bigint): bigint | undefined;
11
+ /** A point of a curve; undefined is the point at infinity. */
12
+ export interface Point {
13
+ readonly x: bigint;
14
+ readonly y: bigint;
15
+ }
16
+ /** k·P. */
17
+ export declare const multiply: (curve: PrimeCurve, point: Point, k: bigint) => Point | undefined;
18
+ export declare const onCurve: (curve: PrimeCurve, { x, y }: Point) => boolean;
19
+ /** Whether a point is of the order of the curve, of a curve of a cofactor 1 always (`SatisfiesOrder`). */
20
+ export declare const satisfiesOrder: (curve: PrimeCurve, point: Point) => boolean;
21
+ export declare class PointError extends Error {
22
+ }
23
+ /**
24
+ * A point of a prime curve as `ECCurve.DecodePoint` of BouncyCastle decodes it, compressed (02, 03), uncompressed (04) or
25
+ * hybrid (06, 07), and refuses it in its words; undefined for the point at infinity (00).
26
+ */
27
+ export declare function decodePoint(curve: PrimeCurve, encoded: Uint8Array): Point | undefined;
28
+ /** The leftmost bits of a digest as wide as the order, as `CalculateE` of ECDsaSigner and DsaSigner takes them. */
29
+ export declare function truncatedDigest(order: bigint, digest: Uint8Array): bigint;
30
+ /** Whether (r, s) is a signature of the digest by the key Q of the curve (`ECDsaSigner.VerifySignature`). */
31
+ export declare function verifyECDSA(curve: PrimeCurve, q: Point, digest: Uint8Array, r: bigint, s: bigint): boolean;
32
+ /** Whether (r, s) is a signature of the digest by the key y of the group (p, q, g) (`DsaSigner.VerifySignature`). */
33
+ export declare function verifyDSA(p: bigint, q: bigint, g: bigint, y: bigint, digest: Uint8Array, r: bigint, s: bigint): boolean;
34
+ //# sourceMappingURL=ecc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ecc.d.ts","sourceRoot":"","sources":["../../src/crypto/ecc.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAQ9C,eAAO,MAAM,GAAG,GAAI,OAAO,MAAM,EAAE,SAAS,MAAM,KAAG,MAGpD,CAAC;AAEF,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAU9E;AAED,4EAA4E;AAC5E,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAQ7E;AAED,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAMhD;AAED,eAAO,MAAM,SAAS,GAAI,OAAO,MAAM,KAAG,MACI,CAAC;AAE/C,eAAO,MAAM,QAAQ,GAAI,OAAO,UAAU,KAAG,MACY,CAAC;AAE1D,gGAAgG;AAChG,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAuCpE;AAMD,8DAA8D;AAC9D,MAAM,WAAW,KAAK;IAClB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;CACtB;AA6ED,WAAW;AACX,eAAO,MAAM,QAAQ,GAAI,OAAO,UAAU,EAAE,OAAO,KAAK,EAAE,GAAG,MAAM,KAAG,KAAK,GAAG,SAC5B,CAAC;AAEnD,eAAO,MAAM,OAAO,GAAI,OAAO,UAAU,EAAE,UAAU,KAAK,KAAG,OACO,CAAC;AAErE,0GAA0G;AAC1G,eAAO,MAAM,cAAc,GAAI,OAAO,UAAU,EAAE,OAAO,KAAK,KAAG,OACE,CAAC;AAEpE,qBAAa,UAAW,SAAQ,KAAK;CAAG;AAExC;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,GAAG,KAAK,GAAG,SAAS,CA2DrF;AAED,mHAAmH;AACnH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,MAAM,CAKzE;AAED,6GAA6G;AAC7G,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAiB1G;AAED,qHAAqH;AACrH,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAcvH"}
@@ -0,0 +1,51 @@
1
+ import { type BER } from './ber.ts';
2
+ import { type PrimeCurve } from './curves.ts';
3
+ import { type Point } from './ecc.ts';
4
+ export type PublicKey = {
5
+ readonly kind: 'ec';
6
+ readonly curve: PrimeCurve;
7
+ readonly q: Point;
8
+ } | {
9
+ readonly kind: 'rsa';
10
+ readonly n: bigint;
11
+ readonly e: bigint;
12
+ } | {
13
+ readonly kind: 'dsa';
14
+ readonly y: bigint;
15
+ readonly group: {
16
+ readonly p: bigint;
17
+ readonly q: bigint;
18
+ readonly g: bigint;
19
+ } | undefined;
20
+ } | {
21
+ readonly kind: 'eddsa';
22
+ readonly curve: 'Ed25519' | 'Ed448';
23
+ readonly bytes: Uint8Array;
24
+ } | {
25
+ readonly kind: 'ml-dsa';
26
+ readonly set: 'ML-DSA-44' | 'ML-DSA-65' | 'ML-DSA-87';
27
+ readonly bytes: Uint8Array;
28
+ } | {
29
+ readonly kind: 'other';
30
+ readonly oid: string;
31
+ };
32
+ /** What BouncyCastle refuses of a key it makes, in its words. */
33
+ export declare class KeyError extends Error {
34
+ }
35
+ /** A SubjectPublicKeyInfo as `SubjectPublicKeyInfo.GetInstance` reads it. */
36
+ export interface SubjectPublicKeyInfo {
37
+ readonly record: BER;
38
+ readonly algorithm: string;
39
+ readonly parameters: BER | undefined;
40
+ readonly key: BER;
41
+ }
42
+ /** The SubjectPublicKeyInfo of the given record: a sequence of an algorithm identifier and a bit string. */
43
+ export declare function subjectPublicKeyInfoOf(record: BER): SubjectPublicKeyInfo;
44
+ /** The SubjectPublicKeyInfo of the given bytes, as `Asn1Object.FromByteArray` reads them: one record of BER, nothing after it. */
45
+ export declare const subjectPublicKeyInfo: (bytes: Uint8Array) => SubjectPublicKeyInfo;
46
+ /**
47
+ * The key of the given SubjectPublicKeyInfo, as `PublicKeyFactory.CreateKey` of BouncyCastle makes it; what it refuses
48
+ * thrown as a `KeyError` or a `BERError` in its words.
49
+ */
50
+ export declare function publicKeyOf(info: SubjectPublicKeyInfo): PublicKey;
51
+ //# sourceMappingURL=publicKeys.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publicKeys.d.ts","sourceRoot":"","sources":["../../src/crypto/publicKeys.ts"],"names":[],"mappings":"AAiBA,OAAO,EAA6F,KAAK,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/H,OAAO,EAA+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,MAAM,EAAO,GAAG,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAI,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAG,GAAG,GAAG,SAAS,CAAC;IACtC,QAAQ,CAAC,GAAG,EAAU,GAAG,CAAC;CAC7B;AAED,4GAA4G;AAC5G,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,GAAG,GAAG,oBAAoB,CAUxE;AAED,kIAAkI;AAClI,eAAO,MAAM,oBAAoB,GAAI,OAAO,UAAU,KAAG,oBACf,CAAC;AAsK3C;;;GAGG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,oBAAoB,GAAG,SAAS,CA0DjE"}
@@ -0,0 +1,30 @@
1
+ /** A digest by the object identifier of its algorithm. */
2
+ export interface Digest {
3
+ readonly oid: string;
4
+ readonly size: number;
5
+ readonly digest: (data: Uint8Array) => Uint8Array;
6
+ }
7
+ export declare const DIGESTS: {
8
+ readonly md5: Digest;
9
+ readonly sha1: Digest;
10
+ readonly sha224: Digest;
11
+ readonly sha256: Digest;
12
+ readonly sha384: Digest;
13
+ readonly sha512: Digest;
14
+ readonly sha512_224: Digest;
15
+ readonly sha512_256: Digest;
16
+ readonly sha3_224: Digest;
17
+ readonly sha3_256: Digest;
18
+ readonly sha3_384: Digest;
19
+ readonly sha3_512: Digest;
20
+ };
21
+ export declare const digestByOid: (oid: string) => Digest | undefined;
22
+ /** Whether an odd integer above 3 is probably prime, by rounds of Miller and Rabin with random bases. */
23
+ export declare function isProbablePrime(candidate: bigint, rounds?: number): boolean;
24
+ /** The error, when RsaKeyParameters of BouncyCastle refuses a public key, in its words and order; undefined for none. */
25
+ export declare function rsaKeyError(modulus: bigint, exponent: bigint): string | undefined;
26
+ /** Whether the signature of PKCS #1 v1.5 is of the message, its DigestInfo with NULL parameters or without (`RsaDigestSigner`). */
27
+ export declare function verifyPKCS1(modulus: bigint, exponent: bigint, algorithm: Digest, message: Uint8Array, signature: Uint8Array): boolean;
28
+ /** Whether the signature of PSS is of the message, with its digest, the digest of its mask and its salt length (`PssSigner`). */
29
+ export declare function verifyPSS(modulus: bigint, exponent: bigint, algorithm: Digest, maskDigest: Digest, saltLength: number, message: Uint8Array, signature: Uint8Array): boolean;
30
+ //# sourceMappingURL=rsa.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rsa.d.ts","sourceRoot":"","sources":["../../src/crypto/rsa.ts"],"names":[],"mappings":"AA4BA,0DAA0D;AAC1D,MAAM,WAAW,MAAM;IACnB,QAAQ,CAAC,GAAG,EAAK,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAI,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,UAAU,CAAC;CACrD;AAKD,eAAO,MAAM,OAAO;;;;;;;;;;;;;CAaV,CAAC;AAEX,eAAO,MAAM,WAAW,GAAI,KAAK,MAAM,KAAG,MAAM,GAAG,SACgB,CAAC;AA8BpE,yGAAyG;AACzG,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,SAAK,GAAG,OAAO,CAuBvE;AAED,yHAAyH;AACzH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CA6BjF;AAyCD,mIAAmI;AACnI,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,GAAG,OAAO,CAmBrI;AAaD,iIAAiI;AACjI,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,GAAG,OAAO,CAsC3K"}
@@ -11,6 +11,15 @@ export declare function toBase64(bytes: Uint8Array): string;
11
11
  * padding and nonzero padding bits, as POI requires of keys and signature values (SPECIFICATION.md section 4).
12
12
  */
13
13
  export declare function fromBase64(text: string): Uint8Array;
14
+ /** What `Convert.FromBase64String` of .NET says of a text it can not read. */
15
+ export declare const DOTNET_BAD_BASE64 = "The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.";
16
+ /**
17
+ * Whether `Convert.FromBase64String` of .NET reads the given text, though perhaps not canonically: white space left out
18
+ * anywhere, groups of four characters of the alphabet, at most two padding characters at the end, unused bits of any value.
19
+ */
20
+ export declare const isDotNetBase64: (text: string) => boolean;
21
+ /** Whether the given text is nonempty canonical Base64: what `Convert.ToBase64String` writes again of what it reads. */
22
+ export declare const isCanonicalBase64: (text: string) => boolean;
14
23
  /** Base45 [RFC 9285], the encoding of the QR code of a trust anchor. */
15
24
  export declare function toBase45(bytes: Uint8Array): string;
16
25
  /** Reads Base45 [RFC 9285], refusing characters outside its alphabet and triples above 65535. */
@@ -1 +1 @@
1
- {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../src/encoding/text.ts"],"names":[],"mappings":"AAyBA,+EAA+E;AAC/E,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAK/C;AAED,2GAA2G;AAC3G,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,UAAQ,GAAG,UAAU,CAYnE;AAED,sFAAsF;AACtF,eAAO,MAAM,UAAU,GAAI,MAAM,OAAO,EAAE,QAAQ,MAAM,KAAG,IAAI,IAAI,MAIb,CAAC;AAevD,oCAAoC;AACpC,wBAAgB,QAAQ,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAmBlD;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAoCnD;AAMD,wEAAwE;AACxE,wBAAgB,QAAQ,CAAC,KAAK,EAAE,UAAU,GAAG,MAA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