public class PrivateKeyReader extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
P1_BEGIN_MARKER |
static String |
P1_END_MARKER |
static String |
P8_BEGIN_MARKER |
static String |
P8_END_MARKER |
| Constructor and Description |
|---|
PrivateKeyReader() |
| Modifier and Type | Method and Description |
|---|---|
static PrivateKey |
getPrivateKey(InputStream stream,
String algorithm)
Get a Private Key for the file.
|
static PrivateKey |
getPrivateKey(String fileName)
Get a RSA Private Key from InputStream.
|
static PrivateKey |
getPrivateKey(String fileName,
String algorithm)
Get a Private Key from InputStream.
|
public static final String P1_BEGIN_MARKER
public static final String P1_END_MARKER
public static final String P8_BEGIN_MARKER
public static final String P8_END_MARKER
public static PrivateKey getPrivateKey(String fileName) throws IOException, GeneralSecurityException
fileName - file nameIOException - IOException resulted from invalid file IOGeneralSecurityException - GeneralSecurityException resulted from invalid key formatpublic static PrivateKey getPrivateKey(String fileName, String algorithm) throws IOException, GeneralSecurityException
fileName - file namealgorithm - the name of the key algorithm, for example "RSA" or "EC"IOException - IOException resulted from invalid file IOGeneralSecurityException - GeneralSecurityException resulted from invalid key datapublic static PrivateKey getPrivateKey(InputStream stream, String algorithm) throws IOException, GeneralSecurityException
stream - InputStream objectalgorithm - the name of the key algorithm, for example "RSA" or "EC"IOException - IOException resulted from invalid file IOGeneralSecurityException - GeneralSecurityException resulted from invalid key dataCopyright © 2019. All rights reserved.