pub enum ActiveSigner {
Local(GuardedSigner),
Bunker(WatchedBunkerSigner),
Nip55(Nip55Signer),
Keys(Keys),
}Expand description
The signer for the active session.
nostr 0.45 removed ClientBuilder::signer / Client::signer: events are
built and signed outside the client now, so Vector owns this dispatch.
A concrete enum rather than Arc<dyn ...> on purpose. 0.45 ships no blanket
capability impls for Arc<T>, and the orphan rule forbids adding them, so a
trait object would force every call site to deref. This also keeps dispatch
static.
Deliberately NOT cached in a static: active_signer rebuilds it per call
from state that is already swap-managed (SIGNER_KIND, BUNKER_SIGNER,
MY_PUBLIC_KEY). A cached signer would be one more per-account global to
invalidate on reset_session, and a stale one signs the new account’s events
under the old identity.
Variants§
Local(GuardedSigner)
Local key from the GuardedKey vault.
Bunker(WatchedBunkerSigner)
Remote NIP-46 bunker, with reachability reporting.
Nip55(Nip55Signer)
On-device NIP-55 signer app reached over Android IPC.
Keys(Keys)
Raw keys — headless/CLI consumers and tests, which have a vault key but no notion of signer modes.
Trait Implementations§
Source§impl AsyncGetPublicKey for ActiveSigner
impl AsyncGetPublicKey for ActiveSigner
Source§type Error = SignerError
type Error = SignerError
Source§fn get_public_key_async(
&self,
) -> BoxedFuture<'_, Result<PublicKey, Self::Error>>
fn get_public_key_async( &self, ) -> BoxedFuture<'_, Result<PublicKey, Self::Error>>
Source§impl AsyncNip04 for ActiveSigner
impl AsyncNip04 for ActiveSigner
Source§type Error = SignerError
type Error = SignerError
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>>
Source§fn nip04_decrypt_async<'a>(
&'a self,
public_key: &'a PublicKey,
encrypted_content: &'a str,
) -> BoxedFuture<'a, Result<String, Self::Error>>
fn nip04_decrypt_async<'a>( &'a self, public_key: &'a PublicKey, encrypted_content: &'a str, ) -> BoxedFuture<'a, Result<String, Self::Error>>
Source§impl AsyncNip44 for ActiveSigner
impl AsyncNip44 for ActiveSigner
Source§type Error = SignerError
type Error = SignerError
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>>
Source§fn nip44_decrypt_async<'a>(
&'a self,
public_key: &'a PublicKey,
payload: &'a str,
) -> BoxedFuture<'a, Result<String, Self::Error>>
fn nip44_decrypt_async<'a>( &'a self, public_key: &'a PublicKey, payload: &'a str, ) -> BoxedFuture<'a, Result<String, Self::Error>>
Source§impl AsyncSignEvent for ActiveSigner
impl AsyncSignEvent for ActiveSigner
Source§type Error = SignerError
type Error = SignerError
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>>
Source§impl Clone for ActiveSigner
impl Clone for ActiveSigner
Source§fn clone(&self) -> ActiveSigner
fn clone(&self) -> ActiveSigner
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !Freeze for ActiveSigner
impl !RefUnwindSafe for ActiveSigner
impl !UnwindSafe for ActiveSigner
impl Send for ActiveSigner
impl Sync for ActiveSigner
impl Unpin for ActiveSigner
impl UnsafeUnpin for ActiveSigner
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
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> ⓘ
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> ⓘ
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