Class PEMFileRSAPrivateKeySupplier
- java.lang.Object
- 
- com.oracle.bmc.http.signing.internal.PEMFileRSAPrivateKeySupplier
 
- 
- All Implemented Interfaces:
- KeySupplier<RSAPrivateKey>
 
 public class PEMFileRSAPrivateKeySupplier extends Object implements KeySupplier<RSAPrivateKey> An implementation ofKeySupplierthat 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
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classPEMFileRSAPrivateKeySupplier.PEMFileRSAPrivateKeySupplierExceptionAn exception in thePEMFileRSAPrivateKeySupplier.
 - 
Constructor SummaryConstructors Constructor Description PEMFileRSAPrivateKeySupplier(InputStream inputStream, char[] passphraseCharacters)Constructs a new file key supplier which reads the private key from the specified file.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<RSAPrivateKey>supplyKey()Get the key from the file.Optional<RSAPrivateKey>supplyKey(String ignored)Get the key from the file.
 
- 
- 
- 
Constructor Detail- 
PEMFileRSAPrivateKeySupplierpublic PEMFileRSAPrivateKeySupplier(@Nonnull InputStream inputStream, @Nullable 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. - Parameters:
- inputStream- the path to the RSA private key
- passphraseCharacters- the passphrase of the private key, optional
 
 
- 
 - 
Method Detail- 
supplyKeypublic Optional<RSAPrivateKey> supplyKey(@Nonnull String ignored) Get the key from the file.- Specified by:
- supplyKeyin interface- KeySupplier<RSAPrivateKey>
- Parameters:
- ignored- this parameter is ignored. The key returned is always the same, the one from the file.
- Returns:
- an Optional for the key
 
 - 
supplyKey@Nonnull public Optional<RSAPrivateKey> supplyKey() Get the key from the file.- Returns:
- an Optional for the key
 
 
- 
 
-