src/Jwt/SignatureGenerator/WebTokenJwtSignatureGenerator.php
public function generate(JwtInterface $jwt): string
    {
        $jwk = JWKFactory::createFromKeyFile($jwt->getPath(), '', [
            'kid' => $jwt->getKey(),
        ]);

        $claims = [
            'iss' => $jwt->getTeamId(),
            'iat' => time(),
        ];

        $header = [
            'alg' => 'ES256',
            'kid' => $jwk->get('kid'),
        ];

        $payload = $this->jsonConverter->encode($claims);

        $jws = $this->jwsBuilder
            ->create()
            ->withPayload($payload)
            ->addSignature($jwk, $header)
            ->build();

        return $this->serializer->serialize($jws);
    }
public function generate(JwtInterface $jwt): string
    {
        $jwk = JWKFactory::createFromKeyFile($jwt->getPath(), '', [
            'kid' => $jwt->getKey(),
        ]);

        $claims = [
            'iss' => $jwt->getTeamId(),
            'iat' => time(),
        ];

        $header = [
            'alg' => 'ES256',
            'kid' => $jwk->get('kid'),
        ];

        $payload = $this->jsonConverter->encode($claims);

        $jws = $this->jwsBuilder
            ->create()
            ->withPayload($payload)
            ->addSignature($jwk, $header)
            ->build();

        return $this->serializer->serialize($jws);
    }
public function generate ( JwtInterface $ jwt ) : string { $ jwk = JWKFactory :: createFromKeyFile ( $ jwt -> getPath ( ) , '' , [ 'kid' => $ jwt -> getKey ( ) , ] ) ; $ claims = [ 'iss' => $ jwt -> getTeamId ( ) , 'iat' => time ( ) , ] ; $ header = [ 'alg' => 'ES256' , 'kid' => $ jwk -> get ( 'kid' ) , ] ; $ payload = $ this -> jsonConverter -> encode ( $ claims ) ; $ jws = $ this -> jwsBuilder -> create ( ) -> withPayload ( $ payload ) -> addSignature ( $ jwk , $ header ) -> build ( ) ; return $ this -> serializer -> serialize ( $ jws ) ; }
{@inheritdoc}
{