Class Utils
java.lang.Object
uk.ac.manchester.spinnaker.alloc.security.Utils
Support utility methods for working with SSL stuff.
- 
Method SummaryModifier and TypeMethodDescriptionstatic voidSet up the default SSL context so that we can inject our trust store for verifying servers.static KeyStoreLoads a trust store.static X509TrustManagertrustManager(KeyStore truststore) Load a trust store into a trust manager.
- 
Method Details- 
trustManagerLoad a trust store into a trust manager.- Parameters:
- truststore- The trust store to load, or- nullto use the default.
- Returns:
- The configured trust manager.
- Throws:
- GeneralSecurityException- If things go wrong.
- See Also:
 
- 
installInjectableTrustStoreAsDefaultpublic static void installInjectableTrustStoreAsDefault(Supplier<X509TrustManager> injector) throws GeneralSecurityException Set up the default SSL context so that we can inject our trust store for verifying servers.- Parameters:
- injector- How to get the value to inject.
- Throws:
- GeneralSecurityException- If the SSL context can't be built.
- See Also:
 
- 
loadTrustStorepublic static KeyStore loadTrustStore(SpallocProperties.OpenIDProperties props) throws GeneralSecurityException, IOException Loads a trust store.- Parameters:
- props- Where is the trust store and how should we load it?
- Returns:
- The trust store. Note that this is not installed into anything.
- Throws:
- GeneralSecurityException- If the trust store contains bad info.
- IOException- If the trust store can't be read at all.
 
 
-