vendor: revendor
This commit is contained in:
6
vendor/gopkg.in/square/go-jose.v2/jose-util/jose-util.t
generated
vendored
6
vendor/gopkg.in/square/go-jose.v2/jose-util/jose-util.t
generated
vendored
@@ -86,3 +86,9 @@ Sign and verify a test message (EC).
|
||||
> jose-util sign --alg ES384 --key ec.key |
|
||||
> jose-util verify --key ec.pub
|
||||
Lorem ipsum dolor sit amet
|
||||
|
||||
Expand a compact message to full format.
|
||||
|
||||
$ echo "eyJhbGciOiJFUzM4NCJ9.TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQK.QPU35XY913Im7ZEaN2yHykfbtPqjHZvYp-lV8OcTAJZs67bJFSdTSkQhQWE9ch6tvYrj_7py6HKaWVFLll_s_Rm6bmwq3JszsHrIvFFm1NydruYHhvAnx7rjYiqwOu0W" |
|
||||
> jose-util expand --format JWS
|
||||
{"payload":"TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQK","protected":"eyJhbGciOiJFUzM4NCJ9","signature":"QPU35XY913Im7ZEaN2yHykfbtPqjHZvYp-lV8OcTAJZs67bJFSdTSkQhQWE9ch6tvYrj_7py6HKaWVFLll_s_Rm6bmwq3JszsHrIvFFm1NydruYHhvAnx7rjYiqwOu0W"}
|
||||
|
11
vendor/gopkg.in/square/go-jose.v2/jose-util/main.go
generated
vendored
11
vendor/gopkg.in/square/go-jose.v2/jose-util/main.go
generated
vendored
@@ -28,7 +28,7 @@ import (
|
||||
var (
|
||||
app = kingpin.New("jose-util", "A command-line utility for dealing with JOSE objects.")
|
||||
|
||||
keyFile = app.Flag("key", "Path to key file (PEM or DER-encoded)").Required().ExistingFile()
|
||||
keyFile = app.Flag("key", "Path to key file (PEM or DER-encoded)").ExistingFile()
|
||||
inFile = app.Flag("in", "Path to input file (stdin if missing)").ExistingFile()
|
||||
outFile = app.Flag("out", "Path to output file (stdout if missing)").ExistingFile()
|
||||
|
||||
@@ -54,8 +54,12 @@ func main() {
|
||||
|
||||
command := kingpin.MustParse(app.Parse(os.Args[1:]))
|
||||
|
||||
keyBytes, err := ioutil.ReadFile(*keyFile)
|
||||
exitOnError(err, "unable to read key file")
|
||||
var keyBytes []byte
|
||||
var err error
|
||||
if command != "expand" {
|
||||
keyBytes, err = ioutil.ReadFile(*keyFile)
|
||||
exitOnError(err, "unable to read key file")
|
||||
}
|
||||
|
||||
switch command {
|
||||
case "encrypt":
|
||||
@@ -144,6 +148,7 @@ func main() {
|
||||
|
||||
exitOnError(err, "unable to expand message")
|
||||
writeOutput(*outFile, []byte(serialized))
|
||||
writeOutput(*outFile, []byte("\n"))
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user