Package net.jsign
Class PrivateKeyUtils
- java.lang.Object
-
- net.jsign.PrivateKeyUtils
-
public class PrivateKeyUtils extends Object
Helper class for loading private keys (PVK or PEM, encrypted or not).- Since:
- 2.0
- Author:
- Emmanuel Bourg
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static PrivateKey
load(File file, String password)
Load the private key from the specified file.
-
-
-
Method Detail
-
load
public static PrivateKey load(File file, String password) throws KeyException
Load the private key from the specified file. Supported formats are PVK and PEM, encrypted or not. The type of the file is inferred from its extension (.pvk
for PVK files,.pem
for PEM files).- Parameters:
file
- the file to load the key frompassword
- the password protecting the key- Returns:
- the private key loaded
- Throws:
KeyException
- if the key cannot be loaded
-
-