Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorporate additional custom proof options #88

Merged
merged 7 commits into from
Jul 30, 2024
89 changes: 23 additions & 66 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -700,50 +700,33 @@ <h4>Proof Configuration (eddsa-rdfc-2022)</h4>
identifier (<var>cryptosuite</var>). A <em>proof configuration</em>
object is produced as output.
</p>

<ol class="algorithm">
<li>
Let <var>proofConfig</var> be an empty object.
</li>
<li>
Set <var>proofConfig</var>.<var>type</var> to
<var>options</var>.<var>type</var>.
</li>
<li>
If <var>options</var>.<var>cryptosuite</var> is set,
set <var>proofConfig</var>.<var>cryptosuite</var> to its value.
Let |proofConfig| be a clone of the |options| object.
</li>
<li>
If <var>options</var>.<var>type</var> is not set to `DataIntegrityProof` and/or
<var>proofConfig</var>.<var>cryptosuite</var> is not set to `eddsa-rdfc-2022`,
an error MUST be raised that SHOULD convey an error type of
If |proofConfig|.|type| is not set to `DataIntegrityProof` and/or
|proofConfig|.|cryptosuite| is not set to `eddsa-rdfc-2022`, an
error MUST be raised and SHOULD convey an error type of
<a data-cite="VC-DATA-INTEGRITY#PROOF_GENERATION_ERROR">PROOF_GENERATION_ERROR</a>.
</li>
<li>
Set <var>proofConfig</var>.<var>created</var> to
<var>options</var>.<var>created</var>. If the value is not a valid
[[XMLSCHEMA11-2]] datetime,
an error MUST be raised that SHOULD convey an error type of
If |proofConfig|.|created| is present and set to a value that is not a
valid [[XMLSCHEMA11-2]] datetime, an error MUST be
raised and SHOULD convey an error type of
<a data-cite="VC-DATA-INTEGRITY#PROOF_GENERATION_ERROR">PROOF_GENERATION_ERROR</a>.
</li>
<li>
Set <var>proofConfig</var>.<var>verificationMethod</var> to
<var>options</var>.<var>verificationMethod</var>.
</li>
<li>
Set <var>proofConfig</var>.<var>proofPurpose</var> to
<var>options</var>.<var>proofPurpose</var>.
</li>
<li>
Set <var>proofConfig</var>.<var>@context</var> to
<var>unsecuredDocument</var>.<var>@context</var>
Set |proofConfig|.<var>@context </var>to
|unsecuredDocument|.<var>@context</var>.
Copy link
Contributor

@dlongley dlongley Jul 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like it was erroneously copied from the jcs cryptosuite ... am I just misreading it? It looks like it might be in the wrong place because I didn't see it in the jcs cryptosuite in this spec.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is right. Before we can canonize the proofConfig we need to add @context. Right? This was something that we had to fix way back when I started figuring out how to generate the test vectors...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yes, ok.

</li>
<li>
Let <var>canonicalProofConfig</var> be the result of applying the
RDF Dataset Canonicalization algorithm [[RDF-CANON]] to the <var>proofConfig</var>.
Let |canonicalProofConfig| be the result of applying the
RDF Dataset Canonicalization Algorithm
[[RDF-CANON]] to the |proofConfig|.
</li>
<li>
Return <var>canonicalProofConfig</var>.
Return |canonicalProofConfig|.
</li>
</ol>

Expand Down Expand Up @@ -1080,27 +1063,18 @@ <h4>Proof Configuration (eddsa-jcs-2022)</h4>
Let <var>proofConfig</var> be a clone of the <var>options</var> object.
</li>
<li>
If <var>options</var>.<var>type</var> is not set to `DataIntegrityProof` and
If <var>proofConfig</var>.<var>type</var> is not set to `DataIntegrityProof` or
<var>proofConfig</var>.<var>cryptosuite</var> is not set to `eddsa-jcs-2022`,
an error MUST be raised that SHOULD convey an error type of
<a data-cite="VC-DATA-INTEGRITY#PROOF_GENERATION_ERROR">PROOF_GENERATION_ERROR</a>.
</li>
<li>
Set <var>proofConfig</var>.<var>created</var> to
<var>options</var>.<var>created</var>. If the value is not a valid
[[XMLSCHEMA11-2]] datetime,
an error MUST be raised that SHOULD convey an error type of
If |proofConfig|.|created| is set to a value that is not a
valid [[XMLSCHEMA11-2]] datetime, an error MUST be
raised and SHOULD convey an error type of
<a data-cite="VC-DATA-INTEGRITY#PROOF_GENERATION_ERROR">PROOF_GENERATION_ERROR</a>.
</li>
<li>
Set <var>proofConfig</var>.<var>verificationMethod</var> to
<var>options</var>.<var>verificationMethod</var>.
</li>
<li>
Set <var>proofConfig</var>.<var>proofPurpose</var> to
<var>options</var>.<var>proofPurpose</var>.
</li>
<li>
Let <var>canonicalProofConfig</var> be the result of applying the
JSON Canonicalization Scheme [[RFC8785]] to the <var>proofConfig</var>.
</li>
Expand Down Expand Up @@ -2112,37 +2086,20 @@ <h4>Proof Configuration (Ed25519Signature2020)</h4>

<ol class="algorithm">
<li>
Let <var>proofConfig</var> be an empty object.
</li>
<li>
Set <var>proofConfig</var>.<var>type</var> to
<var>options</var>.<var>type</var>.
Let |proofConfig| be a clone of the |options| object.
</li>
<li>
If <var>options</var>.<var>cryptosuite</var> is set,
set <var>proofConfig</var>.<var>cryptosuite</var> to its value.
</li>
<li>
If <var>options</var>.<var>type</var> is not set to `Ed25519Signature2020`,
an error MUST be raised that SHOULD convey an error type of
If <var>proofConfig</var>.<var>type</var> is not set to `Ed25519Signature2020`,
an error MUST be raised and SHOULD convey an error type of
<a data-cite="VC-DATA-INTEGRITY#PROOF_GENERATION_ERROR">PROOF_GENERATION_ERROR</a>.
</li>
<li>
Set <var>proofConfig</var>.<var>created</var> to
<var>options</var>.<var>created</var>. If the value is not a valid
[[XMLSCHEMA11-2]] datetime,
an error MUST be raised that SHOULD convey an error type of
If |proofConfig|.|created| is present and set to a value that is not a
valid [[XMLSCHEMA11-2]] datetime, an error MUST be
raised and SHOULD convey an error type of
<a data-cite="VC-DATA-INTEGRITY#PROOF_GENERATION_ERROR">PROOF_GENERATION_ERROR</a>.
</li>
<li>
Set <var>proofConfig</var>.<var>verificationMethod</var> to
<var>options</var>.<var>verificationMethod</var>.
</li>
<li>
Set <var>proofConfig</var>.<var>proofPurpose</var> to
<var>options</var>.<var>proofPurpose</var>.
</li>
<li>
Set <var>proofConfig</var>.<var>@context</var> to
<var>unsecuredDocument</var>.<var>@context</var>
</li>
Expand Down
Loading