findOid method

ASN1Object? findOid({
  1. OID? oid,
  2. String? oidValue,
})

Implementation

ASN1Object? findOid({OID? oid, String? oidValue}) {
  oidValue = oid != null ? oid.toValue() : oidValue;
  for (var child in (sub ?? <ASN1Object>[])) {
    if (child.identifier?.tagNumber() ==
        ASN1IdentifierTagNumber.OBJECT_IDENTIFIER) {
      if (child.value == oidValue) {
        return child;
      }
    } else {
      var result = child.findOid(oidValue: oidValue);
      if (result != null) {
        return result;
      }
    }
  }
  return null;
}