#[repr(C)]pub struct SubtleCrypto<D: DomTypes> {
reflector_: Reflector,
phantom: PhantomData<D>,
}Expand description
Fields§
§reflector_: Reflector§phantom: PhantomData<D>Implementations§
Source§impl<D> SubtleCrypto<D>where
D: Equivalence,
Self: DomGlobalGeneric<D>,
impl<D> SubtleCrypto<D>where
D: Equivalence,
Self: DomGlobalGeneric<D>,
fn new_inherited() -> SubtleCrypto<D>
pub(crate) fn new( cx: &mut JSContext, global: &D::GlobalScope, ) -> DomRoot<SubtleCrypto<D>>
Sourcefn resolve_promise_with_data(
&self,
promise: &<D::Promise as PromiseHelpers<D>>::StackRoot,
data: Zeroizing<Vec<u8>>,
)
fn resolve_promise_with_data( &self, promise: &<D::Promise as PromiseHelpers<D>>::StackRoot, data: Zeroizing<Vec<u8>>, )
Queue a global task on the crypto task source, given realm’s global object, to resolve promise with the result of creating an ArrayBuffer in realm, containing data. If it fails to create buffer source, reject promise with a JSFailedError.
Sourcefn resolve_promise_with_jwk(
&self,
cx: &mut JSContext,
promise: &<D::Promise as PromiseHelpers<D>>::StackRoot,
jwk: Box<JsonWebKey>,
)
fn resolve_promise_with_jwk( &self, cx: &mut JSContext, promise: &<D::Promise as PromiseHelpers<D>>::StackRoot, jwk: Box<JsonWebKey>, )
Queue a global task on the crypto task source, given realm’s global object, to resolve promise with the result of converting a JsonWebKey dictionary to an ECMAScript Object in realm, as defined by [WebIDL].
Sourcefn resolve_promise_with_key(
&self,
promise: &<D::Promise as PromiseHelpers<D>>::StackRoot,
key: &CryptoKey<D>,
)
fn resolve_promise_with_key( &self, promise: &<D::Promise as PromiseHelpers<D>>::StackRoot, key: &CryptoKey<D>, )
Queue a global task on the crypto task source, given realm’s global object, to resolve promise with a CryptoKey.
Sourcefn resolve_promise_with_key_pair(
&self,
promise: &<D::Promise as PromiseHelpers<D>>::StackRoot,
key_pair: CryptoKeyPair<D>,
)
fn resolve_promise_with_key_pair( &self, promise: &<D::Promise as PromiseHelpers<D>>::StackRoot, key_pair: CryptoKeyPair<D>, )
Queue a global task on the crypto task source, given realm’s global object, to resolve promise with a CryptoKeyPair.
Sourcefn resolve_promise_with_bool(
&self,
promise: &<D::Promise as PromiseHelpers<D>>::StackRoot,
result: bool,
)
fn resolve_promise_with_bool( &self, promise: &<D::Promise as PromiseHelpers<D>>::StackRoot, result: bool, )
Queue a global task on the crypto task source, given realm’s global object, to resolve promise with a bool value.
Sourcefn reject_promise_with_error(
&self,
promise: &<D::Promise as PromiseHelpers<D>>::StackRoot,
error: Error,
)
fn reject_promise_with_error( &self, promise: &<D::Promise as PromiseHelpers<D>>::StackRoot, error: Error, )
Queue a global task on the crypto task source, given realm’s global object, to reject promise with an error.
Sourcefn resolve_promise_with_encapsulated_key(
&self,
promise: &<D::Promise as PromiseHelpers<D>>::StackRoot,
encapsulated_key: EncapsulatedKey<D>,
)
fn resolve_promise_with_encapsulated_key( &self, promise: &<D::Promise as PromiseHelpers<D>>::StackRoot, encapsulated_key: EncapsulatedKey<D>, )
Queue a global task on the crypto task source, given realm’s global object, to resolve promise with the result of converting EncapsulatedKey to an ECMAScript Object in realm, as defined by [WebIDL].
Sourcefn resolve_promise_with_encapsulated_bits(
&self,
promise: &<D::Promise as PromiseHelpers<D>>::StackRoot,
encapsulated_bits: EncapsulatedBits,
)
fn resolve_promise_with_encapsulated_bits( &self, promise: &<D::Promise as PromiseHelpers<D>>::StackRoot, encapsulated_bits: EncapsulatedBits, )
Queue a global task on the crypto task source, given realm’s global object, to resolve promise with the result of converting EncapsulateBits to an ECMAScript Object in realm, as defined by [WebIDL].
§impl<D: Equivalence> SubtleCrypto<D>
impl<D: Equivalence> SubtleCrypto<D>
fn __assert_parent_type(&self)
Trait Implementations§
Source§impl<D: DomTypes> DomObject for SubtleCrypto<D>
impl<D: DomTypes> DomObject for SubtleCrypto<D>
type ReflectorType = <Reflector as DomObject>::ReflectorType
Source§fn reflector(&self) -> &Reflector<Self::ReflectorType>
fn reflector(&self) -> &Reflector<Self::ReflectorType>
§impl<D: DomTypes> Drop for SubtleCrypto<D>
impl<D: DomTypes> Drop for SubtleCrypto<D>
Source§impl<D: DomTypes> HasParent for SubtleCrypto<D>
impl<D: DomTypes> HasParent for SubtleCrypto<D>
§impl<D: DomTypes> IDLInterface for SubtleCrypto<D>
impl<D: DomTypes> IDLInterface for SubtleCrypto<D>
§const PROTO_ID: ID = PrototypeList::ID::SubtleCrypto
const PROTO_ID: ID = PrototypeList::ID::SubtleCrypto
§const PROTO_FIRST: u16 = 508
const PROTO_FIRST: u16 = 508
§const PROTO_LAST: u16 = 508
const PROTO_LAST: u16 = 508
Source§impl<D> MallocSizeOf for SubtleCrypto<D>where
D: MallocSizeOf + DomTypes,
impl<D> MallocSizeOf for SubtleCrypto<D>where
D: MallocSizeOf + DomTypes,
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Source§impl<D: DomTypes> MutDomObject for SubtleCrypto<D>
impl<D: DomTypes> MutDomObject for SubtleCrypto<D>
Source§impl<D: DomTypes> PartialEq for SubtleCrypto<D>
impl<D: DomTypes> PartialEq for SubtleCrypto<D>
Source§impl<D> SubtleCryptoMethods<D> for SubtleCrypto<D>where
D: Equivalence,
Self: DomGlobalGeneric<D>,
impl<D> SubtleCryptoMethods<D> for SubtleCrypto<D>where
D: Equivalence,
Self: DomGlobalGeneric<D>,
Source§fn Encrypt(
&self,
cx: &mut CurrentRealm<'_>,
algorithm: AlgorithmIdentifier,
key: &CryptoKey<D>,
data: ArrayBufferViewOrArrayBuffer,
) -> <D::Promise as PromiseHelpers<D>>::StackRoot
fn Encrypt( &self, cx: &mut CurrentRealm<'_>, algorithm: AlgorithmIdentifier, key: &CryptoKey<D>, data: ArrayBufferViewOrArrayBuffer, ) -> <D::Promise as PromiseHelpers<D>>::StackRoot
Source§fn Decrypt(
&self,
cx: &mut CurrentRealm<'_>,
algorithm: AlgorithmIdentifier,
key: &CryptoKey<D>,
data: ArrayBufferViewOrArrayBuffer,
) -> <D::Promise as PromiseHelpers<D>>::StackRoot
fn Decrypt( &self, cx: &mut CurrentRealm<'_>, algorithm: AlgorithmIdentifier, key: &CryptoKey<D>, data: ArrayBufferViewOrArrayBuffer, ) -> <D::Promise as PromiseHelpers<D>>::StackRoot
Source§fn Sign(
&self,
cx: &mut CurrentRealm<'_>,
algorithm: AlgorithmIdentifier,
key: &CryptoKey<D>,
data: ArrayBufferViewOrArrayBuffer,
) -> <D::Promise as PromiseHelpers<D>>::StackRoot
fn Sign( &self, cx: &mut CurrentRealm<'_>, algorithm: AlgorithmIdentifier, key: &CryptoKey<D>, data: ArrayBufferViewOrArrayBuffer, ) -> <D::Promise as PromiseHelpers<D>>::StackRoot
Source§fn Verify(
&self,
cx: &mut CurrentRealm<'_>,
algorithm: AlgorithmIdentifier,
key: &CryptoKey<D>,
signature: ArrayBufferViewOrArrayBuffer,
data: ArrayBufferViewOrArrayBuffer,
) -> <D::Promise as PromiseHelpers<D>>::StackRoot
fn Verify( &self, cx: &mut CurrentRealm<'_>, algorithm: AlgorithmIdentifier, key: &CryptoKey<D>, signature: ArrayBufferViewOrArrayBuffer, data: ArrayBufferViewOrArrayBuffer, ) -> <D::Promise as PromiseHelpers<D>>::StackRoot
Source§fn Digest(
&self,
cx: &mut CurrentRealm<'_>,
algorithm: AlgorithmIdentifier,
data: ArrayBufferViewOrArrayBuffer,
) -> <D::Promise as PromiseHelpers<D>>::StackRoot
fn Digest( &self, cx: &mut CurrentRealm<'_>, algorithm: AlgorithmIdentifier, data: ArrayBufferViewOrArrayBuffer, ) -> <D::Promise as PromiseHelpers<D>>::StackRoot
Source§fn GenerateKey(
&self,
cx: &mut CurrentRealm<'_>,
algorithm: AlgorithmIdentifier,
extractable: bool,
key_usages: Vec<KeyUsage>,
) -> <D::Promise as PromiseHelpers<D>>::StackRoot
fn GenerateKey( &self, cx: &mut CurrentRealm<'_>, algorithm: AlgorithmIdentifier, extractable: bool, key_usages: Vec<KeyUsage>, ) -> <D::Promise as PromiseHelpers<D>>::StackRoot
Source§fn DeriveKey(
&self,
cx: &mut CurrentRealm<'_>,
algorithm: AlgorithmIdentifier,
base_key: &CryptoKey<D>,
derived_key_type: AlgorithmIdentifier,
extractable: bool,
usages: Vec<KeyUsage>,
) -> <D::Promise as PromiseHelpers<D>>::StackRoot
fn DeriveKey( &self, cx: &mut CurrentRealm<'_>, algorithm: AlgorithmIdentifier, base_key: &CryptoKey<D>, derived_key_type: AlgorithmIdentifier, extractable: bool, usages: Vec<KeyUsage>, ) -> <D::Promise as PromiseHelpers<D>>::StackRoot
Source§fn DeriveBits(
&self,
cx: &mut CurrentRealm<'_>,
algorithm: AlgorithmIdentifier,
base_key: &CryptoKey<D>,
length: Option<u32>,
) -> <D::Promise as PromiseHelpers<D>>::StackRoot
fn DeriveBits( &self, cx: &mut CurrentRealm<'_>, algorithm: AlgorithmIdentifier, base_key: &CryptoKey<D>, length: Option<u32>, ) -> <D::Promise as PromiseHelpers<D>>::StackRoot
Source§fn ImportKey(
&self,
cx: &mut CurrentRealm<'_>,
format: KeyFormat,
key_data: ArrayBufferViewOrArrayBufferOrJsonWebKey,
algorithm: AlgorithmIdentifier,
extractable: bool,
key_usages: Vec<KeyUsage>,
) -> <D::Promise as PromiseHelpers<D>>::StackRoot
fn ImportKey( &self, cx: &mut CurrentRealm<'_>, format: KeyFormat, key_data: ArrayBufferViewOrArrayBufferOrJsonWebKey, algorithm: AlgorithmIdentifier, extractable: bool, key_usages: Vec<KeyUsage>, ) -> <D::Promise as PromiseHelpers<D>>::StackRoot
Source§fn ExportKey(
&self,
cx: &mut CurrentRealm<'_>,
format: KeyFormat,
key: &CryptoKey<D>,
) -> <D::Promise as PromiseHelpers<D>>::StackRoot
fn ExportKey( &self, cx: &mut CurrentRealm<'_>, format: KeyFormat, key: &CryptoKey<D>, ) -> <D::Promise as PromiseHelpers<D>>::StackRoot
Source§fn WrapKey(
&self,
cx: &mut CurrentRealm<'_>,
format: KeyFormat,
key: &CryptoKey<D>,
wrapping_key: &CryptoKey<D>,
algorithm: AlgorithmIdentifier,
) -> <D::Promise as PromiseHelpers<D>>::StackRoot
fn WrapKey( &self, cx: &mut CurrentRealm<'_>, format: KeyFormat, key: &CryptoKey<D>, wrapping_key: &CryptoKey<D>, algorithm: AlgorithmIdentifier, ) -> <D::Promise as PromiseHelpers<D>>::StackRoot
Source§fn UnwrapKey(
&self,
cx: &mut CurrentRealm<'_>,
format: KeyFormat,
wrapped_key: ArrayBufferViewOrArrayBuffer,
unwrapping_key: &CryptoKey<D>,
algorithm: AlgorithmIdentifier,
unwrapped_key_algorithm: AlgorithmIdentifier,
extractable: bool,
usages: Vec<KeyUsage>,
) -> <D::Promise as PromiseHelpers<D>>::StackRoot
fn UnwrapKey( &self, cx: &mut CurrentRealm<'_>, format: KeyFormat, wrapped_key: ArrayBufferViewOrArrayBuffer, unwrapping_key: &CryptoKey<D>, algorithm: AlgorithmIdentifier, unwrapped_key_algorithm: AlgorithmIdentifier, extractable: bool, usages: Vec<KeyUsage>, ) -> <D::Promise as PromiseHelpers<D>>::StackRoot
Source§fn EncapsulateKey(
&self,
cx: &mut CurrentRealm<'_>,
encapsulation_algorithm: AlgorithmIdentifier,
encapsulation_key: &CryptoKey<D>,
shared_key_algorithm: AlgorithmIdentifier,
extractable: bool,
usages: Vec<KeyUsage>,
) -> <D::Promise as PromiseHelpers<D>>::StackRoot
fn EncapsulateKey( &self, cx: &mut CurrentRealm<'_>, encapsulation_algorithm: AlgorithmIdentifier, encapsulation_key: &CryptoKey<D>, shared_key_algorithm: AlgorithmIdentifier, extractable: bool, usages: Vec<KeyUsage>, ) -> <D::Promise as PromiseHelpers<D>>::StackRoot
Source§fn EncapsulateBits(
&self,
cx: &mut CurrentRealm<'_>,
encapsulation_algorithm: AlgorithmIdentifier,
encapsulation_key: &CryptoKey<D>,
) -> <D::Promise as PromiseHelpers<D>>::StackRoot
fn EncapsulateBits( &self, cx: &mut CurrentRealm<'_>, encapsulation_algorithm: AlgorithmIdentifier, encapsulation_key: &CryptoKey<D>, ) -> <D::Promise as PromiseHelpers<D>>::StackRoot
Source§fn DecapsulateKey(
&self,
cx: &mut CurrentRealm<'_>,
decapsulation_algorithm: AlgorithmIdentifier,
decapsulation_key: &CryptoKey<D>,
ciphertext: ArrayBufferViewOrArrayBuffer,
shared_key_algorithm: AlgorithmIdentifier,
extractable: bool,
usages: Vec<KeyUsage>,
) -> <D::Promise as PromiseHelpers<D>>::StackRoot
fn DecapsulateKey( &self, cx: &mut CurrentRealm<'_>, decapsulation_algorithm: AlgorithmIdentifier, decapsulation_key: &CryptoKey<D>, ciphertext: ArrayBufferViewOrArrayBuffer, shared_key_algorithm: AlgorithmIdentifier, extractable: bool, usages: Vec<KeyUsage>, ) -> <D::Promise as PromiseHelpers<D>>::StackRoot
Source§fn DecapsulateBits(
&self,
cx: &mut CurrentRealm<'_>,
decapsulation_algorithm: AlgorithmIdentifier,
decapsulation_key: &CryptoKey<D>,
ciphertext: ArrayBufferViewOrArrayBuffer,
) -> <D::Promise as PromiseHelpers<D>>::StackRoot
fn DecapsulateBits( &self, cx: &mut CurrentRealm<'_>, decapsulation_algorithm: AlgorithmIdentifier, decapsulation_key: &CryptoKey<D>, ciphertext: ArrayBufferViewOrArrayBuffer, ) -> <D::Promise as PromiseHelpers<D>>::StackRoot
Source§fn GetPublicKey(
&self,
cx: &mut CurrentRealm<'_>,
key: &CryptoKey<D>,
usages: Vec<KeyUsage>,
) -> <D::Promise as PromiseHelpers<D>>::StackRoot
fn GetPublicKey( &self, cx: &mut CurrentRealm<'_>, key: &CryptoKey<D>, usages: Vec<KeyUsage>, ) -> <D::Promise as PromiseHelpers<D>>::StackRoot
Source§fn Supports(
cx: &mut JSContext,
_global: &D::GlobalScope,
operation: DOMString,
algorithm: AlgorithmIdentifier,
length: Option<u32>,
) -> bool
fn Supports( cx: &mut JSContext, _global: &D::GlobalScope, operation: DOMString, algorithm: AlgorithmIdentifier, length: Option<u32>, ) -> bool
Source§fn Supports_(
cx: &mut JSContext,
_global: &D::GlobalScope,
operation: DOMString,
algorithm: AlgorithmIdentifier,
additional_algorithm: AlgorithmIdentifier,
) -> bool
fn Supports_( cx: &mut JSContext, _global: &D::GlobalScope, operation: DOMString, algorithm: AlgorithmIdentifier, additional_algorithm: AlgorithmIdentifier, ) -> bool
Source§impl<D: DomTypes> ToJSValConvertible for SubtleCrypto<D>
impl<D: DomTypes> ToJSValConvertible for SubtleCrypto<D>
Source§fn to_jsval(&self, cx: &mut JSContext, rval: MutableHandleValue<'_>)
fn to_jsval(&self, cx: &mut JSContext, rval: MutableHandleValue<'_>)
self to a JSVal. JSAPI failure causes a panic.Source§impl<D> Traceable for SubtleCrypto<D>where
D: JSTraceable + DomTypes,
impl<D> Traceable for SubtleCrypto<D>where
D: JSTraceable + DomTypes,
impl<D: DomTypes> Eq for SubtleCrypto<D>
Auto Trait Implementations§
impl<D> !Freeze for SubtleCrypto<D>
impl<D> !RefUnwindSafe for SubtleCrypto<D>
impl<D> !Send for SubtleCrypto<D>
impl<D> !Sync for SubtleCrypto<D>
impl<D> Unpin for SubtleCrypto<D>where
D: Unpin,
impl<D> UnsafeUnpin for SubtleCrypto<D>
impl<D> UnwindSafe for SubtleCrypto<D>where
D: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<D, T> DomGlobalGeneric<D> for T
impl<D, T> DomGlobalGeneric<D> for T
Source§fn global_from_reflector(&self) -> Root<Dom<<D as DomTypes>::GlobalScope>>where
Self: Sized,
fn global_from_reflector(&self) -> Root<Dom<<D as DomTypes>::GlobalScope>>where
Self: Sized,
GlobalScope] of the realm that the DomObject was created in. If this
object is a Node, this will be different from it’s owning Document if adopted by. For
Nodes it’s almost always better to use NodeTraits::owning_global.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more