public class KeyReader extends Object
| Constructor and Description |
|---|
KeyReader() |
| Modifier and Type | Method and Description |
|---|---|
static KeyPair |
generateNewRsaKeyPair(int keyLength) |
static PrivateKey |
readPrivateRSAKey(byte[] privateKey)
will read a private rsa key from a given byte-array of a
PKCS8EncodedKeySpec |
static PublicKey |
readPublicRSAKey(byte[] publicKey)
will read a public rsa key from a given byte-array of a
X509EncodedKeySpec |
static X509Certificate |
readX509Certificate(byte[] certificateBytes)
should read a X509 certificate from the given byte-array
|
static X509Certificate |
readX509Certificate(InputStream certificateStream)
should read a X509 certificate from the given byte-array
|
public static PrivateKey readPrivateRSAKey(byte[] privateKey)
PKCS8EncodedKeySpecprivateKey - the bytes of the rsa keyKeyGenerationException - if the private key could not be created from the given byte-arraypublic static PublicKey readPublicRSAKey(byte[] publicKey)
X509EncodedKeySpecpublicKey - the bytes of the rsa keyKeyGenerationException - if the public key could not be created from the given byte-arraypublic static X509Certificate readX509Certificate(byte[] certificateBytes)
certificateBytes - the bytes of the certificateCertificateCreationException - if the certificate could not be created from the given data.public static X509Certificate readX509Certificate(InputStream certificateStream)
certificateStream - the certificate inputstreamCertificateCreationException - if the certificate could not be created from the given data.public static KeyPair generateNewRsaKeyPair(int keyLength)
keyLength - the key length of the RSA key that should be generatedCopyright © 2020. All rights reserved.