Class PropertyToX509CertificateConverter

java.lang.Object
se.swedenconnect.security.credential.spring.converters.AbstractResourcePropertyConverter<X509Certificate>
se.swedenconnect.security.credential.spring.converters.PropertyToX509CertificateConverter
All Implemented Interfaces:
Aware, ApplicationContextAware, Converter<String,X509Certificate>

public class PropertyToX509CertificateConverter extends AbstractResourcePropertyConverter<X509Certificate>
A Converter that gets the property value (e.g., classpath:cert.crt) and instantiates an X509Certificate object. The converter also handles "inlined" PEM certificates.

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 PropertyToX509CertificateConverter propertyToX509CertificateConverter() {
   return new PropertyToX509CertificateConverter();
 }
 
Author:
Martin Lindström (martin@idsec.se)