issuer method

String? issuer({
  1. String? oid,
  2. ASN1DistinguishedNames? dn,
})

Implementation

String? issuer({String? oid, ASN1DistinguishedNames? dn}) {
  if (oid == null && dn != null) {
    oid = dn.oid();
  }
  if (oid != null) {
    var issuerBlock = block1?.atIndex(X509BlockPosition.issuer);
    if (issuerBlock != null) {
      var oidBlock = issuerBlock.findOid(oidValue: oid);
      if (oidBlock != null) {
        var sub = oidBlock.parent?.sub;
        if (sub != null && sub.length > 0 && sub.last.value is String) {
          return sub.last.value;
        } else {
          return null;
        }
      }
    }
  }
  return null;
}