Class NameToSigningCredentialConverter

java.lang.Object
se.idsec.signservice.integration.config.spring.NameToSigningCredentialConverter
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.core.convert.converter.Converter<String,se.swedenconnect.security.credential.PkiCredential>

public class NameToSigningCredentialConverter extends Object implements org.springframework.core.convert.converter.Converter<String,se.swedenconnect.security.credential.PkiCredential>, org.springframework.context.ApplicationContextAware
For Spring Framework users. A Converter that lets the user reference a PkiCredential instance using its bean name, or if no bean is found, the signing credential name PkiCredential.getName().

To use this converter it has to be instantiated as a bean and then registered in the registry using ConverterRegistry.addConverter(Converter).

If you are using Spring Boot, do:

 @Bean
 @ConfigurationPropertiesBinding
 public NameToSigningCredentialConverter nameToSigningCredentialConverter() {
   return new NameToSigningCredentialConverter();
 }
 
Author:
Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
  • Constructor Details

    • NameToSigningCredentialConverter

      public NameToSigningCredentialConverter()
  • Method Details

    • convert

      public se.swedenconnect.security.credential.PkiCredential convert(@Nonnull String source)
      Specified by:
      convert in interface org.springframework.core.convert.converter.Converter<String,se.swedenconnect.security.credential.PkiCredential>
    • setApplicationContext

      public void setApplicationContext(@Nonnull org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
      Throws:
      org.springframework.beans.BeansException