Package org.apache.solr.util
Class CryptoKeys.RSAKeyPair
- java.lang.Object
- 
- org.apache.solr.util.CryptoKeys.RSAKeyPair
 
- 
- Enclosing class:
- CryptoKeys
 
 public static class CryptoKeys.RSAKeyPair extends Object 
- 
- 
Constructor SummaryConstructors Constructor Description RSAKeyPair()Create an RSA key pair with newly generated keys.RSAKeyPair(URL privateKeyResourceName, URL publicKeyResourceName)Initialize an RSA key pair from previously saved keys.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]encrypt(ByteBuffer buffer)PublicKeygetPublicKey()StringgetPublicKeyStr()byte[]signSha256(byte[] bytes)
 
- 
- 
- 
Constructor Detail- 
RSAKeyPairpublic RSAKeyPair() Create an RSA key pair with newly generated keys.
 - 
RSAKeyPairpublic 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 file
- publicKeyResourceName- path to public key file, encoded as X509 in a DER file
- Throws:
- IOException- if an I/O error occurs reading either key file
- InvalidKeySpecException- if either key file is inappropriate for an RSA key
 
 
- 
 - 
Method Detail- 
getPublicKeyStrpublic String getPublicKeyStr() 
 - 
getPublicKeypublic PublicKey getPublicKey() 
 - 
encryptpublic byte[] encrypt(ByteBuffer buffer) 
 - 
signSha256public byte[] signSha256(byte[] bytes) 
 
- 
 
-