pub struct Keystore { /* private fields */ }

Implementations§

source§

impl Keystore

source

pub fn start_parcimonie(&mut self, policy: StandardPolicy<'static>)

source

pub fn enable_wot(&mut self, policy: &StandardPolicy<'static>) -> Result<()>

source

pub fn update_wot(&mut self, policy: &StandardPolicy<'static>) -> Result<()>

source

pub fn create_ref(&self) -> Arc<RwLock<KeystoreData>>

source

pub fn read(&self) -> RwLockReadGuard<'_, KeystoreData>

source

pub fn write(&self) -> RwLockWriteGuard<'_, KeystoreData>

source

pub fn key_on_agent(&self, key: &Fingerprint) -> bool

Returns whether the key appears to be on the gpg agent.

This is at most a few seconds out of date.

source

pub fn set_directory(&mut self, directory: PathBuf)

source

pub fn load_gpg_keyring( &mut self, policy: Arc<RwLock<StandardPolicy<'static>>> ) -> Result<()>

Load the gpg keyring into the keystore.

Parse and load a keyring. If this encounters some corruption in the keyring and is able to recover, it does not report an error.

This also starts a thread to monitor the gpg store. This imports updates from the gpg keyring (XXX: but not removals!).

source

pub fn load_keyring_in_background( &mut self, keyring: Vec<u8>, import_secret_keys: bool, policy: Arc<RwLock<StandardPolicy<'static>>> ) -> Result<()>

Loads the specified keyring in the background.

If import_secret_keys is true, then it also imports any secret key material. Otherwise, secret key material is stripped.

source

pub fn block_on_load(&mut self) -> Result<bool>

Blocks the current thread until any keyrings that are being loaded in the background have been loaded.

This includes the initial load of the gpg keyring, and any keyrings added via Keystore::load_keyring_in_background.

Returns whether we blocked.

Trait Implementations§

source§

impl Debug for Keystore

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Keystore

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

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

§

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>,

§

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