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

Make return types of SubtleCrypto methods more specific #388

Merged
merged 1 commit into from
Dec 19, 2024
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
117 changes: 71 additions & 46 deletions spec/Overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -1231,52 +1231,77 @@ <h2>SubtleCrypto interface</h2>

[SecureContext,Exposed=(Window,Worker)]
interface SubtleCrypto {
Promise&lt;any> encrypt(AlgorithmIdentifier algorithm,
CryptoKey key,
BufferSource data);
Promise&lt;any> decrypt(AlgorithmIdentifier algorithm,
CryptoKey key,
BufferSource data);
Promise&lt;any> sign(AlgorithmIdentifier algorithm,
CryptoKey key,
BufferSource data);
Promise&lt;any> verify(AlgorithmIdentifier algorithm,
CryptoKey key,
BufferSource signature,
BufferSource data);
Promise&lt;any> digest(AlgorithmIdentifier algorithm,
BufferSource data);

Promise&lt;any> generateKey(AlgorithmIdentifier algorithm,
boolean extractable,
sequence&lt;KeyUsage> keyUsages );
Promise&lt;any> deriveKey(AlgorithmIdentifier algorithm,
CryptoKey baseKey,
AlgorithmIdentifier derivedKeyType,
boolean extractable,
sequence&lt;KeyUsage> keyUsages );
Promise&lt;ArrayBuffer> deriveBits(AlgorithmIdentifier algorithm,
CryptoKey baseKey,
optional unsigned long? length = null);

Promise&lt;CryptoKey> importKey(KeyFormat format,
(BufferSource or JsonWebKey) keyData,
AlgorithmIdentifier algorithm,
boolean extractable,
sequence&lt;KeyUsage> keyUsages );
Promise&lt;any> exportKey(KeyFormat format, CryptoKey key);

Promise&lt;any> wrapKey(KeyFormat format,
CryptoKey key,
CryptoKey wrappingKey,
AlgorithmIdentifier wrapAlgorithm);
Promise&lt;CryptoKey> unwrapKey(KeyFormat format,
BufferSource wrappedKey,
CryptoKey unwrappingKey,
AlgorithmIdentifier unwrapAlgorithm,
AlgorithmIdentifier unwrappedKeyAlgorithm,
boolean extractable,
sequence&lt;KeyUsage> keyUsages );
Promise&lt;ArrayBuffer> encrypt(
AlgorithmIdentifier algorithm,
CryptoKey key,
BufferSource data
);
Promise&lt;ArrayBuffer> decrypt(
AlgorithmIdentifier algorithm,
CryptoKey key,
BufferSource data
);
Promise&lt;ArrayBuffer> sign(
AlgorithmIdentifier algorithm,
CryptoKey key,
BufferSource data
);
Promise&lt;boolean> verify(
AlgorithmIdentifier algorithm,
CryptoKey key,
BufferSource signature,
BufferSource data
);
Promise&lt;ArrayBuffer> digest(
AlgorithmIdentifier algorithm,
BufferSource data
);

Promise&lt;(CryptoKey or CryptoKeyPair)> generateKey(
AlgorithmIdentifier algorithm,
boolean extractable,
sequence&lt;KeyUsage> keyUsages
);
Promise&lt;CryptoKey> deriveKey(
AlgorithmIdentifier algorithm,
CryptoKey baseKey,
AlgorithmIdentifier derivedKeyType,
boolean extractable,
sequence&lt;KeyUsage> keyUsages
);
Promise&lt;ArrayBuffer> deriveBits(
AlgorithmIdentifier algorithm,
CryptoKey baseKey,
optional unsigned long? length = null
);

Promise&lt;CryptoKey> importKey(
KeyFormat format,
(BufferSource or JsonWebKey) keyData,
AlgorithmIdentifier algorithm,
boolean extractable,
sequence&lt;KeyUsage> keyUsages
);
Promise&lt;(ArrayBuffer or JsonWebKey)> exportKey(
KeyFormat format,
CryptoKey key
);

Promise&lt;ArrayBuffer> wrapKey(
KeyFormat format,
CryptoKey key,
CryptoKey wrappingKey,
AlgorithmIdentifier wrapAlgorithm
);
Promise&lt;CryptoKey> unwrapKey(
KeyFormat format,
BufferSource wrappedKey,
CryptoKey unwrappingKey,
AlgorithmIdentifier unwrapAlgorithm,
AlgorithmIdentifier unwrappedKeyAlgorithm,
boolean extractable,
sequence&lt;KeyUsage> keyUsages
);
};
</pre>
<div class=note>
Expand Down
Loading