@certcrypt/sdk 0.0.0-stage → 1.0.1

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 (71) hide show
  1. package/CHANGELOG.md +74 -0
  2. package/LICENSE +178 -0
  3. package/README.md +557 -2
  4. package/SECURITY.md +55 -0
  5. package/dist/src/artifacts/base-certificate.d.ts +336 -0
  6. package/dist/src/artifacts/base-certificate.js +373 -0
  7. package/dist/src/artifacts/base-certificate.js.map +1 -0
  8. package/dist/src/artifacts/capacity-evidence.d.ts +195 -0
  9. package/dist/src/artifacts/capacity-evidence.js +202 -0
  10. package/dist/src/artifacts/capacity-evidence.js.map +1 -0
  11. package/dist/src/artifacts/commitment-inclusion.d.ts +23 -0
  12. package/dist/src/artifacts/commitment-inclusion.js +91 -0
  13. package/dist/src/artifacts/commitment-inclusion.js.map +1 -0
  14. package/dist/src/artifacts/holder-keyset.d.ts +67 -0
  15. package/dist/src/artifacts/holder-keyset.js +149 -0
  16. package/dist/src/artifacts/holder-keyset.js.map +1 -0
  17. package/dist/src/artifacts/rfc3339.d.ts +9 -0
  18. package/dist/src/artifacts/rfc3339.js +39 -0
  19. package/dist/src/artifacts/rfc3339.js.map +1 -0
  20. package/dist/src/client.d.ts +552 -0
  21. package/dist/src/client.js +1347 -0
  22. package/dist/src/client.js.map +1 -0
  23. package/dist/src/crypto/ai-decision.d.ts +73 -0
  24. package/dist/src/crypto/ai-decision.js +94 -0
  25. package/dist/src/crypto/ai-decision.js.map +1 -0
  26. package/dist/src/crypto/canonical-subject.d.ts +33 -0
  27. package/dist/src/crypto/canonical-subject.js +240 -0
  28. package/dist/src/crypto/canonical-subject.js.map +1 -0
  29. package/dist/src/crypto/collection-merkle.d.ts +58 -0
  30. package/dist/src/crypto/collection-merkle.js +164 -0
  31. package/dist/src/crypto/collection-merkle.js.map +1 -0
  32. package/dist/src/crypto/composite.d.ts +53 -0
  33. package/dist/src/crypto/composite.js +69 -0
  34. package/dist/src/crypto/composite.js.map +1 -0
  35. package/dist/src/crypto/digest.d.ts +3 -0
  36. package/dist/src/crypto/digest.js +31 -0
  37. package/dist/src/crypto/digest.js.map +1 -0
  38. package/dist/src/crypto/ecdsa-p256.d.ts +79 -0
  39. package/dist/src/crypto/ecdsa-p256.js +277 -0
  40. package/dist/src/crypto/ecdsa-p256.js.map +1 -0
  41. package/dist/src/crypto/jcs.d.ts +13 -0
  42. package/dist/src/crypto/jcs.js +65 -0
  43. package/dist/src/crypto/jcs.js.map +1 -0
  44. package/dist/src/crypto/merkle.d.ts +18 -0
  45. package/dist/src/crypto/merkle.js +150 -0
  46. package/dist/src/crypto/merkle.js.map +1 -0
  47. package/dist/src/crypto/ml-dsa.d.ts +28 -0
  48. package/dist/src/crypto/ml-dsa.js +60 -0
  49. package/dist/src/crypto/ml-dsa.js.map +1 -0
  50. package/dist/src/crypto/pseudonym.d.ts +8 -0
  51. package/dist/src/crypto/pseudonym.js +50 -0
  52. package/dist/src/crypto/pseudonym.js.map +1 -0
  53. package/dist/src/crypto/strict-json.d.ts +25 -0
  54. package/dist/src/crypto/strict-json.js +180 -0
  55. package/dist/src/crypto/strict-json.js.map +1 -0
  56. package/dist/src/crypto/subject-json-preconditions.d.ts +46 -0
  57. package/dist/src/crypto/subject-json-preconditions.js +381 -0
  58. package/dist/src/crypto/subject-json-preconditions.js.map +1 -0
  59. package/dist/src/index.d.ts +18 -0
  60. package/dist/src/index.js +80 -0
  61. package/dist/src/index.js.map +1 -0
  62. package/dist/src/issuer.d.ts +668 -0
  63. package/dist/src/issuer.js +1066 -0
  64. package/dist/src/issuer.js.map +1 -0
  65. package/dist/src/retry.d.ts +67 -0
  66. package/dist/src/retry.js +78 -0
  67. package/dist/src/retry.js.map +1 -0
  68. package/dist/src/types.d.ts +297 -0
  69. package/dist/src/types.js +15 -0
  70. package/dist/src/types.js.map +1 -0
  71. package/package.json +62 -4
package/CHANGELOG.md ADDED
@@ -0,0 +1,74 @@
1
+ # CHANGELOG
2
+
3
+ This package follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
4
+
5
+ Entries are one line per change: `type:scope: what changed`, where `type` is
6
+ `feature`, `bugfix`, `breaking`, `deprecation`, `security` or `docs`.
7
+
8
+ ## 1.0.1
9
+
10
+ * bugfix:Tests: `npm test` lists the compiled tests and passes them to the Node.js test runner by name (`scripts/run-tests.mjs`), so the suite runs on Node.js 20, the floor declared in `engines`, as on later versions
11
+
12
+ ## 1.0.0
13
+
14
+ * feature:Settlement: `VerificationPackage` has the closed member set of verification-package/1 — `base_certificate` and `verification_context` always present — which is what an offline verifier in package mode accepts
15
+ * feature:Consistency: `assembleContextSnapshotCertificate` mints a CCVP/1 context snapshot certificate (`payload.snapshot` plus one `subject.context-snapshot/1` subject committing to it, shape and profile preconditions checked before signing); `assembleBaseCertificate` takes an optional `context` (the snapshot issuer by `signer.id` and composite key fingerprint, and the `context_set_id`); `issuerKeyFingerprintHex` gives that fingerprint. Held to the `ccvp-consistency` vectors and, end to end, to the verifier toolkit's `verifyConsistency`
16
+ * security:Issuance: `subject.ai-decision/1` accepts one bounded decision record with a canonical decision id, one declared model, an explicit client/runtime observation boundary, real UTC millisecond timestamps, and ordered multimodal input/output parts; every part has a globally unique id and nonce, a lowercase MIME essence, an admitted profile and a salted CCCP commitment, while parameters and context remain bounded flat string maps
17
+ * feature:Issuance: `buildAiDecisionSubject` generates independent part nonces, computes profile-aware commitments, validates the complete decision record and returns the subject plus private opening material; `buildAiDecisionPart` provides the same operation for one part
18
+ * security:Issuance: the material of the JSON subject profiles (`subject.collection/1`, `subject.ai-decision/1`, `subject.context-snapshot/1`) is parsed strictly: a member name repeated in any object, at any depth and after escape decoding, refuses the subject before it is canonicalized, so no certificate commits to material that two readers would read differently. Held to the new conformance family `strict-json`
19
+ * security:Node authentication: the issuer proof signs `certcrypt:issuer-auth:1|<challenge>|<host>|<METHOD> <path?query>|<sha3-256 of the body>` (`issuerAuthMessage`), so a copy is good only for repeating that very request. `NodeClientOptions.issuerAuthProof` receives the request (`IssuerAuthRequest`: method, url, body)
20
+ * feature:Retries: every attempt of a read carries a newly minted issuer proof, because the node refuses a challenge it has already accepted; a retry of a read that reached the node is therefore never refused as a replay
21
+ * feature:Cryptography: the ECDSA P-256 component is RFC 6979 deterministic — SHA3-256 prehash, nonce from HMAC-SHA3-256, low-s, raw `r||s` — so the same key over the same message always yields the same signature. Computed with `@noble/curves` 2.2.0 (with `@noble/hashes` 2.2.0, both pinned exactly), because `node:crypto`'s `sign` draws a random nonce. Held to the new conformance family `ecdsa-p256-deterministic`. The ML-DSA-65 component stays hedged
22
+ * security:Issuance: the issuer's signing key depends on the seed alone — P-256 from `SHA3-256(seed || "issuer-cert-key/p256")`, ML-DSA-65 from `SHA3-256(seed || "issuer-cert-key/mldsa")`; `issuerKeyId` is a label that never changes the key, and its default is `"issuer:" + keysetRoot[0:32]`. Held to the new conformance family `issuer-key-derivation`
23
+ * security:Exports: no single-component signing primitive is exported (no standalone ML-DSA-65 or ECDSA P-256 key generation, signing or key conversion): a caller cannot produce a signature without its post-quantum half
24
+ * feature:Exports: `deriveIssuerKey`, `computeExpiresAt`, `resolveCollectionSubjects`, `buildCollection`, the digest helpers (`digestBytes`, `digestHexBytes`, `digestHexText`), the JCS helpers (`jcsCanonicalizeBytes`, `jcsCanonicalizeString`), `SUBJECT_CONTEXT_SNAPSHOT`, and the types `SettlementPreferences`, `CollectionLeafInput`, `BuiltCollection`, `ResolvedCollection` and `MemberResult`
25
+ * feature:Issuance: a `poolId` learned at activation reaches the commitment, so an issuer configured without `poolId` can issue. `mintVerifiableCertificate()` takes an optional `poolId` and refuses one that differs from the client's own
26
+ * security:Issuance: `mode: "unlinkable"` without a `leafStore` is refused at construction: an in-memory store would restart at zero and reuse every leaf
27
+ * feature:Issuance: `commitmentTtlSeconds` must be a positive whole number of seconds, checked at construction
28
+ * feature:Issuance: `resolveEmission()` reports every terminal state other than `independent_ready` and `expired` as `rejected` — `insufficient_capacity`, `replay_detected`, `pre_evaluation_rejected` and `submission_failed` included — so no terminal state resolves as `pending`. The same holds on the by-commitment fallback
29
+ * feature:Issuance: `resolveEmission()`'s `verificationContext` is optional and defaults to the instance's `rulesVersion` and `systemId`
30
+ * feature:Recovery: `listUnresolvedEmissions()` activates first, so a process that never emitted sends a signed read
31
+ * feature:Node client: `health()` returns `false` on a transport failure rather than throwing, and gives up after 30 seconds
32
+ * feature:Node client: every request (submit, activate, reads, health, redrive) is bounded at 30 seconds (`REQUEST_TIMEOUT_MS`), and every read (`getOperation`, `getEmissionByCommitment`, `listUnresolvedEmissions`, `listDeadLetters`) is retried under the `transport-retry` policy and the `retry` options, as a submit is
33
+ * feature:Node client: a 2xx submit whose body is not a JSON object is a transport failure, retried with the same `request_id` (`issue failed: unparseable node response`)
34
+ * feature:Node client: an activation refusal names the node's code and message (`activate failed: HTTP 409 — integration_key_replaced: …`) and carries `retryAfterMs`
35
+ * feature:Settlement: `waitForOperation()` runs on the client's clock (`clock`), one request per poll; an exception thrown by `onProgress` is swallowed, and a sleep of ten seconds or more, or an overdue window, is announced with `console.info` when no `onProgress` is given
36
+ * docs:Issuance: `prepare()` checks, in order: activation, pool, holder, root fingerprint, system id, subjects, subject profiles, then TTL. An optional value falls back only when absent: an explicit `0` or empty string is used as given
37
+ * security:Activation: an activation answer is read fail-closed, in order: not a JSON object (`activate returned no JSON object`), a required field absent or empty (`activate returned no …`), a field of the wrong type — `level1_binding` not an object, `level1_signature` not a composite signature, `holder_id`/`pool_id` not strings (`activate returned a malformed …`), or a `status` other than `redeemed`/`already_consumed_same_root` (`activate returned an unrecognized status`). Each throws `CertcryptNodeError` with no HTTP status, and nothing is cached or persisted. `CertcryptNodeClient.activate()` returns the new `ActivationResult` type.
38
+ * security:Activation: a `POST /v1/activate` answer that is not a JSON object, or lacks `level1_binding`, `level1_signature`, `holder_id` or `pool_id`, throws `CertcryptNodeError` (`activate returned no …`) and nothing is cached or persisted, so no binding is left with undefined halves or an undefined `holderId`
39
+ * feature:Issuance: `Certcrypt.issue()` — the single issuance surface: derives the signing key from your seed, canonicalizes each subject byte-identically to the verifier, computes the commitment, mints the signed `base_certificate` and submits the issuance, returning the certificate and an operation identifier
40
+ * feature:Issuance: The `Proof of Independence` does not exist at issuance time — it is obtained later, once the operation settles
41
+ * feature:Issuance: No opaque-digest mode — a certificate always commits to real content, so a third party can bind the proof to those exact bytes
42
+ * feature:Issuance: Multi-subject certificates under one signature; order is significant and `subjects[0]` is the primary face
43
+ * feature:Issuance: Six subject profiles — `subject.binary/1`, `subject.text/1` (line endings normalized to CRLF), `subject.email/1` (RFC 5322 header-unfolded), `subject.collection/1` and `subject.ai-decision/1` (canonicalized by value under RFC 8785 after a string-only precondition, so key order stops mattering), and `subject.context-snapshot/1` (canonicalized by value after its no-JSON-number precondition)
44
+ * feature:Issuance: `issue()` always emits `independent-capable`, which requires the participation reference — the omission cannot be repaired after issuance, so it is not a per-call choice. `issued-only` is reachable through `nodeClient()` for a caller that deliberately wants it
45
+ * feature:`EmissionHandle`: A serializable operation handle — persist it and `resolveEmission()` finishes the job after a restart or in another process, without re-emitting; exactly one node operation per certificate
46
+ * feature:Cryptography: Composite PQ/T signatures under the CERTCRYPT Composite Signature Profile — ECDSA-P-256-SHA3-256 (classical, first; order is load-bearing) AND ML-DSA-65 (FIPS 204), each over the same domain-separated message, valid only if all components verify
47
+ * feature:Cryptography: The signing key never leaves the process — derived deterministically from the 32-byte seed, domain-separated from the operation-key tree; a KMS-backed key can be injected instead
48
+ * feature:Zero-data: `capacity.evidence/1` projects stable identifiers to operation-scoped pseudonyms, and only the projected commitment is signed
49
+ * feature:Node auth: Zero-trust authentication — a different axis from `zero-data`, which is about content. Each request carries a self-verifying proof the node checks offline with no token lookup, built from the Level-1 binding, a leaf disclosure and a possession signature over a fresh challenge
50
+ * feature:Node auth: Reads sign the exact resource being read, so scope derives from who signed rather than from whoever transported the request
51
+ * feature:Node auth: The node is a transport. The SDK activates and submits through it and asks it for nothing else — no identity proof, no pinned key. A node that is not recognized gets nothing admitted, and one that misbehaves can delay or drop a submission but never forge or alter what is signed: the certificate is signed here, and the `Proof of Independence` that comes back is signed by the CERTCRYPT System Domain, which any verifier checks offline with the verifier toolkit
52
+ * feature:Node client: Submission sets bounded at 64 members (`MAX_SUBMISSION_SET_MEMBERS`). `Certcrypt.submit()` and `CertcryptNodeClient.issue()` / `issueCommitments()` refuse more than 64 commitments with `SubmissionSetTooLargeError` before anything is sent; `assertSubmissionSetWithinBound()` is exported for a caller that groups commitments itself. A fail-fast guard, not a security boundary: the node and the submit endpoint reject an over-cardinality set fail-closed regardless
53
+ * feature:Node client: Idempotent retries with exponential backoff and full jitter, reusing the same ULID request id, so a retry never re-signs and never double-submits; terminal verdicts fail fast
54
+ * feature:Node client: Retries follow the `transport-retry` policy — a node's `Retry-After` (a restart, an outbox it cannot write) is waited out exactly, clamped to 1 s – 15 min, and never counted as an attempt; retrying ends on a time budget (`retry.maxElapsedMs`, default 120 s) with no attempt limit unless `retry.maxAttempts` is set; a 4xx other than 408/425/429 is returned at once instead of retried. `CertcryptNodeError.retryAfterMs` carries the node's requested wait when the client gives up
55
+ * feature:Node client: `pre_evaluation_rejected` is final and not retried — the node sends it with HTTP 200 and the same set always gets the same answer
56
+ * feature:Node client: `listDeadLetters()` and `redriveDeadLetter(requestId)` — the submissions the node stopped retrying (a refusal about the request or its credentials, never an outage) and how to put one back once the cause is fixed; the same signed set is resent, nothing re-signed
57
+ * feature:Node client: A member the node delivered late (`accepted_for_retry` at submit) keeps the operation id it was given; the first read that reveals its upstream id hands it to the issuer, so later reads sign the id the server routes on
58
+ * feature:Node client: Activation is invisible — the first `issue()` activates on the way past, `activate()` exists for when the deploy and the first certificate are far apart, and a cold restart needs nothing persisted
59
+ * feature:Settlement: `pending` is the normal state of a fresh emission — settlement batches many operations into one window, so the handle is a durable reference to the operation precisely so you need not block on it
60
+ * feature:Settlement: `pending.settlementWindow` surfaces the node's expected window (`window_profile`, `window_profile_version`, `target_close_by`, `expected_settled_by`) plus `overdue`, so an issuer can tell "settling normally" from "the settlement layer is stuck"
61
+ * feature:Settlement: `SettlementWindowEstimate.expected_settled_by` (and `UnresolvedEmission.expectedSettledBy`) carry the operator's estimate of when the window's settlement is anchored and final — never earlier than `target_close_by`, present exactly when it is, operational only. The wait checks twice before `overdue`: 60 % of the way from `target_close_by` to that instant, then at that instant plus one second, each pushed back by a random 0–1 s so the operations of one window do not ask at once; `overdue` (on `WaitProgress` and on a `pending` resolution) is true only once it has passed; the progress message names the expected instant, and an overdue one says settlement is past the operator's expected instant. Without it, the wait sleeps until `target_close_by` plus three seconds and `overdue` follows `target_close_by`
62
+ * feature:Settlement: The wait schedules on that estimate instead of polling — sleeps until the expected settlement instant (or, without one, the window's close) and checks once on arrival, falling back to capped exponential backoff with no estimate. `maxWaitMs` bounds the wait by wall clock; `intervalMs`/`maxAttempts` select fixed-interval polling
63
+ * feature:Settlement: `WaitProgress` distinguishes `queued` from `finality_pending` — waiting BEHIND a window and waiting ON the chain are different waits, and only the first one a window schedule can shorten. Once settlement is on the substrate what remains is its irreversibility, so a message blaming the window there points at the wrong place
64
+ * feature:Settlement: `onProgress` reports each tick with a ready-to-log `message`, and the SDK announces a sleep of ten seconds or more on the console rather than going quiet — a multi-minute sleep is indistinguishable from a hang
65
+ * feature:Settlement: The window carries scheduling information and nothing else — no amount, no capacity figure, no receipt line, no billing multiplier. An operation cost in the clear would let an issuer's operations be correlated over time, and once such a value travels in a response it lands in logs and billing records
66
+ * feature:Settlement: Window profile names are versioned values of the rules domain, published in its public rules; schedule on `expected_settled_by` (or `target_close_by`) and pin nothing to `window_profile`
67
+ * feature:Verification: `resolveEmission()` assembles the full `verification-package/1` from the handle, deriving the commitment inclusion proof locally with the same Merkle primitive a verifier recomputes
68
+ * feature:Verification: This SDK produces and assembles, it does NOT verify — it checks no signature on the artifacts it receives back, which is the verifier toolkit's job and a separate always-required step
69
+ * feature:Byte contracts: Parity pinned by the published conformance vectors, with the traps documented where they bite — hex strings concatenated as ASCII and never decoded, ML-DSA signing with an empty context and no pre-hash, RFC 3339 without fractional seconds, and leaf preimages in insertion order rather than JCS
70
+ * feature:Byte contracts: The system domain is a parameter, never a constant — every artifact takes its `system_id` from the signed evidence it was authorized under, and the two projections must agree before a submission set is assembled
71
+ * feature:Errors: An unsupported subject profile fails closed (`UnsupportedProfileError`) and the JSON-object profiles enforce their preconditions before canonicalizing (`SubjectPreconditionError`); neither ever falls back to another profile, and both types are exported so a caller can tell malformed input from transport failure without matching message text
72
+ * feature:Types: `SettlementWindowEstimate`, `SettlementProgress`, `WaitProgress`, `CommitmentInclusionProof`, `EmissionHandle` and `EmissionResolution` are exported, so a typed integration never needs `any` to describe something this SDK returns — including the nested `WaitProgress.settlement`, whose type is exported for the same reason as the object carrying it
73
+ * feature:Conformance: Byte parity against the published vectors, and SDK-minted certificates round-tripped through `certcrypt-verifier-toolkit-js` with every signature verified; both need sibling checkouts and fail with a message naming what to check out when one is absent (`CERTCRYPT_ALLOW_MISSING_CONFORMANCE=1` turns those failures back into skips)
74
+ * feature:Packaging: Requires Node.js 20 or newer. Server-side only — the issuer seed must never reach a browser bundle
package/LICENSE ADDED
@@ -0,0 +1,178 @@
1
+ Copyright 2025-2026 CERTCRYPT, Inc., its affiliates or licensors. All rights reserved.
2
+
3
+ Apache License
4
+ Version 2.0, January 2004
5
+ http://www.apache.org/licenses/
6
+
7
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
8
+
9
+ 1. Definitions.
10
+
11
+ "License" shall mean the terms and conditions for use, reproduction,
12
+ and distribution as defined by Sections 1 through 9 of this document.
13
+
14
+ "Licensor" shall mean the copyright owner or entity authorized by
15
+ the copyright owner that is granting the License.
16
+
17
+ "Legal Entity" shall mean the union of the acting entity and all
18
+ other entities that control, are controlled by, or are under common
19
+ control with that entity. For the purposes of this definition,
20
+ "control" means (i) the power, direct or indirect, to cause the
21
+ direction or management of such entity, whether by contract or
22
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
23
+ outstanding shares, or (iii) beneficial ownership of such entity.
24
+
25
+ "You" (or "Your") shall mean an individual or Legal Entity
26
+ exercising permissions granted by this License.
27
+
28
+ "Source" form shall mean the preferred form for making modifications,
29
+ including but not limited to software source code, documentation
30
+ source, and configuration files.
31
+
32
+ "Object" form shall mean any form resulting from mechanical
33
+ transformation or translation of a Source form, including but
34
+ not limited to compiled object code, generated documentation,
35
+ and conversions to other media types.
36
+
37
+ "Work" shall mean the work of authorship, whether in Source or
38
+ Object form, made available under the License, as indicated by a
39
+ copyright notice that is included in or attached to the work
40
+ (an example is provided in the Appendix below).
41
+
42
+ "Derivative Works" shall mean any work, whether in Source or Object
43
+ form, that is based on (or derived from) the Work and for which the
44
+ editorial revisions, annotations, elaborations, or other modifications
45
+ represent, as a whole, an original work of authorship. For the purposes
46
+ of this License, Derivative Works shall not include works that remain
47
+ separable from, or merely link (or bind by name) to the interfaces of,
48
+ the Work and Derivative Works thereof.
49
+
50
+ "Contribution" shall mean any work of authorship, including
51
+ the original version of the Work and any modifications or additions
52
+ to that Work or Derivative Works thereof, that is intentionally
53
+ submitted to Licensor for inclusion in the Work by the copyright owner
54
+ or by an individual or Legal Entity authorized to submit on behalf of
55
+ the copyright owner. For the purposes of this definition, "submitted"
56
+ means any form of electronic, verbal, or written communication sent
57
+ to the Licensor or its representatives, including but not limited to
58
+ communication on electronic mailing lists, source code control systems,
59
+ and issue tracking systems that are managed by, or on behalf of, the
60
+ Licensor for the purpose of discussing and improving the Work, but
61
+ excluding communication that is conspicuously marked or otherwise
62
+ designated in writing by the copyright owner as "Not a Contribution."
63
+
64
+ "Contributor" shall mean Licensor and any individual or Legal Entity
65
+ on behalf of whom a Contribution has been received by Licensor and
66
+ subsequently incorporated within the Work.
67
+
68
+ 2. Grant of Copyright License. Subject to the terms and conditions of
69
+ this License, each Contributor hereby grants to You a perpetual,
70
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
71
+ copyright license to reproduce, prepare Derivative Works of,
72
+ publicly display, publicly perform, sublicense, and distribute the
73
+ Work and such Derivative Works in Source or Object form.
74
+
75
+ 3. Grant of Patent License. Subject to the terms and conditions of
76
+ this License, each Contributor hereby grants to You a perpetual,
77
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
78
+ (except as stated in this section) patent license to make, have made,
79
+ use, offer to sell, sell, import, and otherwise transfer the Work,
80
+ where such license applies only to those patent claims licensable
81
+ by such Contributor that are necessarily infringed by their
82
+ Contribution(s) alone or by combination of their Contribution(s)
83
+ with the Work to which such Contribution(s) was submitted. If You
84
+ institute patent litigation against any entity (including a
85
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
86
+ or a Contribution incorporated within the Work constitutes direct
87
+ or contributory patent infringement, then any patent licenses
88
+ granted to You under this License for that Work shall terminate
89
+ as of the date such litigation is filed.
90
+
91
+ 4. Redistribution. You may reproduce and distribute copies of the
92
+ Work or Derivative Works thereof in any medium, with or without
93
+ modifications, and in Source or Object form, provided that You
94
+ meet the following conditions:
95
+
96
+ (a) You must give any other recipients of the Work or Derivative
97
+ Works a copy of this License; and
98
+
99
+ (b) You must cause any modified files to carry prominent notices
100
+ stating that You changed the files; and
101
+
102
+ (c) You must retain, in the Source form of any Derivative Works
103
+ that You distribute, all copyright, patent, trademark, and
104
+ attribution notices from the Source form of the Work,
105
+ excluding those notices that do not pertain to any part of
106
+ the Derivative Works; and
107
+
108
+ (d) If the Work includes a "NOTICE" text file as part of its
109
+ distribution, then any Derivative Works that You distribute must
110
+ include a readable copy of the attribution notices contained
111
+ within such NOTICE file, excluding those notices that do not
112
+ pertain to any part of the Derivative Works, in at least one
113
+ of the following places: within a NOTICE text file distributed
114
+ as part of the Derivative Works; within the Source form or
115
+ documentation, if provided along with the Derivative Works; or,
116
+ within a display generated by the Derivative Works, if and
117
+ wherever such third-party notices normally appear. The contents
118
+ of the NOTICE file are for informational purposes only and
119
+ do not modify the License. You may add Your own attribution
120
+ notices within Derivative Works that You distribute, alongside
121
+ or as an addendum to the NOTICE text from the Work, provided
122
+ that such additional attribution notices cannot be construed
123
+ as modifying the License.
124
+
125
+ You may add Your own copyright statement to Your modifications and
126
+ may provide additional or different license terms and conditions
127
+ for use, reproduction, or distribution of Your modifications, or
128
+ for any such Derivative Works as a whole, provided Your use,
129
+ reproduction, and distribution of the Work otherwise complies with
130
+ the conditions stated in this License.
131
+
132
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
133
+ any Contribution intentionally submitted for inclusion in the Work
134
+ by You to the Licensor shall be under the terms and conditions of
135
+ this License, without any additional terms or conditions.
136
+ Notwithstanding the above, nothing herein shall supersede or modify
137
+ the terms of any separate license agreement you may have executed
138
+ with Licensor regarding such Contributions.
139
+
140
+ 6. Trademarks. This License does not grant permission to use the trade
141
+ names, trademarks, service marks, or product names of the Licensor,
142
+ except as required for reasonable and customary use in describing the
143
+ origin of the Work and reproducing the content of the NOTICE file.
144
+
145
+ 7. Disclaimer of Warranty. Unless required by applicable law or
146
+ agreed to in writing, Licensor provides the Work (and each
147
+ Contributor provides its Contributions) on an "AS IS" BASIS,
148
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
149
+ implied, including, without limitation, any warranties or conditions
150
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
151
+ PARTICULAR PURPOSE. You are solely responsible for determining the
152
+ appropriateness of using or redistributing the Work and assume any
153
+ risks associated with Your exercise of permissions under this License.
154
+
155
+ 8. Limitation of Liability. In no event and under no legal theory,
156
+ whether in tort (including negligence), contract, or otherwise,
157
+ unless required by applicable law (such as deliberate and grossly
158
+ negligent acts) or agreed to in writing, shall any Contributor be
159
+ liable to You for damages, including any direct, indirect, special,
160
+ incidental, or consequential damages of any character arising as a
161
+ result of this License or out of the use or inability to use the
162
+ Work (including but not limited to damages for loss of goodwill,
163
+ work stoppage, computer failure or malfunction, or any and all
164
+ other commercial damages or losses), even if such Contributor
165
+ has been advised of the possibility of such damages.
166
+
167
+ 9. Accepting Warranty or Additional Liability. While redistributing
168
+ the Work or Derivative Works thereof, You may choose to offer,
169
+ and charge a fee for, acceptance of support, warranty, indemnity,
170
+ or other liability obligations and/or rights consistent with this
171
+ License. However, in accepting such obligations, You may act only
172
+ on Your own behalf and on Your sole responsibility, not on behalf
173
+ of any other Contributor, and only if You agree to indemnify,
174
+ defend, and hold each Contributor harmless for any liability
175
+ incurred by, or claims asserted against, such Contributor by reason
176
+ of your accepting any such warranty or additional liability.
177
+
178
+ END OF TERMS AND CONDITIONS