1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
use crate::;
/// Holds a private key and proves identity.
///
/// Use a `PubkySigner` to:
/// - **Sign up** for a homeserver ([`signup`](crate::PubkySigner::signup)).
/// - **Sign in** locally to get a [`PubkySession`](crate::PubkySession)
/// ([`signin`](crate::PubkySigner::signin)).
/// - **Approve auth** requests from other apps via QR / deep link
/// ([`approve_auth`](crate::PubkySigner::approve_auth),
/// [`handle_deeplink`](crate::PubkySigner::handle_deeplink)).
/// - **Publish PKDNS** records so others can discover your homeserver
/// ([`pkdns()`](crate::PubkySigner::pkdns)).
///
/// # Creating a signer
///
/// Prefer [`Pubky::signer`](crate::Pubky::signer) to share the same HTTP
/// client. Use [`PubkySigner::new`] only when you don't have a [`Pubky`](crate::Pubky) facade.
///
/// # Quick start
///
/// ```no_run
/// use pubky::{Pubky, Keypair, ClientId};
///
/// # async fn run() -> pubky::Result<()> {
/// let signer = Pubky::testnet()?.signer(Keypair::random());
///
/// // See signup() and signin() for full examples
/// let session = signer.signin(ClientId::new("my.app").unwrap()).await?;
/// session.storage().put("/pub/my.app/hello.txt", "world").await?;
/// # Ok(()) }
/// ```