vendor: revendor
This commit is contained in:
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