implement encoding Marshal/Unmarshal

This commit is contained in:
Matt Drollette
2014-12-11 11:24:34 -06:00
parent ca065f4470
commit 0f66b45fce
5 changed files with 69 additions and 59 deletions

View File

@@ -3,6 +3,7 @@ package cmd
import (
"crypto/tls"
"fmt"
"io/ioutil"
"log"
"net/http"
"sync"
@@ -89,11 +90,14 @@ func validate(responses chan *http.Response) {
continue
}
su3File, err := su3.Parse(resp.Body)
if err != nil {
su3File := su3.Su3File{}
data, err := ioutil.ReadAll(resp.Body)
if nil != err {
fmt.Println("Invalid: Unable to parse SU3 file:", err)
}
if err := su3File.UnmarshalBinary(data); err != nil {
fmt.Println("Invalid: Unable to parse SU3 file:", err)
}
resp.Body.Close()
cert, err := ks.ReseederCertificate(su3File.SignerId)
if nil != err {