Documentation
¶
Index ¶
- type Format
- type Key
- func DecodeAllKeys(keys io.Reader) ([]*Key, error)
- func DecodeAllKeysWith(keys io.Reader, format Format) ([]*Key, error)
- func DecodeAllRawKeys(keys []byte) ([]*Key, error)
- func DecodeAllRawKeysWith(keys []byte, format Format) ([]*Key, error)
- func DecodeKey(key io.Reader) (*Key, error)
- func DecodeKeyWith(key io.Reader, format Format) (*Key, error)
- func DecodeRawKey(key []byte) (*Key, error)
- func DecodeRawKeyWith(key []byte, format Format) (*Key, error)
- func Generate() (*Key, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Format ¶
type Format string
const FormatDendrite Format = "dendrite"
FormatDendrite is the Dendrite (https://github.com/element-hq/dendrite) format for signing keys.
const FormatMMR Format = "mmr"
FormatMMR is the matrix-media-repo (https://github.com/t2bot/matrix-media-repo) format for signing keys.
const FormatSynapse Format = "synapse"
FormatSynapse is the Synapse (https://github.com/element-hq/synapse) format for signing keys.
type Key ¶
type Key struct {
PrivateKey ed25519.PrivateKey
KeyVersion string
}
func DecodeAllKeys ¶
DecodeAllKeys attempts to decode all keys in the given file. All contained keys must be in the same format.
func DecodeAllKeysWith ¶
DecodeAllKeysWith attempts to decode all keys in the given file with the given format.
func DecodeAllRawKeys ¶
DecodeAllRawKeys attempts to decode all keys in the given file. All contained keys must be in the same format.
func DecodeAllRawKeysWith ¶
DecodeAllRawKeysWith attempts to decode all keys in the given file with the given format.
func DecodeKey ¶
DecodeKey attempts to decode the given key in any of the supported formats. Expects a file's contents as input.
func DecodeKeyWith ¶
DecodeKeyWith attempts to decode the given key in the given format. Expects a file's contents as input.
func DecodeRawKey ¶
DecodeRawKey attempts to decode the given key in any of the supported formats. Expects a file's contents as input.
func DecodeRawKeyWith ¶
DecodeRawKeyWith attempts to decode the given key in the given format. Expects a file's contents as input.