pub struct Nip55Signer { /* private fields */ }Expand description
A VectorSigner that routes every identity op to an external NIP-55 signer
over the platform hook. Cheap to clone (just a pubkey + a session
generation snapshot).
Captures a SessionGuard at construction:
state flips after an account swap are suppressed so an in-flight op
resolving against the previous account can’t leak nip55_state onto the new
one. Wrong-key is impossible regardless — every op is bound to
user_pubkey and passes it as current_user, so a stale op still signs as
the correct (old) identity; it just must not narrate onto the new session.
Implementations§
Source§impl Nip55Signer
impl Nip55Signer
Trait Implementations§
Source§impl AsyncGetPublicKey for Nip55Signer
impl AsyncGetPublicKey for Nip55Signer
Source§type Error = SignerError
type Error = SignerError
Error type
Source§fn get_public_key_async(
&self,
) -> BoxedFuture<'_, Result<PublicKey, Self::Error>>
fn get_public_key_async( &self, ) -> BoxedFuture<'_, Result<PublicKey, Self::Error>>
Get public key
Source§impl AsyncNip04 for Nip55Signer
impl AsyncNip04 for Nip55Signer
Source§type Error = SignerError
type Error = SignerError
NIP-04 error
Source§fn nip04_encrypt_async<'a>(
&'a self,
public_key: &'a PublicKey,
content: &'a str,
) -> BoxedFuture<'a, Result<String, Self::Error>>
fn nip04_encrypt_async<'a>( &'a self, public_key: &'a PublicKey, content: &'a str, ) -> BoxedFuture<'a, Result<String, Self::Error>>
Encrypts asynchronously using NIP-04. Read more
Source§fn nip04_decrypt_async<'a>(
&'a self,
public_key: &'a PublicKey,
content: &'a str,
) -> BoxedFuture<'a, Result<String, Self::Error>>
fn nip04_decrypt_async<'a>( &'a self, public_key: &'a PublicKey, content: &'a str, ) -> BoxedFuture<'a, Result<String, Self::Error>>
Decrypts asynchronously a NIP-04 payload.
Source§impl AsyncNip44 for Nip55Signer
impl AsyncNip44 for Nip55Signer
Source§type Error = SignerError
type Error = SignerError
NIP-44 error
Source§fn nip44_encrypt_async<'a>(
&'a self,
public_key: &'a PublicKey,
content: &'a str,
) -> BoxedFuture<'a, Result<String, Self::Error>>
fn nip44_encrypt_async<'a>( &'a self, public_key: &'a PublicKey, content: &'a str, ) -> BoxedFuture<'a, Result<String, Self::Error>>
Encrypts asynchronously using NIP-44. Read more
Source§fn nip44_decrypt_async<'a>(
&'a self,
public_key: &'a PublicKey,
content: &'a str,
) -> BoxedFuture<'a, Result<String, Self::Error>>
fn nip44_decrypt_async<'a>( &'a self, public_key: &'a PublicKey, content: &'a str, ) -> BoxedFuture<'a, Result<String, Self::Error>>
Decrypts asynchronously a NIP-44 payload.
Source§impl AsyncSignEvent for Nip55Signer
impl AsyncSignEvent for Nip55Signer
Source§type Error = SignerError
type Error = SignerError
Error type
Source§fn sign_event_async(
&self,
unsigned: UnsignedEvent,
) -> BoxedFuture<'_, Result<Event, Self::Error>>
fn sign_event_async( &self, unsigned: UnsignedEvent, ) -> BoxedFuture<'_, Result<Event, Self::Error>>
Sign an unsigned event
Source§impl Clone for Nip55Signer
impl Clone for Nip55Signer
Source§fn clone(&self) -> Nip55Signer
fn clone(&self) -> Nip55Signer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 Nip55Signer
impl RefUnwindSafe for Nip55Signer
impl Send for Nip55Signer
impl Sync for Nip55Signer
impl Unpin for Nip55Signer
impl UnsafeUnpin for Nip55Signer
impl UnwindSafe for Nip55Signer
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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