ASN1MacData.fromSequence constructor

ASN1MacData.fromSequence(
  1. ASN1Sequence seq
)

Implementation

ASN1MacData.fromSequence(ASN1Sequence seq) {
  if (seq.elements!.length != 3) {
    throw ArgumentError('Sequence has not enough elements');
  }
  mac =
      ASN1DigestInfo.fromSequence(seq.elements!.elementAt(0) as ASN1Sequence);
  var o = seq.elements!.elementAt(1) as ASN1OctetString;
  if (o.valueBytes != null) {
    macSalt = o.valueBytes!;
  }
  var i = seq.elements!.elementAt(2) as ASN1Integer;
  if (i.integer != null) {
    iterationCount = i.integer!;
  }
}