Package eirb.pub.app.utils
Class Keys
java.lang.Object
eirb.pub.app.utils.Keys
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PrivateKeygetRSAPrivateKey(byte[] bytes) Get an RSA Private Key based on its byte representation.static PrivateKeygetRSAPrivateKey(String key) static PublicKeygetRSAPublicKey(byte[] bytes) Get an RSA Public Key based on its byte representation.static PublicKeygetRSAPublicKey(String key) static KeyPair
-
Constructor Details
-
Keys
public Keys()
-
-
Method Details
-
getRSAPublicKey
Get an RSA Public Key based on its byte representation. Needs to be formated with X509- Parameters:
bytes- representation of the Public key in bytes- Returns:
- PublicKey represented by the bytes
- Throws:
InvalidKeySpecException- If the key is not formatted with X509
-
getRSAPublicKey
- Throws:
InvalidKeySpecException
-
getRSAPrivateKey
Get an RSA Private Key based on its byte representation. Needs to be formated with PKCS8- Parameters:
bytes- representation of the Private key in bytes- Returns:
- PrivateKey represented by the bytes
- Throws:
InvalidKeySpecException- If the key is not formatted with PKCS8
-
getRSAPrivateKey
- Throws:
InvalidKeySpecException
-
randomRSA
-