public class RSAs extends Asymmetrics
在pkcs1 规范中,定义了RSA的格式,规范等。 在pkcs8 规范中,描述私有密钥信息格式,该信息包括公开密钥算法的私有密钥以及可选的属性集等。也就是说,针对RSA 算法而言,多种非对称加密算法都可以使用 pkcs8 格式。 pkcs 8 比pkcs 1中的内容更丰富一些。 但两种可以相互转换的。
| 构造器和说明 |
|---|
RSAs() |
| 限定符和类型 | 方法和说明 |
|---|---|
static byte[] |
decrypt(byte[] bytes,
byte[] priKey) |
static byte[] |
decrypt(byte[] bytes,
byte[] priKey,
String algorithmTransformation,
Provider provider,
SecureRandom secureRandom) |
static byte[] |
encrypt(byte[] bytes,
byte[] pubKey) |
static byte[] |
encrypt(byte[] bytes,
byte[] pubKey,
String algorithmTransformation,
Provider provider,
SecureRandom secureRandom) |
static byte[] |
pkcs8_to_pkcs1(byte[] pkcs8PrivateKey) |
decrypt, decrypt, decryptUsePubKey, encrypt, encrypt, encryptUsePriKeyaddDefaultTransformation, createAlgorithmTransformation, createAlgorithmTransformation, createCipher, createCipher, createCipher, createCipher, createEmptyCipher, decrypt, decrypt, decrypt, decrypt, decrypt, doEncryptOrDecrypt, doEncryptOrDecrypt, doEncryptOrDecrypt, encrypt, encrypt, encrypt, encrypt, encrypt, extractAlgorithm, extractCipherAlgorithm, extractSymmetricMode, getAlgorithmSuiteRegistry, getDefaultTransformationaddProvider, getLangxSecurityProvider, getProvider, getSecureRandom, insertProvider, insertProviderAt, langxProviderInstalled, loadLangxProvider, setuppublic static final String RSA
public static byte[] encrypt(byte[] bytes,
byte[] pubKey)
public static byte[] encrypt(byte[] bytes,
byte[] pubKey,
String algorithmTransformation,
Provider provider,
SecureRandom secureRandom)
public static byte[] decrypt(byte[] bytes,
byte[] priKey)
public static byte[] decrypt(byte[] bytes,
byte[] priKey,
String algorithmTransformation,
Provider provider,
SecureRandom secureRandom)
public static byte[] pkcs8_to_pkcs1(byte[] pkcs8PrivateKey)
pkcs8PrivateKey - 符合pkcs#8 标准的 der 格式的 bytes,并且是 未加密的Copyright © 2022. All rights reserved.