Struct security_framework::certificate::SecCertificate
source · pub struct SecCertificate(/* private fields */);
Expand description
A type representing a certificate.
Implementations§
source§impl SecCertificate
impl SecCertificate
sourcepub fn from_der(der_data: &[u8]) -> Result<Self>
pub fn from_der(der_data: &[u8]) -> Result<Self>
Creates a SecCertificate
from DER encoded certificate data.
sourcepub fn subject_summary(&self) -> String
pub fn subject_summary(&self) -> String
Returns a human readable summary of this certificate.
sourcepub fn email_addresses(&self) -> Result<Vec<String>, Error>
pub fn email_addresses(&self) -> Result<Vec<String>, Error>
Returns a vector of email addresses for the subject of the certificate.
sourcepub fn issuer(&self) -> Vec<u8>
pub fn issuer(&self) -> Vec<u8>
Returns DER encoded X.509 distinguished name of the certificate issuer.
sourcepub fn subject(&self) -> Vec<u8>
pub fn subject(&self) -> Vec<u8>
Returns DER encoded X.509 distinguished name of the certificate subject.
sourcepub fn serial_number_bytes(&self) -> Result<Vec<u8>, CFError>
pub fn serial_number_bytes(&self) -> Result<Vec<u8>, CFError>
Returns DER encoded serial number of the certificate.
sourcepub fn serial_number(&self) -> Result<BigUint, CFError>
👎Deprecated: use serial_number_bytes()
pub fn serial_number(&self) -> Result<BigUint, CFError>
Use BigUint::from_bytes_be(serial_number_bytes())
instead
sourcepub fn public_key_info_der(&self) -> Result<Option<Vec<u8>>>
pub fn public_key_info_der(&self) -> Result<Option<Vec<u8>>>
Returns DER encoded subjectPublicKeyInfo of certificate if available. This can be used for certificate pinning.
sourcepub fn public_key(&self) -> Result<SecKey>
pub fn public_key(&self) -> Result<SecKey>
Get public key from certificate
Trait Implementations§
source§impl Clone for SecCertificate
impl Clone for SecCertificate
source§fn clone(&self) -> SecCertificate
fn clone(&self) -> SecCertificate
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for SecCertificate
impl Debug for SecCertificate
source§impl Drop for SecCertificate
impl Drop for SecCertificate
source§impl PartialEq for SecCertificate
impl PartialEq for SecCertificate
source§fn eq(&self, other: &SecCertificate) -> bool
fn eq(&self, other: &SecCertificate) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl TCFType for SecCertificate
impl TCFType for SecCertificate
§type Ref = *mut OpaqueSecCertificateRef
type Ref = *mut OpaqueSecCertificateRef
The reference type wrapped inside this type.
source§fn as_concrete_TypeRef(&self) -> SecCertificateRef
fn as_concrete_TypeRef(&self) -> SecCertificateRef
Returns the object as its concrete
TypeRef
.source§unsafe fn wrap_under_get_rule(reference: SecCertificateRef) -> Self
unsafe fn wrap_under_get_rule(reference: SecCertificateRef) -> Self
Returns an instance of the object, wrapping the underlying
CFTypeRef
subclass. Use this
when following Core Foundation’s “Get Rule”. The reference count is bumped.source§fn as_CFTypeRef(&self) -> CFTypeRef
fn as_CFTypeRef(&self) -> CFTypeRef
Returns the object as a raw
CFTypeRef
. The reference count is not adjusted.source§unsafe fn wrap_under_create_rule(reference: SecCertificateRef) -> Self
unsafe fn wrap_under_create_rule(reference: SecCertificateRef) -> Self
Returns an instance of the object, wrapping the underlying
CFTypeRef
subclass. Use this
when following Core Foundation’s “Create Rule”. The reference count is not bumped.source§fn as_CFType(&self) -> CFType
fn as_CFType(&self) -> CFType
Returns the object as a wrapped
CFType
. The reference count is incremented by one.source§fn into_CFType(self) -> CFTypewhere
Self: Sized,
fn into_CFType(self) -> CFTypewhere
Self: Sized,
Returns the object as a wrapped
CFType
. Consumes self and avoids changing the reference
count.source§fn retain_count(&self) -> isize
fn retain_count(&self) -> isize
Returns the reference count of the object. It is unwise to do anything other than test
whether the return value of this method is greater than zero.
source§fn instance_of<OtherCFType>(&self) -> boolwhere
OtherCFType: TCFType,
fn instance_of<OtherCFType>(&self) -> boolwhere
OtherCFType: TCFType,
Returns
true
if this value is an instance of another type.source§impl<'a> ToVoid<SecCertificate> for &'a SecCertificate
impl<'a> ToVoid<SecCertificate> for &'a SecCertificate
source§impl ToVoid<SecCertificate> for SecCertificateRef
impl ToVoid<SecCertificate> for SecCertificateRef
source§impl ToVoid<SecCertificate> for SecCertificate
impl ToVoid<SecCertificate> for SecCertificate
impl ConcreteCFType for SecCertificate
impl Eq for SecCertificate
impl Send for SecCertificate
impl Sync for SecCertificate
Auto Trait Implementations§
impl Freeze for SecCertificate
impl RefUnwindSafe for SecCertificate
impl Unpin for SecCertificate
impl UnwindSafe for SecCertificate
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)