aboutsummaryrefslogtreecommitdiff
path: root/client/client.go
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus.dahlberg@kau.se>2020-11-27 17:45:30 +0100
committerRasmus Dahlberg <rasmus.dahlberg@kau.se>2020-11-27 17:45:30 +0100
commit70ee62fcb790da7bfb01667f7c315723ed12609e (patch)
tree58f84865a01b972bd567c1257eeca9b15646e832 /client/client.go
parent782d895d8d6e66938a3fa6914d8e93a79c949771 (diff)
cleaned-up x509util
Diffstat (limited to 'client/client.go')
-rw-r--r--client/client.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/client/client.go b/client/client.go
index 9462e0c..6eb99c2 100644
--- a/client/client.go
+++ b/client/client.go
@@ -46,12 +46,20 @@ func NewClient(log *descriptor.Log, client *http.Client, useHttp bool, chain []*
// private key, and a json-encoded list of log operators (see descriptor).
// Chain and key paths may be left out by passing the empty string: "".
func NewClientFromPath(logId, chainPath, keyPath, operatorsPath string, cli *http.Client, useHttp bool) (*Client, error) {
- c, err := x509util.LoadCertificates(chainPath)
+ pem, err := ioutil.ReadFile(chainPath)
if err != nil && chainPath != "" {
+ return nil, fmt.Errorf("failed reading %s: %v", chainPath, err)
+ }
+ c, err := x509util.NewCertificateList(pem)
+ if err != nil {
return nil, err
}
- k, err := x509util.LoadEd25519SigningKey(keyPath)
+ pem, err = ioutil.ReadFile(keyPath)
+ if err != nil && keyPath != "" {
+ return nil, fmt.Errorf("failed reading %s: %v", keyPath, err)
+ }
+ k, err := x509util.NewEd25519PrivateKey(pem)
if err != nil && keyPath != "" {
return nil, err
}