Package org.ldaptive.ssl
Class AbstractCredentialReader<T>
java.lang.Object
org.ldaptive.ssl.AbstractCredentialReader<T>
- Type Parameters:
T- Type of credential read by this instance.
- All Implemented Interfaces:
CredentialReader<T>
- Direct Known Subclasses:
KeyStoreCredentialReader,PrivateKeyCredentialReader,X509CertificateCredentialReader,X509CertificatesCredentialReader
Base class for all credential readers. It provides support for loading files from resources on the classpath or a
filepath. If a path is prefixed with the string "classpath:" it is interpreted as a classpath specification. If a
path is prefixed with the string "file:" it is interpreted as a file path. Any other input throws
IllegalArgumentException.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected InputStreamGets a buffered input stream from the given input stream.Reads a credential object from a path.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ldaptive.ssl.CredentialReader
read
-
Field Details
-
logger
Logger for this class.
-
-
Constructor Details
-
AbstractCredentialReader
public AbstractCredentialReader()
-
-
Method Details
-
read
Description copied from interface:CredentialReaderReads a credential object from a path.- Specified by:
readin interfaceCredentialReader<T>- Parameters:
path- from which to read credential.params- Arbitrary string parameters, e.g. password, needed to read the credential.- Returns:
- credential read from data at path.
- Throws:
IOException- On IO errors.GeneralSecurityException- On errors with the credential data.
-
getBufferedInputStream
Gets a buffered input stream from the given input stream. If the given instance is already buffered, it is simply returned.- Parameters:
is- input stream from which to create buffered instance.- Returns:
- buffered input stream. If the given instance is already buffered, it is simply returned.
-