Package org.apache.solr.util
Class CryptoKeys
- java.lang.Object
- 
- org.apache.solr.util.CryptoKeys
 
- 
 public final class CryptoKeys extends Object A utility class to verify signatures
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classCryptoKeys.RSAKeyPair
 - 
Constructor SummaryConstructors Constructor Description CryptoKeys(Map<String,byte[]> trustedKeys)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringdecodeAES(String base64CipherTxt, String pwd)static StringdecodeAES(String base64CipherTxt, String pwd, int keySizeBits)static byte[]decryptRSA(byte[] buffer, PublicKey pubKey)static PublicKeydeserializeX509PublicKey(String pubKey)static PublicKeygetX509PublicKey(byte[] buf)Create PublicKey from a .DER filestatic voidmain(String[] args)Stringverify(String sig, ByteBuffer data)Try with all signatures and return the name of the signature that matchedstatic booleanverify(PublicKey publicKey, byte[] sig, ByteBuffer data)Verify the signature of a file
 
- 
- 
- 
Method Detail- 
verifypublic String verify(String sig, ByteBuffer data) Try with all signatures and return the name of the signature that matched
 - 
getX509PublicKeypublic static PublicKey getX509PublicKey(byte[] buf) throws Exception Create PublicKey from a .DER file- Throws:
- Exception
 
 - 
verifypublic static boolean verify(PublicKey publicKey, byte[] sig, ByteBuffer data) throws InvalidKeyException, SignatureException Verify the signature of a file- Parameters:
- publicKey- the public key used to sign this
- sig- the signature
- data- The data tha is signed
- Throws:
- InvalidKeyException
- SignatureException
 
 - 
decryptRSApublic static byte[] decryptRSA(byte[] buffer, PublicKey pubKey) throws InvalidKeyException, BadPaddingException, IllegalBlockSizeException
 
- 
 
-