pub struct PaykitNoiseKeyAuthorization { /* private fields */ }Expand description
Pubky identity approval of Noise routing and handshake keys at one generation.
Deserialization verifies the signature. Network readers must additionally check the expected owner. Freshness depends on the owner’s homeserver; retain the highest observed generation to reject subsequent rollbacks.
Implementations§
Source§impl PaykitNoiseKeyAuthorization
impl PaykitNoiseKeyAuthorization
Sourcepub fn sign(
identity: &Keypair,
noise_secret_key: &[u8; 32],
key_generation: u64,
) -> Result<Self>
pub fn sign( identity: &Keypair, noise_secret_key: &[u8; 32], key_generation: u64, ) -> Result<Self>
Sign with the Pubky identity key, never with delegated Paykit key material. Both public keys are derived from the supplied Noise static secret.
Sourcepub fn noise_public_key(&self) -> &PublicKey
pub fn noise_public_key(&self) -> &PublicKey
Ed25519 routing key approved for this identity.
Sourcepub fn noise_static_public_key(&self) -> &[u8; 32]
pub fn noise_static_public_key(&self) -> &[u8; 32]
X25519 static key that the Noise handshake peer must present.
Sourcepub fn key_generation(&self) -> u64
pub fn key_generation(&self) -> u64
Monotonically increasing Paykit key generation.
Sourcepub fn validate_against(&self, previous: &Self) -> Result<()>
pub fn validate_against(&self, previous: &Self) -> Result<()>
Reject another owner, a lower generation, or a different key at the same generation. A reader may skip generations while offline.
Trait Implementations§
Source§impl Clone for PaykitNoiseKeyAuthorization
impl Clone for PaykitNoiseKeyAuthorization
Source§impl Debug for PaykitNoiseKeyAuthorization
impl Debug for PaykitNoiseKeyAuthorization
Source§impl<'de> Deserialize<'de> for PaykitNoiseKeyAuthorization
impl<'de> Deserialize<'de> for PaykitNoiseKeyAuthorization
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
impl Eq for PaykitNoiseKeyAuthorization
impl StructuralPartialEq for PaykitNoiseKeyAuthorization
Auto Trait Implementations§
impl Freeze for PaykitNoiseKeyAuthorization
impl RefUnwindSafe for PaykitNoiseKeyAuthorization
impl Send for PaykitNoiseKeyAuthorization
impl Sync for PaykitNoiseKeyAuthorization
impl Unpin for PaykitNoiseKeyAuthorization
impl UnsafeUnpin for PaykitNoiseKeyAuthorization
impl UnwindSafe for PaykitNoiseKeyAuthorization
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