Examples of VerificationResult


Examples of com.github.tomakehurst.wiremock.verification.VerificationResult

public class GetRequestCountTask implements AdminTask {

    @Override
    public ResponseDefinition execute(Admin admin, Request request) {
        RequestPattern requestPattern = buildRequestPatternFrom(request.getBodyAsString());
        VerificationResult result = admin.countRequestsMatching(requestPattern);
        ResponseDefinition response = new ResponseDefinition(HTTP_OK, write(result));
        response.setHeaders(new HttpHeaders(httpHeader("Content-Type", "application/json")));
        return response;
    }
View Full Code Here

Examples of com.google.step2.xmlsimplesign.VerificationResult

          id.getIdentifier());
      return false;
    }

    // now, check the signature:
    VerificationResult verificatioResult;
    try {
      verificatioResult = verifier.verify(xrd.getDocument(), xrd.getSignature());
    } catch (XmlSimpleSignException e) {
      logger.log(Level.WARNING, "signature on XRD from " + xrd.getSource() +
          "did not verify", e);
      return false;
    }

    // finally, validate the signing cert (make sure it belongs to the authority
    // that is supposed to have signed this XRD). If we're not given an
    // authority, the XRD should be signed by the entity identified in the
    // canonical id.
    authority = (authority == null) ? canonicalId : authority;
    return certValidator.matches(verificatioResult.getCerts().get(0), authority);
  }
View Full Code Here

Examples of com.google.step2.xmlsimplesign.VerificationResult

      throws Exception {
    UrlIdentifier user = new UrlIdentifier("http://balfanz.net/openid?id=12345");
    URI siteXrdsUri = URI.create("http://example.com/xrds");

    FetchRequest httpRequest = FetchRequest.createGetRequest(siteXrdsUri);
    VerificationResult verification = new VerificationResult(
        ImmutableList.of(
            CertConstantUtil.SERVER_PUB_CERT,
            CertConstantUtil.INTERMEDIATE_PUB_CERT));

    expect(fetcher.fetch(httpRequest)).andReturn(new FakeResponse(SITE_XRD));
View Full Code Here

Examples of com.google.step2.xmlsimplesign.VerificationResult

      throws Exception {
    UrlIdentifier user = new UrlIdentifier("http://balfanz.net/openid?id=12345");
    URI siteXrdsUri = URI.create("http://example.com/xrds");

    FetchRequest httpRequest = FetchRequest.createGetRequest(siteXrdsUri);
    VerificationResult verification = new VerificationResult(
        ImmutableList.of(
            CertConstantUtil.SERVER_PUB_CERT,
            CertConstantUtil.INTERMEDIATE_PUB_CERT));

    expect(fetcher.fetch(httpRequest))
View Full Code Here

Examples of com.google.step2.xmlsimplesign.VerificationResult

      throws Exception {
    UrlIdentifier user = new UrlIdentifier("http://balfanz.net/openid?id=12345");
    URI siteXrdsUri = URI.create("http://example.com/xrds");

    FetchRequest httpRequest = FetchRequest.createGetRequest(siteXrdsUri);
    VerificationResult verification = new VerificationResult(
        ImmutableList.of(
            CertConstantUtil.SERVER_PUB_CERT,
            CertConstantUtil.INTERMEDIATE_PUB_CERT));
    FakeResponse siteResponse = new FakeResponse(SITE_XRD);
    siteResponse.setSignature("siteSig");
View Full Code Here

Examples of org.apache.bcel.verifier.VerificationResult

            // construct verifier for class file
            Verifier verifier = VerifierFactory.getVerifier(file.getName());
           
            // run validation in stages with error handling for each stage
            boolean verified = false;
            VerificationResult vr = verifier.doPass1();
            if (vr.getStatus() == VerificationResult.VERIFIED_OK) {
                vr = verifier.doPass2();
                if (vr.getStatus() == VerificationResult.VERIFIED_OK) {
                    Method[] methods = file.getRawClass().getMethods();
                    for (int j = 0; j < methods.length; j++) {
                        vr = verifier.doPass3a(j);
                        if (vr.getStatus() == VerificationResult.VERIFIED_OK) {
                            vr = verifier.doPass3b(j);
                        }
                        if (vr.getStatus() == VerificationResult.VERIFIED_OK) {
                            verified = true;
                        } else {
                            System.out.println
                                ("Verification failure on method " +
                                methods[j].getName() + " of class " +
                                file.getName() + ":");
                            System.out.println("  " + vr.toString());
                        }
                    }
                } else {
                    System.out.println("Verification failure on class " +
                        file.getName() + ":");
                    System.out.println("  " + vr.toString());
                }
            } else {
                System.out.println("Verification failure on class " +
                    file.getName() + ":");
                System.out.println("  " + vr.toString());
            }
            return verified;
           
        } catch (Exception ex) {    // catch BCEL errors
            System.out.println("BCEL failure:");
View Full Code Here

Examples of org.apache.bcel.verifier.VerificationResult

                circulationPump(mg,cfg, cfg.contextOf(mg.getInstructionList().getStart()), f, icv, ev);
            }
        }
        catch (VerifierConstraintViolatedException ce){
            ce.extendMessage("Constraint violated in method '"+methods[method_no]+"':\n","");
            return new VerificationResult(VerificationResult.VERIFIED_REJECTED, ce.getMessage());
        }
        catch (RuntimeException re){
            // These are internal errors

            StringWriter sw = new StringWriter();
View Full Code Here

Examples of org.apache.bcel.verifier.VerificationResult

   */
  public void visitLoadClass(LoadClass o){
    ObjectType t = o.getLoadClassType(cpg);
    if (t != null){// null means "no class is loaded"
      Verifier v = VerifierFactory.getVerifier(t.getClassName());
      VerificationResult vr = v.doPass2();
      if (vr.getStatus() != VerificationResult.VERIFIED_OK){
        constraintViolated((Instruction) o, "Class '"+o.getLoadClassType(cpg).getClassName()+"' is referenced, but cannot be loaded and resolved: '"+vr+"'.");
      }
    }
  }
View Full Code Here

Examples of org.apache.bcel.verifier.VerificationResult

      // the o.getClassType(cpg) type has passed pass 2; see visitLoadClass(o).
      Type t = o.getType(cpg);
      if (t instanceof ObjectType){
        String name = ((ObjectType)t).getClassName();
        Verifier v = VerifierFactory.getVerifier( name );
        VerificationResult vr = v.doPass2();
        if (vr.getStatus() != VerificationResult.VERIFIED_OK){
          constraintViolated((Instruction) o, "Class '"+name+"' is referenced, but cannot be loaded and resolved: '"+vr+"'.");
        }
      }
   }
View Full Code Here

Examples of org.apache.bcel.verifier.VerificationResult

    Type t = o.getType(cpg);
    if (t instanceof ObjectType){
      String name = ((ObjectType)t).getClassName();
      Verifier v = VerifierFactory.getVerifier( name );
      VerificationResult vr = v.doPass2();
      if (vr.getStatus() != VerificationResult.VERIFIED_OK){
        constraintViolated((Instruction) o, "Class '"+name+"' is referenced, but cannot be loaded and resolved: '"+vr+"'.");
      }
    }

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.