signing_key

package module
v0.0.0-...-ee2c984 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2025 License: Apache-2.0 Imports: 9 Imported by: 2

README

go-matrix-signing-key

Interoperable signing key operations.

Example

See example/readme.go.

Documentation

Index

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

func DecodeAllKeys(keys io.Reader) ([]*Key, error)

DecodeAllKeys attempts to decode all keys in the given file. All contained keys must be in the same format.

func DecodeAllKeysWith

func DecodeAllKeysWith(keys io.Reader, format Format) ([]*Key, error)

DecodeAllKeysWith attempts to decode all keys in the given file with the given format.

func DecodeAllRawKeys

func DecodeAllRawKeys(keys []byte) ([]*Key, error)

DecodeAllRawKeys attempts to decode all keys in the given file. All contained keys must be in the same format.

func DecodeAllRawKeysWith

func DecodeAllRawKeysWith(keys []byte, format Format) ([]*Key, error)

DecodeAllRawKeysWith attempts to decode all keys in the given file with the given format.

func DecodeKey

func DecodeKey(key io.Reader) (*Key, error)

DecodeKey attempts to decode the given key in any of the supported formats. Expects a file's contents as input.

func DecodeKeyWith

func DecodeKeyWith(key io.Reader, format Format) (*Key, error)

DecodeKeyWith attempts to decode the given key in the given format. Expects a file's contents as input.

func DecodeRawKey

func DecodeRawKey(key []byte) (*Key, error)

DecodeRawKey attempts to decode the given key in any of the supported formats. Expects a file's contents as input.

func DecodeRawKeyWith

func DecodeRawKeyWith(key []byte, format Format) (*Key, error)

DecodeRawKeyWith attempts to decode the given key in the given format. Expects a file's contents as input.

func Generate

func Generate() (*Key, error)

func (*Key) Encode

func (k *Key) Encode(format Format) ([]byte, error)

Encode encodes the key in the given format, ready for writing to a file.

func (*Key) KeyID

func (k *Key) KeyID() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL