Skip to content

Add support for long keyID values #77

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

Merged
merged 6 commits into from
Mar 19, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ spec:webidl; type:dfn; text:resolve
<pre class=link-defaults>
spec:streams; type:interface; text:ReadableStream
</pre>
<pre class=anchors>
url: https://heycam.github.io/webidl/#idl-bigint; type: interface; text: BigInt
</pre>

# Introduction # {#introduction}

Expand Down Expand Up @@ -191,10 +194,13 @@ dictionary SFrameTransformOptions {
SFrameTransformRole role = "encrypt";
};

typedef [EnforceRange] unsigned long long SmallCryptoKeyID;
typedef (SmallCryptoKeyID or BigInt) CryptoKeyID;
Copy link
Member

Choose a reason for hiding this comment

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

I've sent #92 to fix the case of BigInt here, spotted by tests in https://github.com/w3c/webref.


[Exposed=(Window,DedicatedWorker)]
interface SFrameTransform {
constructor(optional SFrameTransformOptions options = {});
Promise<undefined> setEncryptionKey(CryptoKey key, optional unsigned long long keyID);
Promise<undefined> setEncryptionKey(CryptoKey key, optional CryptoKeyID keyID);
};
SFrameTransform includes GenericTransformStream;
</xmp>
Expand Down Expand Up @@ -227,11 +233,12 @@ The SFrame transform algorithm, given |sframe| as a SFrameTransform object and |
## Methods
The <dfn method for="SFrameTransform">setEncryptionKey(|key|, |keyID|)</dfn> method steps are:
1. Let |promise| be [=a new promise=].
2. [=In parallel=], run the following steps:
2. If |keyID| is a {{BigInt}} which cannot be represented as a integer between 0 and 2<sup>64</sup>-1 inclusive, [=reject=] |promise| with a {{RangeError}} exception.
3. Otherwise, [=in parallel=], run the following steps:
1. Set |key| with its optional |keyID| as key material to use for the SFrame transform algorithm, as defined by the <a href="https://datatracker.ietf.org/doc/draft-omara-sframe/">SFrame specification</a>.
2. If setting the key material fails, [=Reject=] |promise| with an {{InvalidModificationError}} error and abort these steps.
2. If setting the key material fails, [=reject=] |promise| with an {{InvalidModificationError}} exception and abort these steps.
3. [=Resolve=] |promise| with undefined.
3. Return |promise|.
4. Return |promise|.


# RTCRtpScriptTransform # {#scriptTransform}
Expand Down