pub struct Certificate { /* private fields */ }Expand description
Parsed X.509 v3 certificate. Construct via Certificate::from_der or
Certificate::from_pem; inspect validity window, fingerprint, serial.
Implementations§
Source§impl Certificate
impl Certificate
Sourcepub fn from_der(der: &[u8]) -> Result<Certificate, JsValue>
pub fn from_der(der: &[u8]) -> Result<Certificate, JsValue>
Parse a certificate from DER bytes (Uint8Array).
Sourcepub fn from_pem(pem: &str) -> Result<Certificate, JsValue>
pub fn from_pem(pem: &str) -> Result<Certificate, JsValue>
Parse a certificate from PEM (RFC 7468) text.
Sourcepub fn fingerprint_sha256(&self) -> String
pub fn fingerprint_sha256(&self) -> String
SHA-256 fingerprint as a lowercase hex string.
Sourcepub fn serial_hex(&self) -> String
pub fn serial_hex(&self) -> String
Serial number as a lowercase hex string.
Sourcepub fn is_within_validity(&self, epoch_ms: f64) -> bool
pub fn is_within_validity(&self, epoch_ms: f64) -> bool
Whether the certificate is within its validity window at the given epoch-millisecond timestamp.
Trait Implementations§
Source§impl From<Certificate> for JsValue
impl From<Certificate> for JsValue
Source§fn from(value: Certificate) -> Self
fn from(value: Certificate) -> Self
Converts to this type from the input type.
Source§impl FromWasmAbi for Certificate
impl FromWasmAbi for Certificate
Source§impl IntoWasmAbi for Certificate
impl IntoWasmAbi for Certificate
Source§impl LongRefFromWasmAbi for Certificate
impl LongRefFromWasmAbi for Certificate
Source§type Abi = WasmPtr<WasmRefCell<Certificate>>
type Abi = WasmPtr<WasmRefCell<Certificate>>
Same as
RefFromWasmAbi::AbiSource§type Anchor = RcRef<Certificate>
type Anchor = RcRef<Certificate>
Same as
RefFromWasmAbi::AnchorSource§unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
Same as
RefFromWasmAbi::ref_from_abiSource§impl OptionFromWasmAbi for Certificate
impl OptionFromWasmAbi for Certificate
Source§impl OptionIntoWasmAbi for Certificate
impl OptionIntoWasmAbi for Certificate
Source§impl RefFromWasmAbi for Certificate
impl RefFromWasmAbi for Certificate
Source§type Abi = WasmPtr<WasmRefCell<Certificate>>
type Abi = WasmPtr<WasmRefCell<Certificate>>
The Wasm ABI type references to
Self are recovered from.Source§type Anchor = RcRef<Certificate>
type Anchor = RcRef<Certificate>
The type that holds the reference to
Self for the duration of the
invocation of the function that has an &Self parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Source§impl RefMutFromWasmAbi for Certificate
impl RefMutFromWasmAbi for Certificate
Source§type Abi = WasmPtr<WasmRefCell<Certificate>>
type Abi = WasmPtr<WasmRefCell<Certificate>>
Same as
RefFromWasmAbi::AbiSource§type Anchor = RcRefMut<Certificate>
type Anchor = RcRefMut<Certificate>
Same as
RefFromWasmAbi::AnchorSource§unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor
unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor
Same as
RefFromWasmAbi::ref_from_abiimpl SupportsConstructor for Certificate
impl SupportsInstanceProperty for Certificate
impl SupportsStaticProperty for Certificate
Source§impl TryFromJsValue for Certificate
impl TryFromJsValue for Certificate
Source§impl VectorFromWasmAbi for Certificate
impl VectorFromWasmAbi for Certificate
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[Certificate]>
Source§impl VectorIntoWasmAbi for Certificate
impl VectorIntoWasmAbi for Certificate
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[Certificate]>) -> Self::Abi
Source§impl WasmDescribeVector for Certificate
impl WasmDescribeVector for Certificate
Auto Trait Implementations§
impl Freeze for Certificate
impl RefUnwindSafe for Certificate
impl Send for Certificate
impl Sync for Certificate
impl Unpin for Certificate
impl UnsafeUnpin for Certificate
impl UnwindSafe for Certificate
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
Mutably borrows from an owned value. Read more
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.