Class PropertyToX509CertificateConverter
java.lang.Object
se.idsec.signservice.integration.config.spring.PropertyToX509CertificateConverter
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
,org.springframework.core.convert.converter.Converter<String,
X509Certificate>
public class PropertyToX509CertificateConverter
extends Object
implements org.springframework.core.convert.converter.Converter<String,X509Certificate>, org.springframework.context.ApplicationContextAware
For Spring Framework users. A
Converter
that gets the property value (e.g., classpath:cert.crt
) and
instantiates a X509Certificate
onbject.
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), Stefan Santesson (stefan@idsec.se)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
setApplicationContext
(org.springframework.context.ApplicationContext applicationContext) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.core.convert.converter.Converter
andThen
-
Constructor Details
-
PropertyToX509CertificateConverter
public PropertyToX509CertificateConverter()
-
-
Method Details
-
convert
- Specified by:
convert
in interfaceorg.springframework.core.convert.converter.Converter<String,
X509Certificate>
-
setApplicationContext
public void setApplicationContext(@Nonnull org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
- Throws:
org.springframework.beans.BeansException
-