diff --git a/src/VAPID.php b/src/VAPID.php index 091e4832..c741ec97 100644 --- a/src/VAPID.php +++ b/src/VAPID.php @@ -190,8 +190,8 @@ public static function createVapidKeys(): array } return [ - 'publicKey' => base64_encode($binaryPublicKey), - 'privateKey' => base64_encode($binaryPrivateKey) + 'publicKey' => Base64Url::encode($binaryPublicKey), + 'privateKey' => Base64Url::encode($binaryPrivateKey) ]; } } diff --git a/tests/VAPIDTest.php b/tests/VAPIDTest.php index 580c9441..a8c114e8 100644 --- a/tests/VAPIDTest.php +++ b/tests/VAPIDTest.php @@ -98,7 +98,7 @@ public function testCreateVapidKeys() $keys = VAPID::createVapidKeys(); $this->assertArrayHasKey('publicKey', $keys); $this->assertArrayHasKey('privateKey', $keys); - $this->assertEquals(strlen($keys['publicKey']), 88); - $this->assertEquals(strlen($keys['privateKey']), 44); + $this->assertGreaterThanOrEqual(86, strlen($keys['publicKey'])); + $this->assertGreaterThanOrEqual(42, strlen($keys['privateKey'])); } }