| 
									
										
										
										
											2023-12-15 22:03:04 +01:00
										 |  |  | #import <Crypto/CryptoKey.idl> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-12-14 20:56:30 +01:00
										 |  |  | typedef (object or DOMString) AlgorithmIdentifier; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | dictionary Algorithm { | 
					
						
							| 
									
										
										
										
											2024-01-17 21:03:20 +01:00
										 |  |  |     required DOMString name; | 
					
						
							| 
									
										
										
										
											2023-12-14 20:56:30 +01:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-12-15 23:40:52 +01:00
										 |  |  | enum KeyFormat { "raw", "spki", "pkcs8", "jwk" }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | dictionary RsaOtherPrimesInfo { | 
					
						
							|  |  |  |     // The following fields are defined in Section 6.3.2.7 of JSON Web Algorithms | 
					
						
							|  |  |  |     DOMString r; | 
					
						
							|  |  |  |     DOMString d; | 
					
						
							|  |  |  |     DOMString t; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | dictionary JsonWebKey | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     // The following fields are defined in Section 3.1 of JSON Web Key | 
					
						
							|  |  |  |     DOMString kty; | 
					
						
							|  |  |  |     DOMString use; | 
					
						
							|  |  |  |     sequence<DOMString> key_ops; | 
					
						
							|  |  |  |     DOMString alg; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     // The following fields are defined in JSON Web Key Parameters Registration | 
					
						
							|  |  |  |     boolean ext; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     // The following fields are defined in Section 6 of JSON Web Algorithms | 
					
						
							|  |  |  |     DOMString crv; | 
					
						
							|  |  |  |     DOMString x; | 
					
						
							|  |  |  |     DOMString y; | 
					
						
							|  |  |  |     DOMString d; | 
					
						
							|  |  |  |     DOMString n; | 
					
						
							|  |  |  |     DOMString e; | 
					
						
							|  |  |  |     DOMString p; | 
					
						
							|  |  |  |     DOMString q; | 
					
						
							|  |  |  |     DOMString dp; | 
					
						
							|  |  |  |     DOMString dq; | 
					
						
							|  |  |  |     DOMString qi; | 
					
						
							|  |  |  |     sequence<RsaOtherPrimesInfo> oth; | 
					
						
							|  |  |  |     DOMString k; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-10-25 17:27:19 +02:00
										 |  |  | // https://w3c.github.io/webcrypto/#subtlecrypto-interface | 
					
						
							| 
									
										
										
										
											2023-09-03 02:00:01 +12:00
										 |  |  | [SecureContext,Exposed=(Window,Worker)] | 
					
						
							| 
									
										
										
										
											2021-12-13 20:48:27 +00:00
										 |  |  | interface SubtleCrypto { | 
					
						
							| 
									
										
										
										
											2023-10-25 17:27:19 +02:00
										 |  |  |     // FIXME: Promise<any> encrypt(AlgorithmIdentifier algorithm, CryptoKey key, BufferSource data); | 
					
						
							|  |  |  |     // FIXME: Promise<any> decrypt(AlgorithmIdentifier algorithm, CryptoKey key, BufferSource data); | 
					
						
							|  |  |  |     // FIXME: Promise<any> sign(AlgorithmIdentifier algorithm, CryptoKey key, BufferSource data); | 
					
						
							|  |  |  |     // FIXME: Promise<any> verify(AlgorithmIdentifier algorithm, CryptoKey key, BufferSource signature, BufferSource data); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-12-14 20:56:30 +01:00
										 |  |  |     Promise<any> digest(AlgorithmIdentifier algorithm, BufferSource data); | 
					
						
							| 
									
										
										
										
											2023-10-25 17:27:19 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-03-06 19:15:03 -07:00
										 |  |  |     Promise<any> generateKey(AlgorithmIdentifier algorithm,  boolean extractable, sequence<KeyUsage> keyUsages); | 
					
						
							| 
									
										
										
										
											2023-10-25 17:27:19 +02:00
										 |  |  |     // FIXME: Promise<any> deriveKey(AlgorithmIdentifier algorithm, CryptoKey baseKey, AlgorithmIdentifier derivedKeyType, boolean extractable, sequence<KeyUsage> keyUsages ); | 
					
						
							|  |  |  |     // FIXME: Promise<ArrayBuffer> deriveBits(AlgorithmIdentifier algorithm, CryptoKey baseKey, unsigned long length); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-12-15 22:03:04 +01:00
										 |  |  |     Promise<CryptoKey> importKey(KeyFormat format, (BufferSource or JsonWebKey) keyData,  AlgorithmIdentifier algorithm, boolean extractable, sequence<KeyUsage> keyUsages); | 
					
						
							| 
									
										
										
										
											2024-03-13 21:19:57 -06:00
										 |  |  |     Promise<any> exportKey(KeyFormat format, CryptoKey key); | 
					
						
							| 
									
										
										
										
											2023-10-25 17:27:19 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     // FIXME: Promise<any> wrapKey(KeyFormat format, CryptoKey key, CryptoKey wrappingKey, AlgorithmIdentifier wrapAlgorithm); | 
					
						
							|  |  |  |     // FIXME: Promise<CryptoKey> unwrapKey(KeyFormat format, BufferSource wrappedKey, CryptoKey unwrappingKey, AlgorithmIdentifier unwrapAlgorithm, AlgorithmIdentifier unwrappedKeyAlgorithm, boolean extractable, sequence<KeyUsage> keyUsages); | 
					
						
							| 
									
										
										
										
											2021-12-13 20:48:27 +00:00
										 |  |  | }; |