KeySupplier that supplies a RSA private key from a PEM file.
Supports PKCS#8 (starts with '-----BEGIN PRIVATE KEY-----' tag), PKCS#8 encrypted key (starts
with '-----BEGIN ENCRYPTED PRIVATE KEY-----' tag) and PKCS#1 (i.e., starts with '-----BEGIN RSA
PRIVATE KEY-----' tag) format.
Example commands that can be used to generate a 2048 bits RSA private key:
$ openssl genrsa -out privateKey 2048
$ ssh-keygen -t rsa -b 2048
| Modifier and Type | Class and Description |
|---|---|
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| private final PEMStreamRSAPrivateKeySupplier | |
| private static final Logger |
| Access | Constructor and Description |
|---|---|
| public | PEMFileRSAPrivateKeySupplier(final InputStream
the path to the RSA private key inputStream, final char[] the passphrase of the private key, optional passphraseCharacters)Constructs a new file key supplier which reads the private key from the specified file. |
| Modifier and Type | Method and Description |
|---|---|
| public Optional | Returns: an Optional for the keythis parameter is ignored. The key returned is always the same, the one from
the file. ignored)Implements com. Get the key from the file. |
| public Optional |
| delegate | back to summary |
|---|---|
| private final PEMStreamRSAPrivateKeySupplier delegate | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG | |
| PEMFileRSAPrivateKeySupplier | back to summary |
|---|---|
| public PEMFileRSAPrivateKeySupplier(final InputStream inputStream, final char[] passphraseCharacters) Constructs a new file key supplier which reads the private key from the specified file. The provided stream will be closed by this supplier automatically.
| |
| supplyKey | back to summary |
|---|---|
| public Optional Implements com. Get the key from the file.
| |
| supplyKey | back to summary |
|---|---|
| public Optional Get the key from the file.
| |
PEMFileRSAPrivateKeySupplier.
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| PEMFileRSAPrivateKeySupplierException | back to summary |
|---|---|
| public PEMFileRSAPrivateKeySupplierException(String message, Throwable cause) | |
| PEMFileRSAPrivateKeySupplierException | back to summary |
|---|---|
| public PEMFileRSAPrivateKeySupplierException(Throwable cause) | |