pub struct Identity { /* private fields */ }Expand description
Wraps SecIdentityRef.
Implementations§
Source§impl Identity
impl Identity
Sourcepub fn import_pkcs12_first(data: &[u8], password: &str) -> Result<Self>
pub fn import_pkcs12_first(data: &[u8], password: &str) -> Result<Self>
Wraps the corresponding SecIdentityRef operation.
Examples found in repository?
examples/02_identity_pkcs12.rs (line 8)
6fn main() -> Result<(), Box<dyn std::error::Error>> {
7 let identity =
8 Identity::import_pkcs12_first(&support::fixture("test-identity.p12"), "password")?;
9 let certificate = identity.certificate()?;
10 println!(
11 "label={:?} chain_count={} subject={:?}",
12 identity.label()?,
13 identity.chain_count(),
14 certificate.subject_summary()?
15 );
16 Ok(())
17}Sourcepub fn from_certificate_and_private_key(
certificate: &Certificate,
private_key: &PrivateKey,
) -> Result<Self>
pub fn from_certificate_and_private_key( certificate: &Certificate, private_key: &PrivateKey, ) -> Result<Self>
Wraps the corresponding SecIdentityRef operation.
Sourcepub fn with_certificate(certificate: &Certificate) -> Result<Self>
pub fn with_certificate(certificate: &Certificate) -> Result<Self>
Wraps the corresponding SecIdentityRef operation.
Sourcepub fn preferred(
name: &str,
key_usage: &[&str],
valid_issuers: &[Vec<u8>],
) -> Result<Option<Self>>
pub fn preferred( name: &str, key_usage: &[&str], valid_issuers: &[Vec<u8>], ) -> Result<Option<Self>>
Wraps the corresponding SecIdentityRef operation.
Sourcepub fn set_preferred(
identity: Option<&Self>,
name: &str,
key_usage: &[&str],
) -> Result<()>
pub fn set_preferred( identity: Option<&Self>, name: &str, key_usage: &[&str], ) -> Result<()>
Wraps the corresponding SecIdentityRef operation.
Sourcepub fn copy_system_identity(domain: &str) -> Result<Self>
pub fn copy_system_identity(domain: &str) -> Result<Self>
Wraps the corresponding SecIdentityRef operation.
Sourcepub fn set_system_identity(domain: &str, identity: Option<&Self>) -> Result<()>
pub fn set_system_identity(domain: &str, identity: Option<&Self>) -> Result<()>
Wraps the corresponding SecIdentityRef operation.
Sourcepub fn actual_domain(&self) -> Result<Option<String>>
pub fn actual_domain(&self) -> Result<Option<String>>
Wraps the corresponding SecIdentityRef operation.
Sourcepub fn label(&self) -> Result<Option<String>>
pub fn label(&self) -> Result<Option<String>>
Wraps the corresponding SecIdentityRef operation.
Examples found in repository?
examples/02_identity_pkcs12.rs (line 12)
6fn main() -> Result<(), Box<dyn std::error::Error>> {
7 let identity =
8 Identity::import_pkcs12_first(&support::fixture("test-identity.p12"), "password")?;
9 let certificate = identity.certificate()?;
10 println!(
11 "label={:?} chain_count={} subject={:?}",
12 identity.label()?,
13 identity.chain_count(),
14 certificate.subject_summary()?
15 );
16 Ok(())
17}Sourcepub fn chain_count(&self) -> usize
pub fn chain_count(&self) -> usize
Wraps the corresponding SecIdentityRef operation.
Examples found in repository?
examples/02_identity_pkcs12.rs (line 13)
6fn main() -> Result<(), Box<dyn std::error::Error>> {
7 let identity =
8 Identity::import_pkcs12_first(&support::fixture("test-identity.p12"), "password")?;
9 let certificate = identity.certificate()?;
10 println!(
11 "label={:?} chain_count={} subject={:?}",
12 identity.label()?,
13 identity.chain_count(),
14 certificate.subject_summary()?
15 );
16 Ok(())
17}Sourcepub fn certificate(&self) -> Result<Certificate>
pub fn certificate(&self) -> Result<Certificate>
Wraps the corresponding SecIdentityRef operation.
Examples found in repository?
examples/02_identity_pkcs12.rs (line 9)
6fn main() -> Result<(), Box<dyn std::error::Error>> {
7 let identity =
8 Identity::import_pkcs12_first(&support::fixture("test-identity.p12"), "password")?;
9 let certificate = identity.certificate()?;
10 println!(
11 "label={:?} chain_count={} subject={:?}",
12 identity.label()?,
13 identity.chain_count(),
14 certificate.subject_summary()?
15 );
16 Ok(())
17}Sourcepub fn private_key_attributes(&self) -> Result<Value>
pub fn private_key_attributes(&self) -> Result<Value>
Wraps the corresponding SecIdentityRef operation.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Identity
impl RefUnwindSafe for Identity
impl !Send for Identity
impl !Sync for Identity
impl Unpin for Identity
impl UnsafeUnpin for Identity
impl UnwindSafe for Identity
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