Class PropertyToX509CertificateConverter
java.lang.Object
se.swedenconnect.security.credential.converters.PropertyToX509CertificateConverter
- All Implemented Interfaces:
Aware
,ApplicationContextAware
,Converter<String,
X509Certificate>
public class PropertyToX509CertificateConverter
extends Object
implements Converter<String,X509Certificate>, ApplicationContextAware
A
Converter
that gets the property value (e.g., classpath:cert.crt
) and instantiates a
X509Certificate
object.
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 Details
-
PropertyToX509CertificateConverter
public PropertyToX509CertificateConverter()
-
-
Method Details
-
convert
- Specified by:
convert
in interfaceConverter<String,
X509Certificate>
-
setApplicationContext
- Specified by:
setApplicationContext
in interfaceApplicationContextAware
- Throws:
BeansException
-