/** * @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); }
/** * @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); }
/** * @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); }