dump method

  1. @override
String dump({
  1. int spaces = 0,
})
override

Creates a readable dump from the current ASN1Object.

Important note: Subclasses need to override this method. If the ASN1Object is constructed and has child elements, dump() has to be called for each child element.

Implementation

@override
String dump({int spaces = 0}) {
  var sb = StringBuffer();
  for (var i = 0; i < spaces; i++) {
    sb.write(' ');
  }
  if (isConstructed!) {
    sb.write('PRINTABLE STRING (${elements!.length} elem)');
    for (var e in elements!) {
      var dump = e.dump(spaces: spaces + dumpIndent);
      sb.write('\n$dump');
    }
  } else {
    sb.write('PRINTABLE STRING $stringValue');
  }
  return sb.toString();
}