pub trait Signer:
Debug
+ Send
+ Sync {
// Required methods
fn public_key(&self) -> PublicKey;
fn encrypted_private_key(&self) -> Option<EncryptedPrivateKey>;
fn sign_event<'life0, 'async_trait>(
&'life0 self,
input: PreEvent,
) -> Pin<Box<dyn Future<Output = Result<Event, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn encrypt<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
other: &'life1 PublicKey,
plaintext: &'life2 str,
algo: ContentEncryptionAlgorithm,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn decrypt<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
other: &'life1 PublicKey,
ciphertext: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn key_security(&self) -> Result<KeySecurity, Error>;
// Provided methods
fn giftwrap<'life0, 'async_trait>(
&'life0 self,
input: PreEvent,
pubkey: PublicKey,
) -> Pin<Box<dyn Future<Output = Result<Event, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn create_metadata_event<'life0, 'async_trait>(
&'life0 self,
input: PreEvent,
metadata: Metadata,
) -> Pin<Box<dyn Future<Output = Result<Event, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn create_zap_request_event<'life0, 'async_trait>(
&'life0 self,
recipient_pubkey: PublicKey,
zapped_event: Option<Id>,
millisatoshis: u64,
relays: Vec<String>,
content: String,
) -> Pin<Box<dyn Future<Output = Result<Event, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn decrypt_event_contents<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 Event,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn unwrap_giftwrap<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 Event,
) -> Pin<Box<dyn Future<Output = Result<Rumor, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
}
Expand description
Signer operations
Required Methods§
Sourcefn public_key(&self) -> PublicKey
fn public_key(&self) -> PublicKey
What is the signer’s public key?
Sourcefn encrypted_private_key(&self) -> Option<EncryptedPrivateKey>
fn encrypted_private_key(&self) -> Option<EncryptedPrivateKey>
What is the signer’s encrypted private key?
Sourcefn sign_event<'life0, 'async_trait>(
&'life0 self,
input: PreEvent,
) -> Pin<Box<dyn Future<Output = Result<Event, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn sign_event<'life0, 'async_trait>(
&'life0 self,
input: PreEvent,
) -> Pin<Box<dyn Future<Output = Result<Event, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sign an event
Sourcefn encrypt<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
other: &'life1 PublicKey,
plaintext: &'life2 str,
algo: ContentEncryptionAlgorithm,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn encrypt<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
other: &'life1 PublicKey,
plaintext: &'life2 str,
algo: ContentEncryptionAlgorithm,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Encrypt
Sourcefn decrypt<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
other: &'life1 PublicKey,
ciphertext: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn decrypt<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
other: &'life1 PublicKey,
ciphertext: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Decrypt NIP-04 or NIP-44
Sourcefn key_security(&self) -> Result<KeySecurity, Error>
fn key_security(&self) -> Result<KeySecurity, Error>
Get the security level of the private key
Provided Methods§
Sourcefn giftwrap<'life0, 'async_trait>(
&'life0 self,
input: PreEvent,
pubkey: PublicKey,
) -> Pin<Box<dyn Future<Output = Result<Event, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn giftwrap<'life0, 'async_trait>(
&'life0 self,
input: PreEvent,
pubkey: PublicKey,
) -> Pin<Box<dyn Future<Output = Result<Event, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Giftwrap an event
Sourcefn create_metadata_event<'life0, 'async_trait>(
&'life0 self,
input: PreEvent,
metadata: Metadata,
) -> Pin<Box<dyn Future<Output = Result<Event, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_metadata_event<'life0, 'async_trait>(
&'life0 self,
input: PreEvent,
metadata: Metadata,
) -> Pin<Box<dyn Future<Output = Result<Event, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Create an event that sets Metadata
Sourcefn create_zap_request_event<'life0, 'async_trait>(
&'life0 self,
recipient_pubkey: PublicKey,
zapped_event: Option<Id>,
millisatoshis: u64,
relays: Vec<String>,
content: String,
) -> Pin<Box<dyn Future<Output = Result<Event, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_zap_request_event<'life0, 'async_trait>(
&'life0 self,
recipient_pubkey: PublicKey,
zapped_event: Option<Id>,
millisatoshis: u64,
relays: Vec<String>,
content: String,
) -> Pin<Box<dyn Future<Output = Result<Event, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Create a ZapRequest event These events are not published to nostr, they are sent to a lnurl.