Struct sequoia_octopus_librnp::RnpContext [−][src]
Implementations
impl RnpContext
[src]
pub fn insert_cert(&mut self, cert: Cert)
[src]
Inserts a cert into the keystore.
This strips any secret key material.
Locking
This acquires a write lock on the keystore and, if the certificate is already present, a write lock on the certificate’s cell.
pub fn insert_cert_external(&mut self, cert: Cert)
[src]
Inserts a cert from an external source into the keystore.
This strips any secret key material.
certs from external sources won’t be serialized.
Locking
This acquires a write lock on the keystore and, if the certificate is already present, a write lock on the certificate’s cell.
pub fn insert_key(&mut self, cert: Cert)
[src]
Inserts a key into the keystore.
Secret key material is preserved.
Locking
This acquires a write lock on the keystore and, if the certificate is already present, a write lock on the certificate’s cell.
pub fn cert(&self, by: &RnpIdentifier) -> Option<Cert>
[src]
Retrieves a certificate from the keystore by userid.
RNP searches both the certring and the keyring, and the keyhandle can thus refer to two certificates, potentially different versions of the same, or even different certificates! Since we merge the key keyrings, this is not a problem for us.
Locking
This acquires a read lock on the keystore and one or more certificates’ cells. See the corresponding search methods for details.
pub fn cert_by_userid(&self, uid: &UserID) -> Option<Cert>
[src]
Retrieves a certificate by userid.
XXX: This is super dodgy. rnp.h says “Note: only valid userids are checked while searching by userid.” but it is not clear what that means.
XXX: I think it would be better to fail these lookups. Are they used by TB?
Locking
This acquires a read lock on the keystore. Currently, this function performs a linear scan of all keys. As such, it potentially acquires (in turn) a read lock on all of the certificates’ cells.
pub fn cert_by_subkey_fp(&self, fp: &Fingerprint) -> Option<Cert>
[src]
Retrieves a certificate from the keystore by (sub)key fingerprint.
Locking
This acquires a read lock on the keystore and, if a matching certificate is present, a read lock on the certificate’s cell.
pub fn cert_by_subkey_id(&self, id: &KeyID) -> Option<Cert>
[src]
Retrieves a certificate from the keystore by (sub)key keyid.
Locking
This acquires a read lock on the keystore and, if a matching certificate is present, a read lock on the certificate’s cell.
pub fn cert_by_subkey_grip(&self, grip: &Keygrip) -> Option<Cert>
[src]
Retrieves a certificate from the keystore by (sub)key keygrip.
Locking
This acquires a read lock on the keystore and, if a matching certificate is present, a read lock on the certificate’s cell.
impl RnpContext
[src]
pub fn request_password(
&mut self,
cert: Option<&Cert>,
reason: RnpPasswordFor
) -> Option<Password>
[src]
&mut self,
cert: Option<&Cert>,
reason: RnpPasswordFor
) -> Option<Password>
pub fn decrypt_key_for(
&mut self,
cert: Option<&Cert>,
key: Key<SecretParts, UnspecifiedRole>,
reason: RnpPasswordFor
) -> Result<Key<SecretParts, UnspecifiedRole>>
[src]
&mut self,
cert: Option<&Cert>,
key: Key<SecretParts, UnspecifiedRole>,
reason: RnpPasswordFor
) -> Result<Key<SecretParts, UnspecifiedRole>>
Decrypts the given key, if necessary.
pub fn key_is_locked(&mut self, key: &Key<SecretParts, UnspecifiedRole>) -> bool
[src]
Returns false iff the key has not been unlocked.
pub fn key_lock(&mut self, key: &Key<SecretParts, UnspecifiedRole>)
[src]
Locks the key.
pub fn key_unlock(
&mut self,
key: Key<SecretParts, UnspecifiedRole>,
password: Option<Password>
) -> Result<()>
[src]
&mut self,
key: Key<SecretParts, UnspecifiedRole>,
password: Option<Password>
) -> Result<()>
Unlocks the key.
If password
is None, this function will ask for a password
using the callback.
Trait Implementations
impl Default for RnpContext
[src]
fn default() -> RnpContext
[src]
Auto Trait Implementations
impl !RefUnwindSafe for RnpContext
impl !Send for RnpContext
impl !Sync for RnpContext
impl Unpin for RnpContext
impl !UnwindSafe for RnpContext
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
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.
pub 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.
pub 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>,