public class Ciphers extends Object
| 构造器和说明 |
|---|
Ciphers() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
createAlgorithmTransformation(String transformation)
https://docs.oracle.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec.html#trans
transformation 有两种形式:
1) 只有algorithm name
2) 由3部分构成:{algorithm name}/{mode}/padding
|
static String |
createAlgorithmTransformation(String algorithm,
String mode,
String padding) |
static Cipher |
createCipher(String algorithmTransformation,
Provider provider,
int operateMode,
Certificate certificate,
SecureRandom secureRandom) |
static Cipher |
createCipher(String algorithmTransformation,
Provider provider,
int operateMode,
Key key,
AlgorithmParameterSpec parameterSpec,
SecureRandom secureRandom) |
static Cipher |
createCipher(String algorithmTransformation,
Provider provider,
int operateMode,
Key key,
AlgorithmParameters parameters,
SecureRandom secureRandom) |
static Cipher |
createCipher(String algorithmTransformation,
Provider provider,
int operateMode,
Key key,
SecureRandom secureRandom) |
static Cipher |
createEmptyCipher(String algorithmTransformation,
Provider provider) |
static byte[] |
decrypt(Cipher cipher,
byte[] data) |
static byte[] |
encrypt(Cipher cipher,
byte[] data) |
public static Cipher createEmptyCipher(@NonNull String algorithmTransformation, @Nullable Provider provider)
public static Cipher createCipher(@NonNull String algorithmTransformation, @Nullable Provider provider, int operateMode, Key key, SecureRandom secureRandom)
public static Cipher createCipher(@NonNull String algorithmTransformation, @Nullable Provider provider, int operateMode, Key key, @Nullable AlgorithmParameterSpec parameterSpec, SecureRandom secureRandom)
public static Cipher createCipher(@NonNull String algorithmTransformation, @Nullable Provider provider, int operateMode, Key key, @Nullable AlgorithmParameters parameters, SecureRandom secureRandom)
public static Cipher createCipher(@NonNull String algorithmTransformation, @Nullable Provider provider, int operateMode, Certificate certificate, SecureRandom secureRandom)
public static byte[] encrypt(Cipher cipher, byte[] data)
public static byte[] decrypt(Cipher cipher, byte[] data)
public static String createAlgorithmTransformation(String transformation)
transformation 有两种形式:
1) 只有algorithm name
2) 由3部分构成:{algorithm name}/{mode}/padding
Copyright © 2021. All rights reserved.