Struct openssl::x509::X509Generator
[−]
[src]
pub struct X509Generator { /* fields omitted */ }
: use X509Builder and X509ReqBuilder instead
Methods
impl X509Generator
[src]
fn new() -> X509Generator
: use X509Builder and X509ReqBuilder instead
Creates a new generator with the following defaults:
validity period: 365 days
CN: "rust-openssl"
hash: SHA1
fn set_valid_period(self, days: u32) -> X509Generator
: use X509Builder and X509ReqBuilder instead
Sets certificate validity period in days since today
fn add_name(self, attr_type: String, attr_value: String) -> X509Generator
: use X509Builder and X509ReqBuilder instead
Add attribute to the name of the certificate
generator.add_name("CN".to_string(),"example.com".to_string());
fn add_names<I>(self, attrs: I) -> X509Generator where I: IntoIterator<Item=(String, String)>
: use X509Builder and X509ReqBuilder instead
Add multiple attributes to the name of the certificate
generator.add_names(vec![("CN".to_string(),"example.com".to_string())]);
fn add_extension(self, ext: Extension) -> X509Generator
: use X509Builder and X509ReqBuilder instead
Add an extension to a certificate
If the extension already exists, it will be replaced.
use openssl::x509::extension::Extension::*; use openssl::x509::extension::KeyUsageOption::*; generator.add_extension(KeyUsage(vec![DigitalSignature, KeyEncipherment]));
fn add_extensions<I>(self, exts: I) -> X509Generator where I: IntoIterator<Item=Extension>
: use X509Builder and X509ReqBuilder instead
Add multiple extensions to a certificate
If any of the extensions already exist, they will be replaced.
use openssl::x509::extension::Extension::*; use openssl::x509::extension::KeyUsageOption::*; generator.add_extensions(vec![KeyUsage(vec![DigitalSignature, KeyEncipherment])]);
fn set_sign_hash(self, hash_type: MessageDigest) -> X509Generator
: use X509Builder and X509ReqBuilder instead
fn sign(&self, p_key: &PKeyRef) -> Result<X509, ErrorStack>
: use X509Builder and X509ReqBuilder instead
Sets the certificate public-key, then self-sign and return it
fn request(&self, p_key: &PKeyRef) -> Result<X509Req, ErrorStack>
: use X509Builder and X509ReqBuilder instead
Obtain a certificate signing request (CSR)