public final class CryptoKeys extends Object
| Modifier and Type | Class and Description | 
|---|---|
| static class  | CryptoKeys.RSAKeyPair | 
| Constructor and Description | 
|---|
| CryptoKeys(Map<String,byte[]> trustedKeys) | 
| Modifier and Type | Method and Description | 
|---|---|
| static String | decodeAES(String base64CipherTxt,
         String pwd) | 
| static String | decodeAES(String base64CipherTxt,
         String pwd,
         int keySizeBits) | 
| static byte[] | decryptRSA(byte[] buffer,
          PublicKey pubKey) | 
| static PublicKey | deserializeX509PublicKey(String pubKey) | 
| static PublicKey | getX509PublicKey(byte[] buf)Create PublicKey from a .DER file | 
| static void | main(String[] args) | 
| static boolean | verify(PublicKey publicKey,
      byte[] sig,
      ByteBuffer data)Verify the signature of a file | 
| static boolean | verify(PublicKey publicKey,
      byte[] sig,
      InputStream is) | 
| String | verify(String sig,
      ByteBuffer data)Try with all signatures and return the name of the signature that matched | 
| String | verify(String sig,
      InputStream is) | 
public String verify(String sig, ByteBuffer data)
public String verify(String sig, InputStream is)
public static PublicKey getX509PublicKey(byte[] buf) throws Exception
Exceptionpublic static boolean verify(PublicKey publicKey, byte[] sig, ByteBuffer data) throws InvalidKeyException, SignatureException
publicKey - the public key used to sign thissig - the signaturedata - The data tha is signedInvalidKeyExceptionSignatureExceptionpublic static boolean verify(PublicKey publicKey, byte[] sig, InputStream is) throws InvalidKeyException, SignatureException, IOException
public static byte[] decryptRSA(byte[] buffer,
                                PublicKey pubKey)
                         throws InvalidKeyException,
                                BadPaddingException,
                                IllegalBlockSizeException
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.