Struct security_framework::certificate::SecCertificate
source · pub struct SecCertificate(_);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.
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<SecCertificate> for SecCertificate
impl PartialEq<SecCertificate> 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 SecCertificateExt for SecCertificate
impl SecCertificateExt for SecCertificate
source§fn fingerprint(&self) -> Result<[u8; 32], CFError>
fn fingerprint(&self) -> Result<[u8; 32], CFError>
Returns the SHA-256 fingerprint of the certificate.
source§fn common_name(&self) -> Result<String, Error>
fn common_name(&self) -> Result<String, Error>
Returns the common name associated with the certificate.
source§fn public_key(&self) -> Result<SecKey, Error>
fn public_key(&self) -> Result<SecKey, Error>
👎Deprecated: Uses deprecated SecCertificateCopyPublicKey. Enable OSX_10_14 feature to avoid it
Returns the public key associated with the certificate.
source§fn properties(
&self,
keys: Option<&[CertificateOid]>
) -> Result<CertificateProperties, CFError>
fn properties(
&self,
keys: Option<&[CertificateOid]>
) -> Result<CertificateProperties, CFError>
Returns the set of properties associated with the certificate. Read more
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.