Slide 29
Slide 29 text
1 // web-push/src/vapid-helper.js
2
3 function getVapidHeaders(audience, subject, publicKey, privateKey, …) {
4 // …省略…
5
6 const header = {
7 typ: 'JWT',
8 alg: 'ES256'
9 };
10
11 const jwtPayload = {
12 aud: audience,
13 exp: expiration,
14 sub: subject
15 };
16
17 // 署名:JWT(JSON Web Token)を生成
18 const jwt = jws.sign({
19 header: header,
20 payload: jwtPayload,
21 // 生成した秘密鍵で署名
22 privateKey: toPEM(privateKey)
23 });
24
ᶆൿີ伴Ͱॺ໊Λ࡞
!29