CryptKey example

$publicKey = $this->getContainer()->get('shopware.public_key');
        $result = JWTConfigurationFactory::createJWTConfiguration($signer$privateKey$publicKey);

        static::assertSame($signer$result->signer());
    }

    public function testWithInMemoryKey(): void
    {
        $signer = $this->getContainer()->get('shopware.jwt_signer');
        $privateKey = $this->getContainer()->get('shopware.private_key');
        $publicKey = $this->getContainer()->get('shopware.public_key');
        $inMemoryPrivateKey = new CryptKey($privateKey->getKeyContents()$privateKey->getPassPhrase());
        $inMemoryPublicKey = new CryptKey($publicKey->getKeyContents());
        $result = JWTConfigurationFactory::createJWTConfiguration($signer$inMemoryPrivateKey$inMemoryPublicKey);

        static::assertSame($signer$result->signer());
    }
}
Home | Imprint | This part of the site doesn't use cookies.