Jose\JWTCreator::enableEncryptionSupport PHP Method

enableEncryptionSupport() public method

public enableEncryptionSupport ( jose\EncrypterInterface $encrypter )
$encrypter jose\EncrypterInterface
    public function enableEncryptionSupport(EncrypterInterface $encrypter)
    {
        $this->encrypter = $encrypter;
    }

Usage Example

 /**
  * @param \Jose\SignerInterface         $signer
  * @param \Jose\EncrypterInterface|null $encrypter
  *
  * @return \Jose\JWTCreator
  */
 public function createJWTCreator(SignerInterface $signer, EncrypterInterface $encrypter = null)
 {
     $jwt_creator = new JWTCreator($signer);
     if (null !== $encrypter) {
         $jwt_creator->enableEncryptionSupport($encrypter);
     }
     return $jwt_creator;
 }