Skip to content

Commit 08e08e6

Browse files
committed
Docs
1 parent 70a22fa commit 08e08e6

File tree

10 files changed

+86
-33
lines changed

10 files changed

+86
-33
lines changed

.vuepress/config.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ module.exports = {
3434
path: "/docs/restapi/",
3535
children: ["/docs/restapi/user", "/docs/restapi/sigchain"]
3636
},
37+
{
38+
title: "Library",
39+
collapsable: false,
40+
children: ["/docs/lib/encrypt", "/docs/lib/packages"]
41+
},
3742
{
3843
title: "Specs",
3944
collapsable: false,
@@ -51,7 +56,7 @@ module.exports = {
5156
{
5257
title: "Other",
5358
collapsable: true,
54-
children: ["/docs/building", "/docs/service", "/docs/packages"]
59+
children: ["/docs/building", "/docs/service"]
5560
}
5661
]
5762
}

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@
22
title: keys.pub - Tools to help manage cryptographic keys
33
---
44

5-
# keys.pub
5+
<img src="./logo.png" width="280"/>
66

77
::: warning
88
This project is in development and has not been audited. Don't use for anything important yet.
99
:::
1010

1111
## Install
1212

13-
- [Install Command Line](docs/cli/install.md)
14-
- [Install Desktop](docs/desktop/install.md) (includes command line)
13+
- [Install Command Line](/docs/cli/install.md)
14+
- [Install Desktop](/docs/desktop/install.md) (includes command line)
1515

1616
## Introduction
1717

18-
keys.pub hosts a set of tools to help manage cryptographic keys. This includes a [software library](/docs/lib/), a [command line utility](/docs/cli/), [a desktop app](/docs/desktop/install.md), and a [REST API](docs/restapi/).
18+
keys.pub hosts a set of tools to help manage cryptographic keys. This includes a [software library](/docs/lib/), a [command line utility](/docs/cli/), [a desktop app](/docs/desktop/install.md), and a [REST API](/docs/restapi/).
1919

2020
The default key is a [Curve25519 key (EdX25519)](/docs/specs/keys.md) capable of signing and encryption.
2121
Using this key, you can create a [sigchain](/docs/specs/sigchain.md) (an ordered sequence of signed statements).
22-
You can [link a key to an identity](docs/specs/user.md) on Github or Twitter, etc, by publishing a signed statement on that service and in a sigchain on keys.pub.
22+
You can [link a key to an identity](/docs/specs/user.md) on Github or Twitter, etc, by publishing a signed statement on that service and in a sigchain on keys.pub.
2323

2424
You can [search for keys](docs/restapi/user.md#search) by user name and service (Github or Twitter, etc), or lookup a user for a key identifier.
2525

docs/cli/encrypt.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,23 @@
44

55
Encrypt text to armored msg.enc (from stdin).
66

7+
Specify a key id or user name@service as recipients.
8+
79
```shell
810
> echo -n "My secret 🤓" | keys encrypt -armor \
9-
-signer kex1mnseg28xu6g3j4wur7hqwk8ag3fu3pmr2t5lync26xmgff0dtryqupf80c \
11+
-signer gabriel@github \
1012
-recipient kex1ts0qw8fwkvle2f2xsqumetmr9ev5ppx22rl5hnycen68sanjzl7qnta629 \
11-
-recipient kex1mnseg28xu6g3j4wur7hqwk8ag3fu3pmr2t5lync26xmgff0dtryqupf80c > msg.enc
13+
-recipient gabriel@github > msg.enc
1214
```
1315

1416
Encrypt image.png to image.png.enc (using -in and -out).
1517

18+
Signer is optional, if unspecified, is anonymous.
19+
1620
```shell
1721
> keys encrypt \
18-
-signer kex1mnseg28xu6g3j4wur7hqwk8ag3fu3pmr2t5lync26xmgff0dtryqupf80c \
1922
-recipient kex1ts0qw8fwkvle2f2xsqumetmr9ev5ppx22rl5hnycen68sanjzl7qnta629 \
20-
-recipient kex1mnseg28xu6g3j4wur7hqwk8ag3fu3pmr2t5lync26xmgff0dtryqupf80c \
23+
-recipient gabriel@github \
2124
-in image.png -out image.png.enc
2225
```
2326

docs/desktop/install.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ macOS only, other platforms coming soon.
66

77
## macOS
88

9-
To install via [homebrew](https://brew.sh/) casks:
9+
To install via [homebrew](https://brew.sh/) cask:
1010

1111
```shell
1212
brew tap keys-pub/tap

docs/lib/README.md

-5
This file was deleted.

docs/lib/encrypt.md

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Encrypt
2+
3+
The following example describes how to:
4+
5+
- Initialize and setup/unlock a Keyring
6+
- Create a Keystore
7+
- Configure Saltpack
8+
- Generate an EdX25519 key
9+
- Encrypt to recipients using Saltpack
10+
11+
```go
12+
import (
13+
"github.com/keys-pub/keys"
14+
"github.com/keys-pub/keys/keyring"
15+
"github.com/keys-pub/keys/saltpack"
16+
)
17+
18+
...
19+
20+
// Create a Keyring.
21+
kr, err := keyring.NewKeyring("MyApp")
22+
// Setup/unlock the Keyring using a password.
23+
if err := keyring.UnlockWithPassword(kr, "alicepassword"); err != nil {
24+
log.Fatal(err)
25+
}
26+
// Alternatively, you can use an in memory (ephemeral) Keyring for testing:
27+
// kr, err := keyring.NewMem()
28+
29+
// Create a Keystore (backed by the Keyring).
30+
ks := keys.NewKeystore(kr)
31+
32+
// Configure saltpack format.
33+
sp := saltpack.NewSaltpack(ks)
34+
sp.SetArmored(true)
35+
36+
// Create an EdX25519 key and save it to the Keystore.
37+
alice := keys.GenerateEdX25519Key()
38+
if err := ks.SaveEdX25519Key(alice); err != nil {
39+
log.Fatal(err)
40+
}
41+
42+
bobID := keys.ID("kex1yy7amjzd5ld3k0uphvyetlz2vd8yy3fky64dut9jdf9qh852f0nsxjgv0m")
43+
message := []byte("hi bob")
44+
45+
// Encrypt using Saltpack from alice to bob (include alice as a recipient too).
46+
encrypted, err := sp.Encrypt(message, alice.X25519Key(), bobID, alice.ID())
47+
if err != nil {
48+
log.Fatal(err)
49+
}
50+
51+
fmt.Printf("Encrypted: %s\n", string(encrypted))
52+
53+
```

docs/lib/packages.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Packages
2+
3+
- [github.com/keys-pub/keys](https://godoc.org/github.com/keys-pub/keys): The core package, defines keys, stores, sigchain, signed statements and users.
4+
- [github.com/keys-pub/keys/keyring](https://godoc.org/github.com/keys-pub/keys/keyring): Securely store keys on macOS, Windows and Linux.
5+
- [github.com/keys-pub/keys/saltpack](https://godoc.org/github.com/keys-pub/keys/saltpack): Saltpack integration.
6+
7+
The [github.com/keys-pub/keysd](https://github.com/keys-pub/keysd) repository is for services, utilities, clients, etc and includes:
8+
9+
- [github.com/keys-pub/keysd/service](https://godoc.org/github.com/keys-pub/keysd/service): Service (gRPC), and command line client.
10+
- [github.com/keys-pub/keysd/http/client](https://godoc.org/github.com/keys-pub/keysd/http/client): Client REST API.
11+
- [github.com/keys-pub/keysd/http/server](https://godoc.org/github.com/keys-pub/keysd/http/server): Server REST API.

docs/lib/sign.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Sign
2+
3+
// TODO

docs/packages.md

-17
This file was deleted.

logo.png

2.63 KB
Loading

0 commit comments

Comments
 (0)