ECCiphertext class

Provides an authenticated ciphertext with asymmetric ECC encryption/decryption.

This uses ECDH to determine a shared symmetric key between the sender and recipient. The plaintext is encrypted using authenticated AES-GCM. PKCS7 padding is used.

Constructors

ECCiphertext.encrypt({required Uint8List plaintext, required ECPublicKey recipientKey, required ECPrivateKey senderKey})
Encrypts plaintext using the private senderKey and public recipientKey.
ECCiphertext.fromBytes(Uint8List bytes)
ECCiphertext.fromReader(BytesReader reader)

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size int
Obtains the cached size of the object
no setterinherited

Methods

decrypt({required ECPrivateKey recipientKey, required ECPublicKey senderKey}) Uint8List?
Obtains the plaintext by decrypting with the private recipientKey and public senderKey.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toBytes() Uint8List
Obtains a cached Uint8List with data serialized for this object
inherited
toHex() String
inherited
toString() String
A string representation of this object.
inherited
write(Writer writer) → void
Override to write data into writer

Operators

operator ==(Object other) bool
The equality operator.
inherited