fix Sign/Verify to take byte slices not strings

This commit is contained in:
Ross Kinder
2015-10-06 12:41:06 -04:00
parent 109617ef26
commit 673471166f
3 changed files with 31 additions and 25 deletions

View File

@@ -33,16 +33,16 @@ func main() {
buf, err := ioutil.ReadAll(os.Stdin)
if *doSign {
signedBuf, err := xmldsig.Sign(key, string(buf))
signedBuf, err := xmldsig.Sign(key, buf)
if err != nil {
fmt.Printf("%s\n", err)
os.Exit(1)
}
fmt.Print(signedBuf)
os.Stdout.Write(signedBuf)
}
if *doVerify {
err := xmldsig.Verify(key, string(buf))
err := xmldsig.Verify(key, buf)
if err == xmldsig.ErrVerificationFailed {
fmt.Println("signature is not correct")
os.Exit(1)