Package org.apache.solr.util
Class CryptoKeys.RSAKeyPair
java.lang.Object
org.apache.solr.util.CryptoKeys.RSAKeyPair
- Enclosing class:
CryptoKeys
-
Constructor Summary
ConstructorsConstructorDescriptionCreate an RSA key pair with newly generated keys.RSAKeyPair(URL privateKeyResourceName, URL publicKeyResourceName) Initialize an RSA key pair from previously saved keys. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]encrypt(ByteBuffer buffer) intbyte[]signSha256(byte[] bytes)
-
Constructor Details
-
RSAKeyPair
public RSAKeyPair()Create an RSA key pair with newly generated keys. -
RSAKeyPair
public RSAKeyPair(URL privateKeyResourceName, URL publicKeyResourceName) throws IOException, InvalidKeySpecException Initialize an RSA key pair from previously saved keys. The formats listed below have been tested, other formats may also be acceptable but are not guaranteed to work.- Parameters:
privateKeyResourceName- path to private key file, encoded as a PKCS#8 in a PEM filepublicKeyResourceName- path to public key file, encoded as X509 in a DER file- Throws:
IOException- if an I/O error occurs reading either key fileInvalidKeySpecException- if either key file is inappropriate for an RSA key
-
-
Method Details
-
getPublicKeyStr
-
getPublicKey
-
getKeySizeInBytes
public int getKeySizeInBytes() -
encrypt
-
signSha256
public byte[] signSha256(byte[] bytes)
-