@@ -20,9 +20,12 @@ <h2>Headers</h2>
2020 < label for ="auth "> Authorization Header:</ label >
2121 < textarea name ="auth " placeholder ="Bearer abCDef... "> </ textarea >
2222 < label for ="crypt "> Crypto-Key Header:</ label >
23- < p > The public key expressed after "p256ecdsa=" can associate this feed with the dashboard." </ p >
23+ < p > The public key expressed after "p256ecdsa=" can associate this feed with the dashboard.</ p >
2424 < textarea name ="crypt " placeholder ="p256ecdsa=abCDef.. "> </ textarea >
2525 < div class ="control ">
26+ < label for ="publicKey "> Public Key:</ label >
27+ < p > This is the public key you'd use for the Dashboard</ p >
28+ < textarea name ="publicKey " placeholder ="abCDef... " readonly =true > </ textarea >
2629 < button id ="check "> Check headers</ button >
2730</ div >
2831</ div >
@@ -61,9 +64,9 @@ <h3>Claims JSON object:</h3>
6164 < h2 > Exported Keys</ h2 >
6265< b > Auto-generated keys:</ b >
6366< p > These are ASN.1 DER formatted version of the public and private keys used to generate
64- the VAPID headers. These can be useful for languages that use DER for key import.</ p >
65- < label for ="priv "> Private Key:</ label > < textarea name ="priv "> </ textarea >
66- < label for ="pub "> Public Key:</ label > < textarea name ="pub "> </ textarea >
67+ the VAPID headers. These can be useful for languages that use DER or PEM for key import.</ p >
68+ < label for ="priv "> DER Private Key:</ label > < textarea name ="priv "> </ textarea >
69+ < label for ="pub "> DER Public Key:</ label > < textarea name ="pub "> </ textarea >
6770</ div >
6871< div id ="err " class ="hidden section "> </ div >
6972</ div >
@@ -212,12 +215,16 @@ <h2>Exported Keys</h2>
212215 . catch ( er => error ( er , "Public key export failed" ) ) ;
213216 vapid . sign ( claims )
214217 . then ( k => {
215- let auth = document . getElementsByName ( "auth" ) [ 0 ]
218+ let auth = document . getElementsByName ( "auth" ) [ 0 ] ;
216219 auth . value = k . authorization ;
217220 auth . classList . add ( 'updated' ) ;
218- let crypt = document . getElementsByName ( "crypt" ) [ 0 ]
221+ let crypt = document . getElementsByName ( "crypt" ) [ 0 ] ;
219222 crypt . value = k [ "crypto-key" ] ;
220223 crypt . classList . add ( 'updated' ) ;
224+ let pk = document . getElementsByName ( "publicKey" ) [ 0 ] ;
225+ // Public Key is the crypto key minus the 'p256ecdsa='
226+ pk . value = k . publicKey ;
227+ pk . classList . add ( 'updated' ) ;
221228 } )
222229 . catch ( err => error ( err , err_strs . enus . CLAIMS_FAIL ) ) ;
223230 } ) ;
0 commit comments