public class SSLeayPrivateKey
extends java.lang.Object
implements java.security.PrivateKey
| Constructor and Description |
|---|
SSLeayPrivateKey(java.io.InputStream is)
Reads a private key created by SSLeay from the specified file.
|
SSLeayPrivateKey(java.lang.String fileName)
Reads a private key created by SSLeay from the specified file.
|
| Modifier and Type | Method and Description |
|---|---|
void |
decrypt(java.lang.String password)
Decrypts this private key.
|
java.lang.String |
getAlgorithm()
Returns the symmetric encryption algorithm used to protect this private key.
|
byte[] |
getEncoded()
This method is not supported and therefore returns null.
|
java.lang.String |
getFormat()
Returns the format used to encode the key or null if the
key does not support encoding.
|
java.security.PrivateKey |
getPrivateKey()
Returns the included private key.
|
boolean |
isEncrypted()
Returns true if this private key is encrypted.
|
public SSLeayPrivateKey(java.lang.String fileName)
throws java.io.IOException,
java.security.InvalidKeyException
fileName - the name of the file containing the private keyjava.io.IOException - if an error occurs during reading the keyjava.security.InvalidKeyException - if the key can not be parsedpublic SSLeayPrivateKey(java.io.InputStream is)
throws java.io.IOException,
java.security.InvalidKeyException
is - an input stream containing the private keyjava.io.IOException - if an error occurs during reading the keyjava.security.InvalidKeyException - if the key can not be parsedpublic boolean isEncrypted()
public java.security.PrivateKey getPrivateKey()
throws java.security.InvalidKeyException
java.security.InvalidKeyException - if an error occurs during parsing this private key or the
is not decrypted yetpublic void decrypt(java.lang.String password)
throws java.security.InvalidKeyException
password - the password to decrypt the private keyjava.security.InvalidKeyExceptionpublic java.lang.String getAlgorithm()
getAlgorithm in interface java.security.Keypublic byte[] getEncoded()
getEncoded in interface java.security.Keypublic java.lang.String getFormat()
getFormat in interface java.security.Key