vendor: revendor

This commit is contained in:
Eric Chiang
2016-11-17 15:21:26 -08:00
parent 522749b5d8
commit a876ab37af
192 changed files with 12003 additions and 18629 deletions

View File

@@ -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"))
}
}