diff options
author | Rasmus Dahlberg <rasmus.dahlberg@kau.se> | 2020-10-30 10:51:32 +0100 |
---|---|---|
committer | Rasmus Dahlberg <rasmus.dahlberg@kau.se> | 2020-10-30 10:51:32 +0100 |
commit | 43c8e9b1e44255ecc3d8a0077dc285739cfbb79d (patch) | |
tree | e0e7d93f8a9c5a0353a610ee3a4c56dc3826e1f0 /type.go | |
parent | cf16cc04f72f477cdc7a99f17b00314a2f2fe922 (diff) |
updated json output according to api doc
Diffstat (limited to 'type.go')
-rw-r--r-- | type.go | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -262,6 +262,14 @@ func StItemFromB64(s string) (StItem, error) { return item, nil } +func StItemToB64(i StItem) (string, error) { + b, err := tls.Marshal(i) + if err != nil { + return "", fmt.Errorf("StItem(%v) tls marshal failed: %v", i.Format, err) + } + return base64.StdEncoding.EncodeToString(b), nil +} + // Appendix is extra data that Trillian can store about a leaf type Appendix struct { Signature []byte `tls:"minlen:0,maxlen:16383"` |