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
|
String |
verify(String sig,
ByteBuffer data)
Try with all signatures and return the name of the signature that matched
|
public String verify(String sig, ByteBuffer data)
public static PublicKey getX509PublicKey(byte[] buf) throws Exception
Exception
public 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 signedInvalidKeyException
SignatureException
public static byte[] decryptRSA(byte[] buffer, PublicKey pubKey) throws InvalidKeyException, BadPaddingException, IllegalBlockSizeException
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.