Fix some stderr.

This commit is contained in:
Naoki Kosaka
2018-12-09 19:12:49 +09:00
parent 439eeacbbe
commit 8e6f6679bd
7 changed files with 13 additions and 11 deletions

View File

@ -6,6 +6,7 @@ import (
"encoding/pem"
"fmt"
"io/ioutil"
"os"
)
func ReadPrivateKeyRSAfromPath(path string) (*rsa.PrivateKey, error) {
@ -26,7 +27,7 @@ func ReadPublicKeyRSAfromString(pemString string) (*rsa.PublicKey, error) {
decoded, _ := pem.Decode(pemByte)
keyInterface, err := x509.ParsePKIXPublicKey(decoded.Bytes)
if err != nil {
fmt.Println(err)
fmt.Fprintln(os.Stderr, err)
return nil, err
}
pub := keyInterface.(*rsa.PublicKey)