RSA class
RSA公钥/私钥/签名加密解密
罗纳德·李维斯特(Ron R
ivest)、阿迪·萨莫尔(Adi S
hamir)和伦纳德·阿德曼(Leonard A
dleman)
由于非对称加密速度极其缓慢,一般文件不使用它来加密而是使用对称加密,
非对称加密算法可以用来对对称加密的密钥加密,这样保证密钥的安全也就保证了数据的安全
- Inheritance
-
- Object
- Asymmetric
- RSA
Constructors
- RSA({RSAPublicKey? publicKey, RSAPrivateKey? privateKey, String? privateKeyText, String? publicKeyText, Digest? digest, RSAEncoding encoding = RSAEncoding.pkcs1, int bitLength = 2048})
-
factory
- RSA.oaep({RSAPrivateKey? privateKey, RSAPublicKey? publicKey, Digest? digest})
-
factory
- RSA.pkcs({RSAPrivateKey? privateKey, RSAPublicKey? publicKey, Digest? digest})
-
factory
Properties
- bitLength ↔ int
-
自动生成公钥、私钥对时的位大小
getter/setter pair
- digest ↔ Digest
-
摘要算法
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- privateKey ↔ RSAPrivateKey?
-
私钥
getter/setter pairinherited
- publicKey ↔ RSAPublicKey?
-
公钥
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- signer ↔ Signer
-
算法签名对象
getter/setter pair
Methods
-
decrypt(
{bool isPublicKey = false, required Uint8List data}) → Uint8List -
解密
override
-
encrypt(
{bool isPublicKey = true, required Uint8List data}) → Uint8List -
加密
override
-
generateSignature(
{bool isPublicKey = false, required Uint8List message}) → RSASignature -
对传入的
message
进行签名(通常是哈希函数的输出) -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setPrivateKey(
String privateKey) → void - 设置私钥
-
setPublicKey(
String publicKey) → void -
toString(
) → String -
A string representation of this object.
inherited
-
verifySignature(
{bool isPublicKey = true, required Uint8List message, required Signature signature}) → bool -
根据
签名
验证消息
。
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited