Exemple #1
0
 /**
  * @return \SpomkyLabs\Jose\Payload\PayloadConverterManagerInterface
  */
 protected function getPayloadConverterManager()
 {
     $payload_converter_manager = new PayloadConverterManager();
     $payload_converter_manager->addConverter(new JWKConverter($this->getJWKManager()))->addConverter(new JWKSetConverter($this->getJWKSetManager()));
     return $payload_converter_manager;
 }
Exemple #2
0
 /**
  *
  */
 private function setPayloadConverterManager()
 {
     $this->container['PayloadConverterManager'] = function ($c) {
         $payload_converter_manager = new PayloadConverterManager();
         $converters = ['jwk' => 'PayloadConverter.JWK', 'jwkset' => 'PayloadConverter.JWKSet'];
         foreach ($converters as $converter => $service) {
             if (true === $c['Configuration']->get("payload-converter.{$converter}")) {
                 $payload_converter_manager->addConverter($c[$service]);
             }
         }
         return $payload_converter_manager;
     };
 }