Class PropertyToPublicKeyConverter
java.lang.Object
se.swedenconnect.security.credential.spring.converters.AbstractResourcePropertyConverter<PublicKey>
se.swedenconnect.security.credential.spring.converters.PropertyToPublicKeyConverter
- All Implemented Interfaces:
Aware,ApplicationContextAware,Converter<String,PublicKey>
A
Converter that gets the property value (e.g., classpath:trust.key) and instantiates a
PublicKey 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 PropertyToPublicKeyConverter propertyToPublicKeyConverter() {
return new PropertyToPublicKeyConverter();
}
- Author:
- Martin Lindström (martin@idsec.se)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvert(InputStream inputStream) Converts the input stream to the object supported by the converter.protected booleanisInlinedPem(String property) Tells whether the property value holds an "inlined" PEM representation of the object.Methods inherited from class se.swedenconnect.security.credential.spring.converters.AbstractResourcePropertyConverter
convert, setApplicationContext
-
Constructor Details
-
PropertyToPublicKeyConverter
public PropertyToPublicKeyConverter()
-
-
Method Details
-
convert
Converts the input stream to the object supported by the converter.The stream must not be closed.
- Specified by:
convertin classAbstractResourcePropertyConverter<PublicKey>- Parameters:
inputStream- the stream- Returns:
- the object
- Throws:
KeyException
-
isInlinedPem
Tells whether the property value holds an "inlined" PEM representation of the object.- Specified by:
isInlinedPemin classAbstractResourcePropertyConverter<PublicKey>- Parameters:
property- the property value- Returns:
trueif the property holds a PEM object, andfalseotherwise
-