protected function createSignatureToken($origin, \DateTime $expiration = null)
    {
        if (is_null($expiration)) {
            $expiration = new \DateTime('+ 1 hours');
        }

        $signer = new ES256();
        $privateKey = new Key('file://'.$this->getParameter('privateKey'));

        $builder = new Builder();
        $token = $builder
            ->setAudience($origin)
            ->setExpiration($expiration->getTimestamp())
            ->sign($signer, $privateKey)
            ->getToken();

        return $token;
    }
protected function createSignatureToken($origin, \DateTime $expiration = null)
    {
        if (is_null($expiration)) {
            $expiration = new \DateTime('+ 1 hours');
        }

        $signer = new ES256();
        $privateKey = new Key('file://'.$this->getParameter('privateKey'));

        $builder = new Builder();
        $token = $builder
            ->setAudience($origin)
            ->setExpiration($expiration->getTimestamp())
            ->sign($signer, $privateKey)
            ->getToken();

        return $token;
    }
protected function createSignatureToken ( $ origin , \ DateTime $ expiration = null ) { if ( is_null ( $ expiration ) ) { $ expiration = new \ DateTime ( '+ 1 hours' ) ; } $ signer = new ES256 ( ) ; $ privateKey = new Key ( 'file://' . $ this -> getParameter ( 'privateKey' ) ) ; $ builder = new Builder ( ) ; $ token = $ builder -> setAudience ( $ origin ) -> setExpiration ( $ expiration -> getTimestamp ( ) ) -> sign ( $ signer , $ privateKey ) -> getToken ( ) ; return $ token ; }
Create the JWT signed by using ES256.

@param string    $origin
@param \DateTime $expiration

@return \Lcobucci\JWT\Token
Create the JWT signed by using ES256 .