Skip to main content

Keeper

Struct Keeper 

Source
pub struct Keeper {
    pub gbls: Suber,
    pub pris: CryptSignerSuber,
    pub prxs: CesrSuber<Cipher>,
    pub nxts: CesrSuber<Cipher>,
    pub pres: CesrSuber<Prefixer>,
    pub prms: Komer<PrePrm>,
    pub sits: Komer<PreSit>,
    pub pubs: Komer<PubSet>,
    /* private fields */
}
Expand description

Keeper struct for key pair storage (KS) Sets up named sub databases for key pair storage. Methods provide key pair creation, storage, and data signing.

Fields§

§gbls: Suber

Global parameters for all prefixes Key is parameter label, Value is parameter

§pris: CryptSignerSuber

Private keys database Key is public key (fully qualified qb64) Value is private key (fully qualified qb64)

§prxs: CesrSuber<Cipher>

Encrypted private keys database Key is identifier prefix (fully qualified qb64) Value is encrypted private key

§nxts: CesrSuber<Cipher>

Next key digests database Key is identifier prefix (fully qualified qb64) Value is next key commitment (digest)

§pres: CesrSuber<Prefixer>

Prefixes database Key is first public key in key sequence for a prefix (fully qualified qb64) Value is prefix or first public key (temporary) (fully qualified qb64)

§prms: Komer<PrePrm>

Prefix parameters database Key is identifier prefix (fully qualified qb64) Value is serialized parameter dict of public key parameters

§sits: Komer<PreSit>

Prefix situation database Key is identifier prefix (fully qualified qb64) Value is serialized parameter dict of public key situation

§pubs: Komer<PubSet>

Public keys database Key is prefix.ridx (rotation index as 32 char hex string) Value is serialized list of fully qualified public keys

Implementations§

Source§

impl Keeper

Source

pub const MAX_NAMED_DBS: u32 = 10

Maximum number of named databases

Source

pub fn new(lmdber: Arc<LMDBer>) -> Result<Self, DBError>

Create a new Keeper instance

Source

pub fn opened(&self) -> bool

Check if database is opened

Source

pub fn name(&self) -> String

Get name of database

Source

pub fn path(&self) -> Option<PathBuf>

Get database path

Source

pub fn temp(&self) -> bool

Close the database Check if database is temporary

Source

pub fn ri_key(pre: &str, ri: u64) -> String

Create a key to access the pubs database with prefix and rotation index

Trait Implementations§

Source§

impl Filer for Keeper

Source§

const TAIL_DIR_PATH: &'static str = "keri/ks"

Default relative directory path tail when using head
Source§

const ALT_TAIL_DIR_PATH: &'static str = ".keri/ks"

Default alternative relative directory path tail as fallback
Source§

const TEMP_PREFIX: &'static str = "keri_ks_"

Default relative directory path prefix when using temp head
Source§

fn defaults() -> FilerDefaults

Source§

const HEAD_DIR_PATH: &'static str = "/usr/local/var"

Default absolute directory path head such as “/usr/local/var”
Source§

const CLEAN_TAIL_DIR_PATH: &'static str = "keri/clean"

Default relative directory path tail when creating clean
Source§

const ALT_CLEAN_TAIL_DIR_PATH: &'static str = ".keri/clean"

Default alternative relative path tail when creating clean
Source§

const TEMP_HEAD_DIR: &'static str = "/tmp"

Default relative directory path prefix when using temp head
Source§

const PERM: u32 = 0o1700

Explicit default octal permissions such as 0o1700
Source§

const MODE: &'static str = "r+"

Open mode such as “r+”
Source§

const FEXT: &'static str = "text"

Default file extension such as “text” for “fname.text”
Source§

impl KeeperTrait for Keeper

Source§

fn opened(&self) -> bool

Check if database is opened
Source§

fn name(&self) -> String

Get name of database
Source§

fn path(&self) -> Option<PathBuf>

Get database path
Source§

fn temp(&self) -> bool

Check if database is temporary
Source§

fn ri_key(&self, pre: &str, ri: u64) -> String

Create a key to access the pubs database with prefix and rotation index

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.

§

impl<T> Instrument for T

§

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

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

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> 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.
§

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

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