Struct Uninit

Source
pub struct Uninit { /* private fields */ }
Expand description

A CA instance that has a database, which is (possibly) not initialized yet. No backend for private key operations is available at this stage.

Implementations§

Source§

impl Uninit

Source

pub fn new(db_url: Option<&str>) -> Result<Self>

Instantiate a new Uninit object (with db, but without private key backend).

This CA may be fully uninitialized and not be linked to a CA key yet.

The SQLite backend filename can be configured:

  • explicitly via the db_url parameter, or
  • the environment variable OPENPGP_CA_DB.
Source

pub fn init_softkey( self, domainname: &str, name: Option<&str>, cipher_suite: Option<CipherSuite>, ) -> Result<Oca>

Init CA with softkey backend.

This generates a new OpenPGP Key for the Admin role and stores the private Key in the OpenPGP CA database.

domainname is the domain that this CA Admin is in charge of, name is a descriptive name for the CA Admin

Source

pub fn init_card_generate_on_card( self, ident: &str, domain: &str, name: Option<&str>, algo: Option<AlgoSimple>, ) -> Result<Oca>

Init CA with OpenPGP card backend. Generate key material on the card.

This assumes that:

  • all key slots on the card are currently empty
  • the PINs are set to their default values (User PIN is ‘123456’, Admin PIN is ‘12345678’)

The User PIN is changed to a new, random 8-digit value and persisted in the CA database.

The user is encouraged to change the Admin PIN to a different setting.

Source

pub fn init_card_generate_on_host( self, ident: &str, domain: &str, name: Option<&str>, cipher_suite: Option<CipherSuite>, ) -> Result<(Oca, String)>

Source

pub fn init_card_import_card( self, card_ident: &str, user_pin: &str, domain: &str, ca_cert: &[u8], ) -> Result<Oca>

Import the CA’s public key and use it with a pre-initialized OpenPGP card.

Source

pub fn init_card_import_key( self, card_ident: &str, domain: &str, ca_key: &[u8], ) -> Result<Oca>

Import existing CA private key onto a blank OpenPGP card.

Source

pub fn migrate_card_import_key(self, card_ident: &str) -> Result<Oca>

Migrate an existing softkey CA onto a blank OpenPGP card.

Caution: If you want to keep a backup of your CA private key material, you need to make it before calling this!

  1. The private CA key material gets imported to the blank OpenPGP card.

  2. The CA is then switched from the softkey backend to the card backend. The CA private key material in the database is replaced with the CA public key material.

  3. “VACUUM” is called on the database after removing the CA private key from the database. According to SQLite documentation, this will remove any traces of the key material from the database (however, no guarantees can be made about the underlying storage!).

Auto Trait Implementations§

§

impl Freeze for Uninit

§

impl !RefUnwindSafe for Uninit

§

impl !Send for Uninit

§

impl !Sync for Uninit

§

impl Unpin for Uninit

§

impl !UnwindSafe for Uninit

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoSql for T

Source§

fn into_sql<T>(self) -> Self::Expression
where Self: Sized + AsExpression<T>,

Convert self to an expression for Diesel’s query builder. Read more
Source§

fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
where &'a Self: AsExpression<T>,

Convert &self to an expression for Diesel’s query builder. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,