mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Implement crypto.subtle.sign/verify
with HMAC (#34223)
* Allow importing HMAC keys Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Implement crypto.subtle.sign with HMAC Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Implement crypto.subtle.verify with HMAC Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Update WPT expectations Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
parent
deddcf2c7a
commit
8d3d7b7403
7 changed files with 461 additions and 531 deletions
|
@ -26,13 +26,13 @@ interface SubtleCrypto {
|
|||
Promise<any> decrypt(AlgorithmIdentifier algorithm,
|
||||
CryptoKey key,
|
||||
BufferSource data);
|
||||
// Promise<any> sign(AlgorithmIdentifier algorithm,
|
||||
// CryptoKey key,
|
||||
// BufferSource data);
|
||||
// Promise<any> verify(AlgorithmIdentifier algorithm,
|
||||
// CryptoKey key,
|
||||
// BufferSource signature,
|
||||
// BufferSource data);
|
||||
Promise<any> sign(AlgorithmIdentifier algorithm,
|
||||
CryptoKey key,
|
||||
BufferSource data);
|
||||
Promise<any> verify(AlgorithmIdentifier algorithm,
|
||||
CryptoKey key,
|
||||
BufferSource signature,
|
||||
BufferSource data);
|
||||
Promise<any> digest(AlgorithmIdentifier algorithm,
|
||||
BufferSource data);
|
||||
|
||||
|
@ -92,6 +92,18 @@ dictionary AesCtrParams : Algorithm {
|
|||
required [EnforceRange] octet length;
|
||||
};
|
||||
|
||||
// https://w3c.github.io/webcrypto/#dfn-HmacImportParams
|
||||
dictionary HmacImportParams : Algorithm {
|
||||
required HashAlgorithmIdentifier hash;
|
||||
[EnforceRange] unsigned long length;
|
||||
};
|
||||
|
||||
// https://w3c.github.io/webcrypto/#dfn-HmacKeyAlgorithm
|
||||
dictionary HmacKeyAlgorithm : KeyAlgorithm {
|
||||
required KeyAlgorithm hash;
|
||||
required unsigned long length;
|
||||
};
|
||||
|
||||
// https://w3c.github.io/webcrypto/#hkdf-params
|
||||
dictionary HkdfParams : Algorithm {
|
||||
required HashAlgorithmIdentifier hash;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue