keys icon indicating copy to clipboard operation
keys copied to clipboard

`keys.DecodeSaltpackKey` not available anymore

Open shoce opened this issue 2 years ago • 4 comments

How to decode saltpack keys now without that function? Can u please help me?

shoce avatar Nov 05 '21 17:11 shoce

Is it now in the api package? api.DecodeKey?

https://github.com/keys-pub/keys/blob/master/api/encode_test.go

gabriel avatar Nov 06 '21 01:11 gabriel

Is it now in the api package? api.DecodeKey?

https://github.com/keys-pub/keys/blob/master/api/encode_test.go

Oh ok. Thanks.

Got into another trouble now while updating my code using this lib.

Is it on purpose that keys/api/Key does not implement keys/Key interface?

shoce avatar Nov 07 '21 14:11 shoce

api.Key is in a generic, serializable form for use with msgpack, JSON, sqlite database, etc.

But you can call key.As() or key.AsPublic() to get the concrete type which does implement keys.Key.

gabriel avatar Nov 08 '21 01:11 gabriel

See https://github.com/keys-pub/keys/blob/master/api/as.go

I should document all this stuff.

gabriel avatar Nov 08 '21 01:11 gabriel