keys-pub / keys

Key management is hard
https://keys.pub
Other
910 stars 25 forks source link

`keys.DecodeSaltpackKey` not available anymore #165

Open shoce opened 2 years ago

shoce commented 2 years ago

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

gabriel commented 2 years ago

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

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

shoce commented 2 years ago

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?

gabriel commented 2 years ago

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 commented 2 years ago

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

I should document all this stuff.