pub trait SubtleCryptoMethods {
// Required methods
fn Encrypt(
&self,
cx: SafeJSContext,
algorithm: ObjectOrString,
key: &CryptoKey,
data: ArrayBufferViewOrArrayBuffer,
_comp: InRealm<'_>,
_can_gc: CanGc,
) -> Rc<Promise>;
fn Decrypt(
&self,
cx: SafeJSContext,
algorithm: ObjectOrString,
key: &CryptoKey,
data: ArrayBufferViewOrArrayBuffer,
_comp: InRealm<'_>,
_can_gc: CanGc,
) -> Rc<Promise>;
fn Sign(
&self,
cx: SafeJSContext,
algorithm: ObjectOrString,
key: &CryptoKey,
data: ArrayBufferViewOrArrayBuffer,
_comp: InRealm<'_>,
_can_gc: CanGc,
) -> Rc<Promise>;
fn Verify(
&self,
cx: SafeJSContext,
algorithm: ObjectOrString,
key: &CryptoKey,
signature: ArrayBufferViewOrArrayBuffer,
data: ArrayBufferViewOrArrayBuffer,
_comp: InRealm<'_>,
_can_gc: CanGc,
) -> Rc<Promise>;
fn Digest(
&self,
cx: SafeJSContext,
algorithm: ObjectOrString,
data: ArrayBufferViewOrArrayBuffer,
_comp: InRealm<'_>,
_can_gc: CanGc,
) -> Rc<Promise>;
fn GenerateKey(
&self,
cx: SafeJSContext,
algorithm: ObjectOrString,
extractable: bool,
keyUsages: Vec<KeyUsage>,
_comp: InRealm<'_>,
_can_gc: CanGc,
) -> Rc<Promise>;
fn DeriveKey(
&self,
cx: SafeJSContext,
algorithm: ObjectOrString,
baseKey: &CryptoKey,
derivedKeyType: ObjectOrString,
extractable: bool,
keyUsages: Vec<KeyUsage>,
_comp: InRealm<'_>,
_can_gc: CanGc,
) -> Rc<Promise>;
fn DeriveBits(
&self,
cx: SafeJSContext,
algorithm: ObjectOrString,
baseKey: &CryptoKey,
length: Option<u32>,
_comp: InRealm<'_>,
_can_gc: CanGc,
) -> Rc<Promise>;
fn ImportKey(
&self,
cx: SafeJSContext,
format: KeyFormat,
keyData: ArrayBufferViewOrArrayBufferOrJsonWebKey,
algorithm: ObjectOrString,
extractable: bool,
keyUsages: Vec<KeyUsage>,
_comp: InRealm<'_>,
_can_gc: CanGc,
) -> Rc<Promise>;
fn ExportKey(
&self,
format: KeyFormat,
key: &CryptoKey,
_comp: InRealm<'_>,
_can_gc: CanGc,
) -> Rc<Promise>;
fn WrapKey(
&self,
cx: SafeJSContext,
format: KeyFormat,
key: &CryptoKey,
wrappingKey: &CryptoKey,
wrapAlgorithm: ObjectOrString,
_comp: InRealm<'_>,
_can_gc: CanGc,
) -> Rc<Promise>;
fn UnwrapKey(
&self,
cx: SafeJSContext,
format: KeyFormat,
wrappedKey: ArrayBufferViewOrArrayBuffer,
unwrappingKey: &CryptoKey,
unwrapAlgorithm: ObjectOrString,
unwrappedKeyAlgorithm: ObjectOrString,
extractable: bool,
keyUsages: Vec<KeyUsage>,
_comp: InRealm<'_>,
_can_gc: CanGc,
) -> Rc<Promise>;
}