plainText example

CryptKey $privateKey,
        CryptKey $publicKey,
        ?Encoder $encoder = null,
        ?Decoder $decoder = null
    ): Configuration {
        /** @var non-empty-string $privateKeyText */
        $privateKeyText = $privateKey->getKeyContents();
        /** @var non-empty-string $publicKeyText */
        $publicKeyText = $publicKey->getKeyContents();

        if ($privateKey->getKeyPath() === '') {
            $privateKey = InMemory::plainText($privateKeyText$privateKey->getPassPhrase() ?? '');
            $publicKey = InMemory::plainText($publicKeyText$publicKey->getPassPhrase() ?? '');
        } else {
            $privateKey = InMemory::file($privateKey->getKeyPath()$privateKey->getPassPhrase() ?? '');
            $publicKey = InMemory::file($publicKey->getKeyPath()$publicKey->getPassPhrase() ?? '');
        }

        $configuration = Configuration::forAsymmetricSigner(
            $signer,
            $privateKey,
            $publicKey,
            $encoder,
            


    #[Route('/store-api/app-system/{name}/generate-token', name: 'store-api.app-system.generate-token', methods: ['POST'])]     public function generate(string $name, SalesChannelContext $context): JsonResponse
    {
        if ($context->getCustomer() === null) {
            throw AppException::jwtGenerationRequiresCustomerLoggedIn();
        }

        ['app_secret' => $appSecret, 'privileges' => $privileges] = $this->fetchAppDetails($name);

        $key = InMemory::plainText($appSecret);

        $configuration = Configuration::forSymmetricSigner(
            new Sha256(),
            $key
        );

        $expiration = new \DateTimeImmutable('+10 minutes');
        $shopId = $this->shopIdProvider->getShopId();
        $builder = $configuration
            ->builder()
            ->issuedBy($shopId)
            
Home | Imprint | This part of the site doesn't use cookies.