RSAKeyUtil class
RSA 密钥工具
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
generateKeyPair(
{SecureRandom? secureRandom, int bitLength = 2048}) → AsymmetricKeyPair< RSAPublicKey, RSAPrivateKey> -
生成RSA公钥私钥.
默认使用Fortuna随机数生成器(使用安全性较低的随机种子初始化)
bitLength
,位强度(例如 2048 或 4096) -
parsePrivateKey(
String privateKey) → RSAPrivateKey - 解析私钥字符串
-
parsePublicKey(
String publicKey) → RSAPublicKey - 解析公钥字符串
-
privateKeyToBytes(
RSAPrivateKey privateKey, {bool rsaPublicKeyFormat = false}) → Uint8List - 私钥转byte
-
privateKeyToPem(
RSAPrivateKey privateKey, {bool rsaPublicKeyFormat = false}) → String - 私钥转PEM
-
privateKeyToPublicKey(
RSAPrivateKey privateKey) → RSAPublicKey - 私钥转公钥
-
privateKeyToString(
RSAPrivateKey privateKey, {bool rsaPublicKeyFormat = false}) → String - 私钥转base64字符串
-
publicKeyToBytes(
RSAPublicKey publicKey, {bool rsaPublicKeyFormat = false}) → Uint8List - 公钥转byte, 默认使用pkcs8格式
-
publicKeyToPem(
RSAPublicKey publicKey, {bool rsaPublicKeyFormat = false}) → String - 公钥转PEM
-
publicKeyToString(
RSAPublicKey publicKey, {bool rsaPublicKeyFormat = false}) → String - 公钥转base64字符串