aboutsummaryrefslogtreecommitdiff
path: root/docs/serverkeyformat.md
diff options
context:
space:
mode:
authorAdit Sachde <23707194+aditsachde@users.noreply.github.com>2020-10-22 07:21:31 -0400
committerGitHub <noreply@github.com>2020-10-22 12:21:31 +0100
commitb66b2eab32b1d31c3cbdc5fb733022d69b66da80 (patch)
treee60321f9874ca3784555619259efdc07bea13534 /docs/serverkeyformat.md
parentf32320a2355b960e45d42c5cbe7cfea820873767 (diff)
Document dendrite server key format (#1520)
Co-authored-by: Kegsay <kegan@matrix.org>
Diffstat (limited to 'docs/serverkeyformat.md')
-rw-r--r--docs/serverkeyformat.md29
1 files changed, 29 insertions, 0 deletions
diff --git a/docs/serverkeyformat.md b/docs/serverkeyformat.md
new file mode 100644
index 00000000..feda9345
--- /dev/null
+++ b/docs/serverkeyformat.md
@@ -0,0 +1,29 @@
+# Server Key Format
+
+Dendrite stores the server signing key in the PEM format with the following structure.
+
+```
+-----BEGIN MATRIX PRIVATE KEY-----
+Key-ID: ed25519:<Key Handle>
+
+<Base64 Encoded Key Data>
+-----END MATRIX PRIVATE KEY-----
+```
+
+## Converting Synapse Keys
+
+If you have signing keys from a previous synapse server, you should ideally configure them as `old_private_keys` in your Dendrite config file. Synapse stores signing keys in the following format.
+
+```
+ed25519 <Key Handle> <Base64 Encoded Key Data>
+```
+
+To convert this key to Dendrite's PEM format, use the following template. **It is important to include the equals sign, as the key data needs to be padded to 32 bytes.**
+
+```
+-----BEGIN MATRIX PRIVATE KEY-----
+Key-ID: ed25519:<Key Handle>
+
+<Base64 Encoded Key Data>=
+-----END MATRIX PRIVATE KEY-----
+``` \ No newline at end of file