java.lang.Object
org.cryptomator.cryptolib.common.ECKeyPair
org.cryptomator.cryptolib.common.P384KeyPair
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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 P384KeyPairLoads a key pair from the given filevoidstore(OutputStream out, char[] passphrase) Stores this key in PKCS#12 format to the given output streamvoidStores this key pair in PKCS#12 format at the given pathMethods inherited from class org.cryptomator.cryptolib.common.ECKeyPair
destroy, equals, getPrivate, getPublic, hashCode, isDestroyed, keyPair
-
Method Details
-
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
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
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
-