public class CryptoUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static INumberedException.IErrorCode |
ERR_CRYPTO_BAD_PADDING |
static INumberedException.IErrorCode |
ERR_CRYPTO_DATA_LENGTH_ERROR |
static INumberedException.IErrorCode |
ERR_CRYPTO_ILLEGAL_BLOCK_SIZE |
static INumberedException.IErrorCode |
ERR_CRYPTO_ILLEGAL_STATE |
static INumberedException.IErrorCode |
ERR_CRYPTO_INVALID_CYPHER_TEXT |
static INumberedException.IErrorCode |
ERR_CRYPTO_INVALID_KEY |
static INumberedException.IErrorCode |
ERR_CRYPTO_NO_SUCH_ALGORYTHM |
static INumberedException.IErrorCode |
ERR_CRYPTO_NO_SUCH_PADDING |
static INumberedException.IErrorCode |
ERR_CRYPTO_NO_SUCH_PROVIDER |
static INumberedException.IErrorCode |
ERR_CRYPTO_UNKNOWN |
| Constructor and Description |
|---|
CryptoUtil() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
checkAESSignature(byte[] data,
byte[] signature,
byte[] aesKey,
byte[] asIv) |
static boolean |
checkRSASignature(byte[] data,
byte[] signature,
PublicKey rsaPublicKey) |
static byte[] |
decryptAESCBC_NOPAD(byte[] cipherText,
byte[] keyBytes,
byte[] ivBytes) |
static byte[] |
decryptAESCBC_PKCS7Padding(byte[] cipherText,
byte[] keyBytes,
byte[] ivBytes) |
static byte[] |
decryptAESECB_NOPAD(byte[] cipherText,
byte[] keyBytes) |
static byte[] |
decryptAESECB_PKCS7Padding(byte[] cipherText,
byte[] keyBytes) |
static byte[] |
decryptRSAPrivate(byte[] input,
PrivateKey key) |
static byte[] |
decryptRSAPublic(byte[] input,
PublicKey key) |
static byte[] |
encryptAESCBC_NOPAD(byte[] data,
byte[] keyBytes,
byte[] ivBytes) |
static byte[] |
encryptAESCBC_PKCS7Padding(byte[] data,
byte[] keyBytes,
byte[] ivBytes) |
static byte[] |
encryptAESECB_NOPAD(byte[] data,
byte[] keyBytes) |
static byte[] |
encryptAESECB_PKCS7Padding(byte[] data,
byte[] keyBytes) |
static byte[] |
encryptRSAPublic(byte[] input,
PublicKey key) |
static byte[] |
encryptRSAPublicOAEP(byte[] data,
PublicKey key) |
static byte[] |
generateSessionKey() |
static byte[] |
getAESSignature(byte[] data,
byte[] aesKey,
byte[] asIv) |
static byte[] |
getSHA1(byte[] data) |
static byte[] |
getSHA256(byte[] data) |
static byte[] |
sign(byte[] data,
PublicKey rsaPublicKey) |
static byte[] |
signRSA_SHA1(byte[] input,
PrivateKey key) |
public static final INumberedException.IErrorCode ERR_CRYPTO_NO_SUCH_ALGORYTHM
public static final INumberedException.IErrorCode ERR_CRYPTO_NO_SUCH_PADDING
public static final INumberedException.IErrorCode ERR_CRYPTO_BAD_PADDING
public static final INumberedException.IErrorCode ERR_CRYPTO_INVALID_KEY
public static final INumberedException.IErrorCode ERR_CRYPTO_ILLEGAL_BLOCK_SIZE
public static final INumberedException.IErrorCode ERR_CRYPTO_DATA_LENGTH_ERROR
public static final INumberedException.IErrorCode ERR_CRYPTO_ILLEGAL_STATE
public static final INumberedException.IErrorCode ERR_CRYPTO_INVALID_CYPHER_TEXT
public static final INumberedException.IErrorCode ERR_CRYPTO_NO_SUCH_PROVIDER
public static final INumberedException.IErrorCode ERR_CRYPTO_UNKNOWN
public static final boolean checkAESSignature(byte[] data,
byte[] signature,
byte[] aesKey,
byte[] asIv)
throws NumberedException
NumberedExceptionpublic static final byte[] getAESSignature(byte[] data,
byte[] aesKey,
byte[] asIv)
throws NumberedException
NumberedExceptionpublic static final byte[] getSHA1(byte[] data)
throws NumberedException
NumberedExceptionpublic static final byte[] getSHA256(byte[] data)
throws NumberedException
NumberedExceptionpublic static byte[] generateSessionKey()
throws NumberedException
NumberedExceptionpublic static final boolean checkRSASignature(byte[] data,
byte[] signature,
PublicKey rsaPublicKey)
public static byte[] sign(byte[] data,
PublicKey rsaPublicKey)
public static byte[] encryptRSAPublicOAEP(byte[] data,
PublicKey key)
throws NumberedException
NumberedExceptionpublic static byte[] signRSA_SHA1(byte[] input,
PrivateKey key)
throws NumberedException
NumberedExceptionpublic static byte[] encryptRSAPublic(byte[] input,
PublicKey key)
throws NumberedException
NumberedExceptionpublic static byte[] decryptRSAPrivate(byte[] input,
PrivateKey key)
throws NumberedException
NumberedExceptionpublic static byte[] decryptRSAPublic(byte[] input,
PublicKey key)
throws NumberedException
NumberedExceptionpublic static byte[] encryptAESCBC_NOPAD(byte[] data,
byte[] keyBytes,
byte[] ivBytes)
throws NumberedException
NumberedExceptionpublic static byte[] decryptAESCBC_NOPAD(byte[] cipherText,
byte[] keyBytes,
byte[] ivBytes)
throws NumberedException
NumberedExceptionpublic static byte[] encryptAESCBC_PKCS7Padding(byte[] data,
byte[] keyBytes,
byte[] ivBytes)
throws NumberedException
NumberedExceptionpublic static byte[] decryptAESCBC_PKCS7Padding(byte[] cipherText,
byte[] keyBytes,
byte[] ivBytes)
throws NumberedException
NumberedExceptionpublic static byte[] encryptAESECB_NOPAD(byte[] data,
byte[] keyBytes)
throws NumberedException
NumberedExceptionpublic static byte[] decryptAESECB_NOPAD(byte[] cipherText,
byte[] keyBytes)
throws NumberedException
NumberedExceptionpublic static byte[] encryptAESECB_PKCS7Padding(byte[] data,
byte[] keyBytes)
throws NumberedException
NumberedExceptionpublic static byte[] decryptAESECB_PKCS7Padding(byte[] cipherText,
byte[] keyBytes)
throws NumberedException
NumberedExceptionCopyright © 2018. All rights reserved.