pub struct Identity { /* private fields */ }Implementations§
Source§impl Identity
impl Identity
pub fn type_id() -> usize
Sourcepub fn import_pkcs12_first(data: &[u8], password: &str) -> Result<Self>
pub fn import_pkcs12_first(data: &[u8], password: &str) -> Result<Self>
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}pub fn from_certificate_and_private_key( certificate: &Certificate, private_key: &PrivateKey, ) -> Result<Self>
pub fn with_certificate(certificate: &Certificate) -> Result<Self>
pub fn preferred( name: &str, key_usage: &[&str], valid_issuers: &[Vec<u8>], ) -> Result<Option<Self>>
pub fn set_preferred( identity: Option<&Self>, name: &str, key_usage: &[&str], ) -> Result<()>
pub fn copy_system_identity(domain: &str) -> Result<Self>
pub fn set_system_identity(domain: &str, identity: Option<&Self>) -> Result<()>
pub fn actual_domain(&self) -> Result<Option<String>>
Sourcepub fn label(&self) -> Result<Option<String>>
pub fn label(&self) -> Result<Option<String>>
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
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>
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}pub fn private_key_attributes(&self) -> Result<Value>
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