public static boolean isSigningRelated(String name){
  name=name.toUpperCase(Locale.ENGLISH);
  if (!name.startsWith("META-INF/")) {
    return false;
  }
  name=name.substring(9);
  if (name.indexOf('/') != -1) {
    return false;
  }
  if (isBlockOrSF(name) || name.equals("MANIFEST.MF")) {
    return true;
  }
 else   if (name.startsWith("SIG-")) {
    int extIndex=name.lastIndexOf('.');
    if (extIndex != -1) {
      String ext=name.substring(extIndex + 1);
      if (ext.length() > 3 || ext.length() < 1) {
        return false;
      }
      for (int index=0; index < ext.length(); index++) {
        char cc=ext.charAt(index);
        if ((cc < 'A' || cc > 'Z') && (cc < '0' || cc > '9')) {
          return false;
        }
      }
    }
    return true;
  }
  return false;
}

public static boolean isSigningRelated ( String name ) { name = name . toUpperCase ( Locale . ENGLISH ) ; if ( ! name . startsWith ( "META-INF/" ) ) { return false ; } name = name . substring ( 9 ) ; if ( name . indexOf ( '/' ) != - 1 ) { return false ; } if ( isBlockOrSF ( name ) || name . equals ( "MANIFEST.MF" ) ) { return true ; } else if ( name . startsWith ( "SIG-" ) ) { int extIndex = name . lastIndexOf ( '.' ) ; if ( extIndex != - 1 ) { String ext = name . substring ( extIndex + 1 ) ; if ( ext . length ( ) > 3 || ext . length ( ) < 1 ) { return false ; } for ( int index = 0 ; index < ext . length ( ) ; index ++ ) { char cc = ext . charAt ( index ) ; if ( ( cc < 'A' || cc > 'Z' ) && ( cc < '0' || cc > '9' ) ) { return false ; } } } return true ; } return false ; }
yet another utility method used by jarverifier and jarsigner to determine what files are signature related , which includes the manifest , sf files , known signature block files , and other unknown signature related files ( those starting with sig - with an optional [ a - z0 - 9 ] { 1 , 3 } extension right inside meta - inf ) .
