Browse Source

fix(doc) calirfy how to generate the keys for public validation

master
Daniel Hansson 2 years ago
parent
commit
04e906cc2d
No account linked to committer's email address
1 changed files with 10 additions and 1 deletions
  1. 10
    1
      doc/tokens.md

+ 10
- 1
doc/tokens.md View File

@@ -21,6 +21,15 @@ found here: [http://jwt.io/#libraries-io]
21 21
 For the **Public Key Validation** a _key server_ must be provided via `asap_key_server` to verify the token against a 
22 22
 provided public key on the given key server. An example structure can be view in [Example Structure > Publiy Key Validation](#public-key-validation)
23 23
 
24
+This is how you generate the keys:
25
+```
26
+openssl genrsa -out keypair.pem 2048
27
+openssl rsa -in keypair.pem -pubout -out publickey.pem
28
+openssl pkcs8 -topk8 -inform PEM -outform DER -nocrypt -in keypair.pem -out moderated.der
29
+```
30
+Get the private_key_id through this command echo -n [NAME_OF_PRIVATE_KEY.der] | shasum -a 256 and change the publickey.pem name to the fetched private_key_id
31
+
32
+
24 33
 JWT authentication works with BOSH and WebSocket connections.
25 34
 
26 35
 ### Token Structure
@@ -303,4 +312,4 @@ Modify your Prosody config with these three steps:
303 312
     ```
304 313
 
305 314
 [RFC7519]: https://tools.ietf.org/html/rfc7519
306
-[http://jwt.io/#libraries-io]: http://jwt.io/#libraries-io
315
+[http://jwt.io/#libraries-io]: http://jwt.io/#libraries-io

Loading…
Cancel
Save