Unverified Commit dd550878 authored by Jorik Schellekens's avatar Jorik Schellekens Committed by GitHub

The docs seem to lie

The docs seem to lie about what these methods do.
This is the naive solution since it's my first day looking
at go but would it be possible to get these methods
to marshal to public or private key correctly by passing
a type to them?
parent b74f60b9
...@@ -349,12 +349,12 @@ func MarshalPrivateKey(k PrivKey) ([]byte, error) { ...@@ -349,12 +349,12 @@ func MarshalPrivateKey(k PrivKey) ([]byte, error) {
return proto.Marshal(pbmes) return proto.Marshal(pbmes)
} }
// ConfigDecodeKey decodes from b64 (for config file), and unmarshals. // ConfigDecodeKey decodes from b64 (for config file) to a byte array that can be unmarshalled.
func ConfigDecodeKey(b string) ([]byte, error) { func ConfigDecodeKey(b string) ([]byte, error) {
return base64.StdEncoding.DecodeString(b) return base64.StdEncoding.DecodeString(b)
} }
// ConfigEncodeKey encodes to b64 (for config file), and marshals. // ConfigEncodeKey encodes a marshalled key to b64 (for config file).
func ConfigEncodeKey(b []byte) string { func ConfigEncodeKey(b []byte) string {
return base64.StdEncoding.EncodeToString(b) return base64.StdEncoding.EncodeToString(b)
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment