Skip to main content

SubtleCrypto

Struct SubtleCrypto 

Source
#[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>,

Source

fn new_inherited() -> SubtleCrypto<D>

Source

pub(crate) fn new( cx: &mut JSContext, global: &D::GlobalScope, ) -> DomRoot<SubtleCrypto<D>>

Source

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.

Source

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].

Source

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.

Source

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.

Source

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.

Source

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.

Source

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].

Source

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>

Trait Implementations§

Source§

impl<D: DomTypes> DomObject for SubtleCrypto<D>

Source§

type ReflectorType = <Reflector as DomObject>::ReflectorType

Source§

fn reflector(&self) -> &Reflector<Self::ReflectorType>

Returns the receiver’s reflector.
§

impl<D: DomTypes> Drop for SubtleCrypto<D>

§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl<D: DomTypes> HasParent for SubtleCrypto<D>

Source§

fn as_parent(&self) -> &Reflector

This is used in a type assertion to ensure that the source and webidls agree as to what the parent type is

Source§

type Parent = Reflector

§

impl<D: DomTypes> IDLInterface for SubtleCrypto<D>

§

const PROTO_ID: ID = PrototypeList::ID::SubtleCrypto

The concrete type represented by this interface instance.
§

const PROTO_FIRST: u16 = 508

First prototype ID in the DFS-ordered range for this interface and its descendants.
§

const PROTO_LAST: u16 = 508

Last prototype ID in the DFS-ordered range for this interface and its descendants.
§

fn derives(class: &'static DOMClass) -> bool

Returns whether the given DOM class derives that interface.
Source§

impl<D> MallocSizeOf for SubtleCrypto<D>

Source§

fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize

Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself.
Source§

impl<D: DomTypes> MutDomObject for SubtleCrypto<D>

Source§

unsafe fn init_reflector<Actual>(&self, obj: *mut JSObject)

Initializes the Reflector Read more
Source§

unsafe fn init_reflector_without_associated_memory(&self, obj: *mut JSObject)

Initializes the Reflector without recording any associated memory usage. Read more
Source§

impl<D: DomTypes> PartialEq for SubtleCrypto<D>

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

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

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

Source§

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

Source§

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

Source§

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

Source§

impl<D: DomTypes> ToJSValConvertible for SubtleCrypto<D>

Source§

fn to_jsval(&self, cx: &mut JSContext, rval: MutableHandleValue<'_>)

Convert self to a JSVal. JSAPI failure causes a panic.
Source§

impl<D> Traceable for SubtleCrypto<D>
where D: JSTraceable + DomTypes,

Source§

unsafe fn trace(&self, tracer: *mut JSTracer)

Trace self.
Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<D, T> DomGlobalGeneric<D> for T
where D: DomTypes, T: DomObject,

Source§

fn global_from_reflector(&self) -> Root<Dom<<D as DomTypes>::GlobalScope>>
where Self: Sized,

Returns the [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<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> MaybeBoxed<Box<T>> for T

Source§

fn maybe_boxed(self) -> Box<T>

Convert
Source§

impl<T> MaybeBoxed<T> for T

Source§

fn maybe_boxed(self) -> T

Convert
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

impl<T> ThisReflector for T
where T: DomObject,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,