public final Result check(PushCertificate cert){
  if (checkNonce && cert.getNonceStatus() != NonceStatus.OK) {
    return new Result(null,CheckResult.bad("Invalid nonce"));
  }
  List<CheckResult> results=new ArrayList<>(2);
  Result sigResult=null;
  try {
    PGPSignature sig=readSignature(cert);
    if (sig != null) {
      @SuppressWarnings("resource") Repository repo=getRepository();
      try (PublicKeyStore store=new PublicKeyStore(repo)){
        sigResult=checkSignature(sig,cert,store);
        results.add(checkCustom(repo));
      }
  finally {
        if (shouldClose(repo)) {
          repo.close();
        }
      }
    }
 else {
      results.add(CheckResult.bad("Invalid signature format"));
    }
  }
 catch (  PGPException|IOException e) {
    String msg="Internal error checking push certificate";
    log.error(msg,e);
    results.add(CheckResult.bad(msg));
  }
  return combine(sigResult,results);
}

public final Result check ( PushCertificate cert ) { if ( checkNonce && cert . getNonceStatus ( ) != NonceStatus . OK ) { return new Result ( null , CheckResult . bad ( "Invalid nonce" ) ) ; } List < CheckResult > results = new ArrayList < > ( 2 ) ; Result sigResult = null ; try { PGPSignature sig = readSignature ( cert ) ; if ( sig != null ) { @ SuppressWarnings ( "resource" ) Repository repo = getRepository ( ) ; try ( PublicKeyStore store = new PublicKeyStore ( repo ) ) { sigResult = checkSignature ( sig , cert , store ) ; results . add ( checkCustom ( repo ) ) ; } finally { if ( shouldClose ( repo ) ) { repo . close ( ) ; } } } else { results . add ( CheckResult . bad ( "Invalid signature format" ) ) ; } } catch ( PGPException | IOException e ) { String msg = "Internal error checking push certificate" ; log . error ( msg , e ) ; results . add ( CheckResult . bad ( msg ) ) ; } return combine ( sigResult , results ) ; }
check a push certificate .
