[−][src]Struct openssl::x509::X509Builder  
A builder used to construct an X509.
Methods
impl X509Builder[src] 
impl X509Builderpub fn new() -> Result<X509Builder, ErrorStack>[src] 
pub fn new() -> Result<X509Builder, ErrorStack>Creates a new builder.
pub fn set_not_after(
    &mut self, 
    not_after: &Asn1TimeRef
) -> Result<(), ErrorStack>[src] 
pub fn set_not_after(
    &mut self, 
    not_after: &Asn1TimeRef
) -> Result<(), ErrorStack>Sets the notAfter constraint on the certificate.
pub fn set_not_before(
    &mut self, 
    not_before: &Asn1TimeRef
) -> Result<(), ErrorStack>[src] 
pub fn set_not_before(
    &mut self, 
    not_before: &Asn1TimeRef
) -> Result<(), ErrorStack>Sets the notBefore constraint on the certificate.
pub fn set_version(&mut self, version: i32) -> Result<(), ErrorStack>[src] 
pub fn set_version(&mut self, version: i32) -> Result<(), ErrorStack>Sets the version of the certificate.
Note that the version is zero-indexed; that is, a certificate corresponding to version 3 of
the X.509 standard should pass 2 to this method.
pub fn set_serial_number(
    &mut self, 
    serial_number: &Asn1IntegerRef
) -> Result<(), ErrorStack>[src] 
pub fn set_serial_number(
    &mut self, 
    serial_number: &Asn1IntegerRef
) -> Result<(), ErrorStack>Sets the serial number of the certificate.
pub fn set_issuer_name(
    &mut self, 
    issuer_name: &X509NameRef
) -> Result<(), ErrorStack>[src] 
pub fn set_issuer_name(
    &mut self, 
    issuer_name: &X509NameRef
) -> Result<(), ErrorStack>Sets the issuer name of the certificate.
pub fn set_subject_name(
    &mut self, 
    subject_name: &X509NameRef
) -> Result<(), ErrorStack>[src] 
pub fn set_subject_name(
    &mut self, 
    subject_name: &X509NameRef
) -> Result<(), ErrorStack>Sets the subject name of the certificate.
When building certificates, the C, ST, and O options are common when using the openssl command line tools.
The CN field is used for the common name, such as a DNS name.
use openssl::x509::{X509, X509NameBuilder}; let mut x509_name = openssl::x509::X509NameBuilder::new().unwrap(); x509_name.append_entry_by_text("C", "US").unwrap(); x509_name.append_entry_by_text("ST", "CA").unwrap(); x509_name.append_entry_by_text("O", "Some organization").unwrap(); x509_name.append_entry_by_text("CN", "www.example.com").unwrap(); let x509_name = x509_name.build(); let mut x509 = openssl::x509::X509::builder().unwrap(); x509.set_subject_name(&x509_name).unwrap();
pub fn set_pubkey<T>(&mut self, key: &PKeyRef<T>) -> Result<(), ErrorStack> where
    T: HasPublic, [src] 
pub fn set_pubkey<T>(&mut self, key: &PKeyRef<T>) -> Result<(), ErrorStack> where
    T: HasPublic, Sets the public key associated with the certificate.
pub fn x509v3_context<'a>(
    &'a self, 
    issuer: Option<&'a X509Ref>, 
    conf: Option<&'a ConfRef>
) -> X509v3Context<'a>[src] 
pub fn x509v3_context<'a>(
    &'a self, 
    issuer: Option<&'a X509Ref>, 
    conf: Option<&'a ConfRef>
) -> X509v3Context<'a>Returns a context object which is needed to create certain X509 extension values.
Set issuer to None if the certificate will be self-signed.
pub fn append_extension(
    &mut self, 
    extension: X509Extension
) -> Result<(), ErrorStack>[src] 
pub fn append_extension(
    &mut self, 
    extension: X509Extension
) -> Result<(), ErrorStack>Adds an X509 extension value to the certificate.
pub fn sign<T>(
    &mut self, 
    key: &PKeyRef<T>, 
    hash: MessageDigest
) -> Result<(), ErrorStack> where
    T: HasPrivate, [src] 
pub fn sign<T>(
    &mut self, 
    key: &PKeyRef<T>, 
    hash: MessageDigest
) -> Result<(), ErrorStack> where
    T: HasPrivate, Signs the certificate with a private key.
pub fn build(self) -> X509[src] 
pub fn build(self) -> X509Consumes the builder, returning the certificate.
Auto Trait Implementations
impl Send for X509Builder
impl Send for X509Builderimpl Sync for X509Builder
impl Sync for X509BuilderBlanket Implementations
impl<T> From for T[src] 
impl<T> From for Timpl<T, U> Into for T where
    U: From<T>, [src] 
impl<T, U> Into for T where
    U: From<T>, impl<T, U> TryFrom for T where
    T: From<U>, [src] 
impl<T, U> TryFrom for T where
    T: From<U>, type Error = !
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src] 
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>try_from)Performs the conversion.
impl<T> Borrow for T where
    T: ?Sized, [src] 
impl<T> Borrow for T where
    T: ?Sized, impl<T> BorrowMut for T where
    T: ?Sized, [src] 
impl<T> BorrowMut for T where
    T: ?Sized, fn borrow_mut(&mut self) -> &mut T[src] 
fn borrow_mut(&mut self) -> &mut TMutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
    U: TryFrom<T>, [src] 
impl<T, U> TryInto for T where
    U: TryFrom<T>, type Error = <U as TryFrom<T>>::Error
try_from)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src] 
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>try_from)Performs the conversion.
impl<T> Any for T where
    T: 'static + ?Sized, [src] 
impl<T> Any for T where
    T: 'static + ?Sized, fn get_type_id(&self) -> TypeId[src] 
fn get_type_id(&self) -> TypeId🔬 This is a nightly-only experimental API.  (get_type_id)
this method will likely be replaced by an associated static
Gets the TypeId of self. Read more