HmacSha256Signer class

Signs binary AST files with HMAC-SHA256.

This is symmetric: the same secret signs and verifies, so anyone able to verify is also able to sign. It fits the case this format was built for — a build step signs a compiled AST and the application that loads it holds the same secret. It does not fit distributing files to parties that must verify but not sign; use a public-key ASTBinarySigner for that.

var signer = HmacSha256Signer.fromString(secret);
var bytes = vm.saveCodeUnitAST(codeUnit, signer: signer);
Implemented types

Constructors

HmacSha256Signer(List<int> key)
Signs with the raw key bytes key.
HmacSha256Signer.fromString(String key)
Signs with the UTF-8 encoding of key.

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
sign(Uint8List payload) Uint8List
Signs payload, returning at most ASTBinaryFormat.maxSignatureLength bytes.
override
toString() String
A string representation of this object.
inherited

Operators

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