Browse Source

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?
pull/1683/head
Jorik Schellekens 5 years ago
committed by GitHub
parent
commit
0601ec2e9a
  1. 4
      core/crypto/key.go

4
core/crypto/key.go

@ -349,12 +349,12 @@ func MarshalPrivateKey(k PrivKey) ([]byte, error) {
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) {
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 {
return base64.StdEncoding.EncodeToString(b)
}

Loading…
Cancel
Save