pub struct NamespaceSecret { /* private fields */ }Expand description
Namespace key of a crate::Replica.
Holders of this key can insert new entries into a crate::Replica.
Internally, a NamespaceSecret is a SigningKey which is used to sign entries.
Implementations§
Source§impl NamespaceSecret
 
impl NamespaceSecret
Sourcepub fn new<R: CryptoRngCore + ?Sized>(rng: &mut R) -> Self
 
pub fn new<R: CryptoRngCore + ?Sized>(rng: &mut R) -> Self
Create a new NamespaceSecret with a random key.
Sourcepub fn from_bytes(bytes: &[u8; 32]) -> Self
 
pub fn from_bytes(bytes: &[u8; 32]) -> Self
Create a NamespaceSecret from a byte array.
Sourcepub fn to_bytes(&self) -> [u8; 32]
 
pub fn to_bytes(&self) -> [u8; 32]
Returns the NamespaceSecret byte representation.
Sourcepub fn public_key(&self) -> NamespacePublicKey
 
pub fn public_key(&self) -> NamespacePublicKey
Get the NamespacePublicKey for this namespace.
Sourcepub fn id(&self) -> NamespaceId
 
pub fn id(&self) -> NamespaceId
Get the NamespaceId for this namespace.
Sourcepub fn sign(&self, msg: &[u8]) -> Signature
 
pub fn sign(&self, msg: &[u8]) -> Signature
Sign a message with this NamespaceSecret key.
Sourcepub fn verify(
    &self,
    msg: &[u8],
    signature: &Signature,
) -> Result<(), SignatureError>
 
pub fn verify( &self, msg: &[u8], signature: &Signature, ) -> Result<(), SignatureError>
Strictly verify a signature on a message with this NamespaceSecret’s public key.
Trait Implementations§
Source§impl Clone for NamespaceSecret
 
impl Clone for NamespaceSecret
Source§fn clone(&self) -> NamespaceSecret
 
fn clone(&self) -> NamespaceSecret
Returns a copy 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 moreSource§impl Debug for NamespaceSecret
 
impl Debug for NamespaceSecret
Source§impl<'de> Deserialize<'de> for NamespaceSecret
 
impl<'de> Deserialize<'de> for NamespaceSecret
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
    __D: Deserializer<'de>,
 
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
    __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for NamespaceSecret
 
impl Display for NamespaceSecret
Source§impl From<&NamespaceSecret> for NamespacePublicKey
 
impl From<&NamespaceSecret> for NamespacePublicKey
Source§fn from(value: &NamespaceSecret) -> Self
 
fn from(value: &NamespaceSecret) -> Self
Converts to this type from the input type.
Source§impl From<NamespaceSecret> for Capability
 
impl From<NamespaceSecret> for Capability
Source§fn from(value: NamespaceSecret) -> Self
 
fn from(value: NamespaceSecret) -> Self
Converts to this type from the input type.
Source§impl From<NamespaceSecret> for NamespaceId
 
impl From<NamespaceSecret> for NamespaceId
Source§fn from(value: NamespaceSecret) -> Self
 
fn from(value: NamespaceSecret) -> Self
Converts to this type from the input type.
Source§impl From<NamespaceSecret> for NamespacePublicKey
 
impl From<NamespaceSecret> for NamespacePublicKey
Source§fn from(value: NamespaceSecret) -> Self
 
fn from(value: NamespaceSecret) -> Self
Converts to this type from the input type.
Source§impl From<SigningKey> for NamespaceSecret
 
impl From<SigningKey> for NamespaceSecret
Source§fn from(signing_key: SigningKey) -> Self
 
fn from(signing_key: SigningKey) -> Self
Converts to this type from the input type.
Source§impl FromStr for NamespaceSecret
 
impl FromStr for NamespaceSecret
Auto Trait Implementations§
impl Freeze for NamespaceSecret
impl RefUnwindSafe for NamespaceSecret
impl Send for NamespaceSecret
impl Sync for NamespaceSecret
impl Unpin for NamespaceSecret
impl UnwindSafe for NamespaceSecret
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
    T: 'a,
 
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
    T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
    T: 'a,
 
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
    T: 'a,
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