pub struct DatabaseKey { /* private fields */ }Expand description
A signing key bound to its identity in a database’s auth settings.
Pairs the cryptographic signing key with information about how to look up
permissions in the database’s auth configuration. The identity determines
which entry in _settings.auth this key maps to.
Implementations§
Source§impl DatabaseKey
impl DatabaseKey
Sourcepub fn new(signing_key: PrivateKey) -> Self
pub fn new(signing_key: PrivateKey) -> Self
Identity = pubkey derived from signing key. Most common case.
Sourcepub fn with_identity(signing_key: PrivateKey, identity: SigKey) -> Self
pub fn with_identity(signing_key: PrivateKey, identity: SigKey) -> Self
Identity = explicit SigKey (name, global, delegation, etc.)
Sourcepub fn global(signing_key: PrivateKey) -> Self
pub fn global(signing_key: PrivateKey) -> Self
Identity = global permission with actual pubkey embedded for verification.
Sourcepub fn with_name(signing_key: PrivateKey, name: impl Into<String>) -> Self
pub fn with_name(signing_key: PrivateKey, name: impl Into<String>) -> Self
Identity = key name lookup.
Sourcepub fn signing_key(&self) -> &PrivateKey
pub fn signing_key(&self) -> &PrivateKey
Get the signing key.
Sourcepub fn public_key(&self) -> PublicKey
pub fn public_key(&self) -> PublicKey
Get the public key.
Sourcepub fn into_parts(self) -> (PrivateKey, SigKey)
pub fn into_parts(self) -> (PrivateKey, SigKey)
Consume self and return the parts.
Trait Implementations§
Source§impl Clone for DatabaseKey
impl Clone for DatabaseKey
Source§fn clone(&self) -> DatabaseKey
fn clone(&self) -> DatabaseKey
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DatabaseKey
impl RefUnwindSafe for DatabaseKey
impl Send for DatabaseKey
impl Sync for DatabaseKey
impl Unpin for DatabaseKey
impl UnwindSafe for DatabaseKey
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more