- java.lang.Object
-
- org.cryptomator.cryptolib.common.ECKeyPair
-
- org.cryptomator.cryptolib.common.P384KeyPair
-
- All Implemented Interfaces:
Destroyable
public class P384KeyPair extends ECKeyPair
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static P384KeyPaircreate(X509EncodedKeySpec publicKeySpec, PKCS8EncodedKeySpec privateKeySpec)Creates a key pair from the given key specs.static P384KeyPairgenerate()static P384KeyPairload(InputStream in, char[] passphrase)Loads a key pair from the given input streamstatic P384KeyPairload(Path p12File, char[] passphrase)Loads a key pair from the given filevoidstore(OutputStream out, char[] passphrase)Stores this key in PKCS#12 format to the given output streamvoidstore(Path p12File, char[] passphrase)Stores this key pair in PKCS#12 format at the given path-
Methods inherited from class org.cryptomator.cryptolib.common.ECKeyPair
destroy, equals, getPrivate, getPublic, hashCode, isDestroyed, keyPair
-
-
-
-
Method Detail
-
generate
public static P384KeyPair generate()
-
create
public static P384KeyPair create(X509EncodedKeySpec publicKeySpec, PKCS8EncodedKeySpec privateKeySpec) throws InvalidKeySpecException
Creates a key pair from the given key specs.- Parameters:
publicKeySpec- DER formatted public keyprivateKeySpec- DER formatted private key- Returns:
- created key pair
- Throws:
InvalidKeySpecException- If the supplied key specs are unsuitable for "EC" keys
-
load
public static P384KeyPair load(Path p12File, char[] passphrase) throws IOException, Pkcs12PasswordException, Pkcs12Exception
Loads a key pair from the given file- Parameters:
p12File- A .p12 filepassphrase- The password to protect the key material- Returns:
- loaded key pair
- Throws:
IOException- In case of I/O errorsPkcs12PasswordException- If the supplied password is incorrectPkcs12Exception- If any cryptographic operation fails
-
load
public static P384KeyPair load(InputStream in, char[] passphrase) throws IOException, Pkcs12PasswordException, Pkcs12Exception
Loads a key pair from the given input stream- Parameters:
in- An input stream providing PKCS#12 formatted datapassphrase- The password to protect the key material- Returns:
- loaded key pair
- Throws:
IOException- In case of I/O errorsPkcs12PasswordException- If the supplied password is incorrectPkcs12Exception- If any cryptographic operation fails
-
store
public void store(Path p12File, char[] passphrase) throws IOException, Pkcs12Exception
Stores this key pair in PKCS#12 format at the given path- Parameters:
p12File- The path of the .p12 filepassphrase- The password to protect the key material- Throws:
IOException- In case of I/O errorsPkcs12Exception- If any cryptographic operation fails
-
store
public void store(OutputStream out, char[] passphrase) throws IOException, Pkcs12Exception
Stores this key in PKCS#12 format to the given output stream- Parameters:
out- The output stream to which the data will be writtenpassphrase- The password to protect the key material- Throws:
IOException- In case of I/O errorsPkcs12Exception- If any cryptographic operation fails
-
-