3
3
[ ![ latest] ( https://badgen.net/github/tag/aead/minisign )] ( https://github.com/aead/minisign/releases/latest )
4
4
5
5
# minisign
6
+
6
7
minisign is a dead simple tool to sign files and verify signatures.
7
8
8
9
```
@@ -37,13 +38,16 @@ This is a Go implementation of the [original C implementation](https://github.co
37
38
38
39
```
39
40
Usage:
40
- minisign -G [-p <pubKey>] [-s <secKey>]
41
+ minisign -G [-p <pubKey>] [-s <secKey>] [-W]
42
+ minisign -R [-s <secKey>] [-p <pubKey>]
43
+ minisign -C [-s <secKey>] [-W]
41
44
minisign -S [-x <signature>] [-s <secKey>] [-c <comment>] [-t <comment>] -m <file>...
42
45
minisign -V [-H] [-x <signature>] [-p <pubKey> | -P <pubKey>] [-o] [-q | -Q ] -m <file>
43
- minisign -R [-s <secKey>] [-p <pubKey>]
44
-
46
+
45
47
Options:
46
- -G Generate a new public/secret key pair.
48
+ -G Generate a new public/secret key pair.
49
+ -R Re-create a public key file from a secret key.
50
+ -C Change or remove the password of the secret key.
47
51
-S Sign files with a secret key.
48
52
-V Verify files with a public key.
49
53
-m <file> The file to sign or verify.
@@ -52,33 +56,41 @@ Options:
52
56
-p <pubKey> Public key file (default: ./minisign.pub)
53
57
-P <pubKey> Public key as base64 string
54
58
-s <secKey> Secret key file (default: $HOME/.minisign/minisign.key)
59
+ -W Do not encrypt/decrypt the secret key with a password.
55
60
-x <signature> Signature file (default: <file>.minisig)
56
61
-c <comment> Add a one-line untrusted comment.
57
62
-t <comment> Add a one-line trusted comment.
58
63
-q Quiet mode. Suppress output.
59
64
-Q Pretty quiet mode. Combined with -V, only print the trusted comment.
60
- -R Re-create a public key file from a secret key.
61
65
-f Combined with -G or -R, overwrite any existing public/secret key pair.
62
66
-v Print version information.
63
67
```
64
68
65
69
## Installation
66
70
67
- On windows, linux and macOS, you can use the pre-built binaries:
68
- | OS | ARCH | Latest Release |
69
- | :---------:| :-------:| :-----------------------------------------------------------------------------------------------------------------------|
70
- | Linux | amd64 | [ minisign-linux-amd64.tar.gz] ( https://github.com/aead/minisign/releases/download/v0.1.2/minisign-linux-amd64.tar.gz ) |
71
- | Linux | arm64 | [ minisign-linux-arm64.tar.gz] ( https://github.com/aead/minisign/releases/download/v0.1.2/minisign-linux-arm64.tar.gz ) |
72
- | MacOS | arm64 | [ minisign-darwin-arm64.tar.gz] ( https://github.com/aead/minisign/releases/download/v0.1.2/minisign-darwin-arm64.tar.gz ) |
73
- | MacOS | amd64 | [ minisign-darwin-amd64.tar.gz] ( https://github.com/aead/minisign/releases/download/v0.1.2/minisign-darwin-amd64.tar.gz ) |
74
- | Windows | amd64 | [ minisign-windows-amd64.zip] ( https://github.com/aead/minisign/releases/download/v0.1.2/minisign-windows-amd64.zip ) |
75
-
76
- If your system has [ Go1.16+] ( https://golang.org/dl/ ) , you can build from source:
71
+ With an up-to-date Go toolchain:
77
72
```
78
- git clone https://aead.dev/minisign && cd minisign
79
- go build -o . aead.dev/minisign/cmd/minisign
73
+ go install aead.dev/minisign/cmd/minisign@latest
80
74
```
81
75
76
+ On windows, linux and macOS, you can also use the pre-built binaries:
77
+ | OS | ARCH | Latest Release |
78
+ | :---------:| :-------:| :-----------------------------------------------------------------------------------------------------------------------|
79
+ | Linux | amd64 | [ minisign-linux-amd64.tar.gz] ( https://github.com/aead/minisign/releases/download/v0.3.0/minisign-linux-amd64.tar.gz ) |
80
+ | Linux | arm64 | [ minisign-linux-arm64.tar.gz] ( https://github.com/aead/minisign/releases/download/v0.3.0/minisign-linux-arm64.tar.gz ) |
81
+ | MacOS | arm64 | [ minisign-darwin-arm64.tar.gz] ( https://github.com/aead/minisign/releases/download/v0.3.0/minisign-darwin-arm64.tar.gz ) |
82
+ | Windows | amd64 | [ minisign-windows-amd64.zip] ( https://github.com/aead/minisign/releases/download/v0.3.0/minisign-windows-amd64.zip ) |
83
+
84
+ From source:
85
+ 1 . Clone the repository
86
+ ```
87
+ git clone https://aead.dev/minisign && cd minisign
88
+ ```
89
+ 2 . Build the binary
90
+ ```
91
+ make build
92
+ ```
93
+
82
94
## Library
83
95
84
96
``` Go
@@ -100,14 +112,14 @@ import (
100
112
func main () {
101
113
var message = []byte (" Hello World!" )
102
114
103
- public , private , err := minisign.GenerateKey (rand.Reader )
115
+ publicKey , privateKey , err := minisign.GenerateKey (rand.Reader )
104
116
if err != nil {
105
117
log.Fatalln (err)
106
118
}
107
119
108
- signature := minisign.Sign (private , message)
120
+ signature := minisign.Sign (privateKey , message)
109
121
110
- if !minisign.Verify (public , message, signature) {
122
+ if !minisign.Verify (publicKey , message, signature) {
111
123
log.Fatalln (" signature verification failed" )
112
124
}
113
125
log.Println (string (message))
0 commit comments