Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterSigAlgo ¶
func RegisterSigAlgo(algo SigningAlgo[any, any, any])
Types ¶
type HashedPublicKey ¶ added in v1.2.0
type HashedPublicKey interface { Equal(PublicKey) bool encoding.BinaryMarshaler encoding.BinaryUnmarshaler json.Marshaler json.Unmarshaler }
type PublicKey ¶
type PublicKey interface { encoding.BinaryMarshaler encoding.BinaryUnmarshaler json.Marshaler json.Unmarshaler Algo() string Verify(Signature, []byte) error Unwrap() any Fork() HashedPublicKey }
type SecretKey ¶
type SecretKey interface { encoding.BinaryUnmarshaler encoding.TextUnmarshaler UnsafeMarshalBinary() ([]byte, error) UnsafeMarshalText() ([]byte, error) Algo() string Sign(msg []byte) Signature Unwrap() any PublicKey() PublicKey }
func UnmarshalTextSecretKey ¶ added in v1.2.0
type Signature ¶
type Signature interface { encoding.BinaryMarshaler encoding.BinaryUnmarshaler json.Marshaler json.Unmarshaler Algo() string Verify(PublicKey, []byte) error Unwrap() any }
type SigningAlgo ¶
type SigningAlgo[S, P, Sig any] interface { Algo() string UnmarshalBinarySecretKey([]byte) (S, error) UnmarshalBinaryPublicKey([]byte) (P, error) UnmarshalBinarySignature([]byte) (Sig, error) MarshalBinarySecretKey(S) []byte MarshalBinaryPublicKey(P) []byte MarshalBinarySignature(Sig) []byte Sign(S, []byte) Sig Derive(S) P New() S Verify(Sig, P, []byte) error }
Click to show internal directories.
Click to hide internal directories.