try to support implemenations that put the key object in a seperate place

This commit is contained in:
Ted Unangst 2019-07-17 16:33:38 -04:00
parent 5b10e20388
commit 4232c63865
1 changed files with 6 additions and 3 deletions

9
fun.go
View File

@ -457,13 +457,16 @@ func zaggy(keyname string) (key *rsa.PublicKey) {
log.Printf("error getting %s pubkey: %s", keyname, err)
return
}
var ok bool
data, ok = j.FindString([]string{"publicKey", "publicKeyPem"})
keyobj, ok := j.GetMap("publicKey")
if ok {
j = keyobj
}
data, ok = j.GetString("publicKeyPem")
if !ok {
log.Printf("error finding %s pubkey", keyname)
return
}
_, ok = j.FindString([]string{"publicKey", "owner"})
_, ok = j.GetString("owner")
if !ok {
log.Printf("error finding %s pubkey owner", keyname)
return