pub struct Certificate { /* private fields */ }Expand description
Owned DER-backed SecCertificateRef.
Implementations§
Source§impl Certificate
impl Certificate
Sourcepub fn from_der(der: &[u8]) -> Result<Self>
pub fn from_der(der: &[u8]) -> Result<Self>
Create a certificate from DER-encoded bytes.
§Errors
Returns an error if the bytes are not a valid DER-encoded X.509 certificate.
Sourcepub const fn as_raw(&self) -> SecCertificateRef
pub const fn as_raw(&self) -> SecCertificateRef
Borrow the raw SecCertificateRef.
Sourcepub fn subject_summary(&self) -> Option<String>
pub fn subject_summary(&self) -> Option<String>
Return the subject-summary string, when Security.framework can derive one.
Sourcepub fn der_data(&self) -> Result<Vec<u8>>
pub fn der_data(&self) -> Result<Vec<u8>>
Export the certificate back to DER.
§Errors
Returns an error if Security.framework cannot serialize the certificate.
Sourcepub fn public_key(&self) -> Result<PublicKey>
pub fn public_key(&self) -> Result<PublicKey>
Copy the certificate’s public key.
§Errors
Returns an error if the certificate’s public key cannot be extracted.
Trait Implementations§
Source§impl Debug for Certificate
impl Debug for Certificate
Source§impl Drop for Certificate
impl Drop 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