MacSink class abstract
A sink for calculating a Mac.
Example
import 'package:cryptography/cryptography.dart';
void main() {
final secretKey = SecretKey([1,2,3]);
// Create a sink
final sink = Hmac(sha256).newSink(
secretKey: secretKey,
);
// Add chunks of data
sink.add([4,5,6]);
sink.add([7,8]);
// Close
sink.close();
// We now have a MAC
final mac = sink.mac;
print('MAC: ${mac.bytes');
}
- Inheritance
-
- Object
- ByteConversionSink
- MacSink
- Implementers
Constructors
- MacSink()
Properties
Methods
-
add(
List< int> chunk) → void -
Adds chunked data to this sink.
override
-
addSlice(
List< int> chunk, int start, int end, bool isLast) → void -
Adds the next
chunk
tothis
.inherited -
close(
) → void -
Closes the sink.
override
-
mac(
) → Future< Mac> - Calculates current MAC.
-
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