[−][src]Struct sequoia_store::Key
Represents a key in the store.
A Key
is a handle to a stored Cert. We make this explicit
because we associate metadata with Certs.
Implementations
impl Key
[src]
pub fn cert(&self) -> Result<Cert>
[src]
Returns the Cert.
pub fn stats(&self) -> Result<Stats>
[src]
Returns stats for this key.
pub fn import(&self, cert: &Cert) -> Result<Cert>
[src]
Updates this stored key with the given Cert.
If the new key cert
matches the current key, i.e. they have
the same fingerprint, both keys are merged and normalized.
The returned key contains all packets known to Sequoia, and
should be used instead of cert
.
If the new key does not match the current key,
Error::Conflict
is returned.
Examples
let mapping = Mapping::open(&ctx, net::Policy::Offline, REALM_CONTACTS, "default")?; let fp = "3E8877C877274692975189F5D03F6F865226FE8B".parse().unwrap(); let binding = mapping.add("Testy McTestface", &fp)?; let key = binding.key()?; let r = key.import(&old)?; assert_eq!(r.fingerprint(), old.fingerprint()); let r = key.import(&new); assert!(r.is_err()); // conflict
pub fn log(&self) -> Result<LogIter>
[src]
Lists all log entries related to this key.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Key
impl !Send for Key
impl !Sync for Key
impl Unpin for Key
impl !UnwindSafe for Key
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> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
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.
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>,
fn vzip(self) -> V
impl<T> WithSubscriber for T
[src]
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,