diff options
author | Rasmus Dahlberg <rasmus.dahlberg@kau.se> | 2020-11-03 13:17:11 +0100 |
---|---|---|
committer | Rasmus Dahlberg <rasmus.dahlberg@kau.se> | 2020-11-03 13:17:11 +0100 |
commit | 9ab61d6884a9ac26592723523ed2521c79c47a1a (patch) | |
tree | 8607208b2a9f386eec1a39cbe219e09088d28bb3 /server/descriptor/descriptor.go | |
parent | 4bef11c59c3e28f0f587b710d56d98c0f26591ad (diff) |
fixed signature verification and client get-sth
Diffstat (limited to 'server/descriptor/descriptor.go')
-rw-r--r-- | server/descriptor/descriptor.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/server/descriptor/descriptor.go b/server/descriptor/descriptor.go index 6e46790..295e03f 100644 --- a/server/descriptor/descriptor.go +++ b/server/descriptor/descriptor.go @@ -4,7 +4,9 @@ import ( "bytes" "fmt" + "crypto" "crypto/tls" + "crypto/x509" "encoding/base64" "encoding/json" "io/ioutil" @@ -55,3 +57,11 @@ func LoadOperators(path string) ([]Operator, error) { } return ops, nil } + +func (l *Log) Key() crypto.PublicKey { + k, err := x509.ParsePKIXPublicKey(l.PublicKey) + if err != nil { + panic("TODO: make a new function and parse public key there") + } + return k +} |