generateSignature method Null safety

String generateSignature(
  1. Map<String, dynamic> params
)
inherited

Generate signature.

Returns a String containing the signature from the params used to sign the http requests to the Veryfi API.

Implementation

String generateSignature(Map<String, dynamic> params) {
  Map<String, dynamic> rawParams = Map<String, dynamic>.from(params);
  List<int> messageBytes = utf8.encode(jsonEncode(rawParams));
  List<int> key = utf8.encode(credentials.clientSecret);
  Hmac hmac = Hmac(sha256, key);
  Digest digest = hmac.convert(messageBytes);
  return base64.encode(digest.bytes);
}