示例#1
0
 /**
  * @param string[]                                  $algorithms
  * @param \Jose\Payload\PayloadConverterInterface[] $payload_converters
  * @param string[]                                  $compression_methods
  *
  * @return \Jose\EncrypterInterface
  */
 public static function createEncrypter(array $algorithms, array $payload_converters = [], array $compression_methods = ['DEF'])
 {
     $algorithm_manager = AlgorithmManagerFactory::createAlgorithmManager($algorithms);
     $payload_converter_manager = PayloadConverterFactory::createPayloadConverter($payload_converters);
     $compression_manager = CompressionManagerFactory::createCompressionManager($compression_methods);
     return new Encrypter($algorithm_manager, $payload_converter_manager, $compression_manager);
 }
示例#2
0
 /**
  * @param string[]                                  $algorithms
  * @param \Jose\Payload\PayloadConverterInterface[] $payload_converters
  *
  * @return \Jose\SignerInterface
  */
 public static function createSigner(array $algorithms, array $payload_converters = [])
 {
     $algorithm_manager = AlgorithmManagerFactory::createAlgorithmManager($algorithms);
     $payload_converter_manager = PayloadConverterFactory::createPayloadConverter($payload_converters);
     return new Signer($algorithm_manager, $payload_converter_manager);
 }
示例#3
0
 /**
  * @param \Jose\Payload\PayloadConverterInterface[] $payload_converters
  *
  * @return \Jose\LoaderInterface
  */
 public static function createLoader(array $payload_converters = [])
 {
     $payload_converter_manager = PayloadConverterFactory::createPayloadConverter($payload_converters);
     return new Loader($payload_converter_manager);
 }