[−][src]Struct sequoia_openpgp::cert::CertBuilder
Simplifies generation of Keys.
Builder to generate complex Cert hierarchies with multiple user IDs.
Methods
impl CertBuilder
[src]
pub fn new() -> Self
[src]
Returns a new CertBuilder.
The returned CertBuilder is setup to only create a
certification-capable primary key using the default cipher
suite. You'll almost certainly want to add subkeys (using
CertBuilder::add_signing_subkey
, or
CertBuilder::add_transport_encryption_subkey
, for instance), and user
ids (using CertBuilder::add_userid
).
pub fn general_purpose<C, U>(ciphersuite: C, userids: Option<U>) -> Self where
C: Into<Option<CipherSuite>>,
U: Into<UserID>,
[src]
C: Into<Option<CipherSuite>>,
U: Into<UserID>,
Generates a general-purpose key.
The key's primary key is certification- and signature-capable. The key has one subkey, an encryption-capable subkey.
pub fn autocrypt<'a, V, U>(version: V, userid: Option<U>) -> Self where
V: Into<Option<Autocrypt>>,
U: Into<UserID>,
[src]
V: Into<Option<Autocrypt>>,
U: Into<UserID>,
Generates a key compliant to Autocrypt.
If no version is given the latest one is used.
The autocrypt specification requires a UserID. However, because it can be useful to add the UserID later, it is permitted to be none.
pub fn set_cipher_suite(self, cs: CipherSuite) -> Self
[src]
Sets the encryption and signature algorithms for primary and all subkeys.
pub fn add_userid<'a, U>(self, uid: U) -> Self where
U: Into<UserID>,
[src]
U: Into<UserID>,
Adds a new user ID. The first user ID added will be the primary user ID.
pub fn add_user_attribute<'a, U>(self, ua: U) -> Self where
U: Into<UserAttribute>,
[src]
U: Into<UserAttribute>,
Adds a new user attribute.
pub fn add_signing_subkey(self) -> Self
[src]
Adds a signing capable subkey.
pub fn add_transport_encryption_subkey(self) -> Self
[src]
Adds a subkey suitable for transport encryption.
pub fn add_storage_encryption_subkey(self) -> Self
[src]
Adds a subkey suitable for storage encryption.
pub fn add_certification_subkey(self) -> Self
[src]
Adds an certification capable subkey.
pub fn add_authentication_subkey(self) -> Self
[src]
Adds an authentication capable subkey.
pub fn add_subkey<T>(self, flags: KeyFlags, expiration: T) -> Self where
T: Into<Option<Duration>>,
[src]
T: Into<Option<Duration>>,
Adds a custom subkey.
If expiration
is None
, the subkey uses the same expiration
time as the primary key.
pub fn primary_keyflags(self, flags: KeyFlags) -> Self
[src]
Sets the capabilities of the primary key. The function automatically makes the primary key certification capable if subkeys are added.
pub fn set_password(self, password: Option<Password>) -> Self
[src]
Sets a password to encrypt the secret keys with.
pub fn set_expiration<T>(self, expiration: T) -> Self where
T: Into<Option<Duration>>,
[src]
T: Into<Option<Duration>>,
Sets the expiration time.
A value of None means never.
pub fn generate(self) -> Result<(Cert, Signature)>
[src]
Generates the actual Cert.
Trait Implementations
impl Clone for CertBuilder
[src]
fn clone(&self) -> CertBuilder
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for CertBuilder
[src]
Auto Trait Implementations
impl RefUnwindSafe for CertBuilder
impl Send for CertBuilder
impl Sync for CertBuilder
impl Unpin for CertBuilder
impl UnwindSafe for CertBuilder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,