Package com.tangosol.net.ssl
Class AbstractPrivateKeyLoader
- java.lang.Object
-
- com.tangosol.net.ssl.AbstractPrivateKeyLoader
-
- All Implemented Interfaces:
PrivateKeyLoader
- Direct Known Subclasses:
URLPrivateKeyLoader
public abstract class AbstractPrivateKeyLoader extends Object implements PrivateKeyLoader
A base class forPrivateKeyLoader
implementations.- Since:
- 22.06
- Author:
- Jonathan Knight 2020.01.25
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractPrivateKeyLoader(String sName)
Create aAbstractPrivateKeyLoader
.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
protected abstract InputStream
getInputStream()
Open anInputStream
for the specified named resource, which should be the contents of a JavaPrivateKey
in the format required by thisPrivateKeyLoader
implementation.String
getName()
Return the name of the private ky to load.int
hashCode()
PrivateKey
load(PasswordProvider provider)
Load a namedPrivateKey
.protected void
safeClose(Closeable closeable)
String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.tangosol.net.ssl.PrivateKeyLoader
isEnabled, isRefreshable
-
-
-
-
Field Detail
-
m_sName
protected final String m_sName
The name of the private key to load.
-
-
Constructor Detail
-
AbstractPrivateKeyLoader
protected AbstractPrivateKeyLoader(String sName)
Create aAbstractPrivateKeyLoader
.- Parameters:
sName
- the name of the private key to load
-
-
Method Detail
-
load
public PrivateKey load(PasswordProvider provider) throws GeneralSecurityException, IOException
Description copied from interface:PrivateKeyLoader
Load a namedPrivateKey
.- Specified by:
load
in interfacePrivateKeyLoader
- Parameters:
provider
- an optionalPasswordProvider
for encrypted keys- Returns:
- the
PrivateKey
ornull
if no key could be loaded - Throws:
GeneralSecurityException
IOException
-
getName
public String getName()
Return the name of the private ky to load.- Returns:
- the name of the private ky to load
-
getInputStream
protected abstract InputStream getInputStream() throws IOException
Open anInputStream
for the specified named resource, which should be the contents of a JavaPrivateKey
in the format required by thisPrivateKeyLoader
implementation.How the
InputStream
is created based on the name is purely dependent on how subclasses are implemented. For example, the name could be a URL, or it could refer to a name of a secret in some secrets store, etc.- Returns:
- an
InputStream
containing the named resource contents, ornull
if noInputStream
could be opened - Throws:
IOException
- if an error occurs creating theInputStream
-
safeClose
protected void safeClose(Closeable closeable)
Close the specifiedCloseable
, ignoring any errors or the fact that theCloseable
may benull
.Any exception thrown calling
Closeable.close()
will be ignored.- Parameters:
closeable
- theCloseable
to close
-
-