pub struct Policy { /* private fields */ }Implementations§
Source§impl Policy
impl Policy
Sourcepub fn basic_x509() -> Result<Self>
pub fn basic_x509() -> Result<Self>
Examples found in repository?
More examples
examples/04_policy_properties.rs (line 4)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4 let basic = Policy::basic_x509()?;
5 let ssl = Policy::ssl(true, Some("localhost"))?;
6 let custom_ssl = Policy::with_properties(
7 PolicyIdentifier::AppleSsl,
8 &PolicyProperties {
9 name: Some(PolicyName::from("localhost")),
10 client: Some(false),
11 ..PolicyProperties::default()
12 },
13 )?;
14 let revocation = Policy::revocation(0)?;
15 println!(
16 "basic={:?} ssl={:?} custom_ssl={:?} revocation={:?}",
17 basic.properties()?,
18 ssl.properties()?,
19 custom_ssl.properties()?,
20 revocation.properties()?
21 );
22 Ok(())
23}Sourcepub fn ssl(server: bool, hostname: Option<&str>) -> Result<Self>
pub fn ssl(server: bool, hostname: Option<&str>) -> Result<Self>
Examples found in repository?
examples/04_policy_properties.rs (line 5)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4 let basic = Policy::basic_x509()?;
5 let ssl = Policy::ssl(true, Some("localhost"))?;
6 let custom_ssl = Policy::with_properties(
7 PolicyIdentifier::AppleSsl,
8 &PolicyProperties {
9 name: Some(PolicyName::from("localhost")),
10 client: Some(false),
11 ..PolicyProperties::default()
12 },
13 )?;
14 let revocation = Policy::revocation(0)?;
15 println!(
16 "basic={:?} ssl={:?} custom_ssl={:?} revocation={:?}",
17 basic.properties()?,
18 ssl.properties()?,
19 custom_ssl.properties()?,
20 revocation.properties()?
21 );
22 Ok(())
23}Sourcepub fn revocation(flags: RevocationFlags) -> Result<Self>
pub fn revocation(flags: RevocationFlags) -> Result<Self>
Examples found in repository?
examples/04_policy_properties.rs (line 14)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4 let basic = Policy::basic_x509()?;
5 let ssl = Policy::ssl(true, Some("localhost"))?;
6 let custom_ssl = Policy::with_properties(
7 PolicyIdentifier::AppleSsl,
8 &PolicyProperties {
9 name: Some(PolicyName::from("localhost")),
10 client: Some(false),
11 ..PolicyProperties::default()
12 },
13 )?;
14 let revocation = Policy::revocation(0)?;
15 println!(
16 "basic={:?} ssl={:?} custom_ssl={:?} revocation={:?}",
17 basic.properties()?,
18 ssl.properties()?,
19 custom_ssl.properties()?,
20 revocation.properties()?
21 );
22 Ok(())
23}Sourcepub fn with_properties(
identifier: PolicyIdentifier,
properties: &PolicyProperties,
) -> Result<Self>
pub fn with_properties( identifier: PolicyIdentifier, properties: &PolicyProperties, ) -> Result<Self>
Examples found in repository?
examples/04_policy_properties.rs (lines 6-13)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4 let basic = Policy::basic_x509()?;
5 let ssl = Policy::ssl(true, Some("localhost"))?;
6 let custom_ssl = Policy::with_properties(
7 PolicyIdentifier::AppleSsl,
8 &PolicyProperties {
9 name: Some(PolicyName::from("localhost")),
10 client: Some(false),
11 ..PolicyProperties::default()
12 },
13 )?;
14 let revocation = Policy::revocation(0)?;
15 println!(
16 "basic={:?} ssl={:?} custom_ssl={:?} revocation={:?}",
17 basic.properties()?,
18 ssl.properties()?,
19 custom_ssl.properties()?,
20 revocation.properties()?
21 );
22 Ok(())
23}Sourcepub fn properties(&self) -> Result<Value>
pub fn properties(&self) -> Result<Value>
Examples found in repository?
examples/04_policy_properties.rs (line 17)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4 let basic = Policy::basic_x509()?;
5 let ssl = Policy::ssl(true, Some("localhost"))?;
6 let custom_ssl = Policy::with_properties(
7 PolicyIdentifier::AppleSsl,
8 &PolicyProperties {
9 name: Some(PolicyName::from("localhost")),
10 client: Some(false),
11 ..PolicyProperties::default()
12 },
13 )?;
14 let revocation = Policy::revocation(0)?;
15 println!(
16 "basic={:?} ssl={:?} custom_ssl={:?} revocation={:?}",
17 basic.properties()?,
18 ssl.properties()?,
19 custom_ssl.properties()?,
20 revocation.properties()?
21 );
22 Ok(())
23}Trait Implementations§
Auto Trait Implementations§
impl Freeze for Policy
impl RefUnwindSafe for Policy
impl !Send for Policy
impl !Sync for Policy
impl Unpin for Policy
impl UnsafeUnpin for Policy
impl UnwindSafe for Policy
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