Package com.google.step2.discovery

Examples of com.google.step2.discovery.LinkValue$Parser


      protected String getRequiredCn(String authority) {
        return "hosted-id.google.com";
      }
    };

    return new DisjunctiveCertValidator(defaultValidator, hardCodedValidator);
  }
View Full Code Here


          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

      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

      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

      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

          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

    URI siteXrdsUri = URI.create("http://example.com/xrds");

    FetchRequest httpRequest = FetchRequest.createGetRequest(siteXrdsUri);

    expect(verifier.verify(isA(byte[].class), (String) isNull()))
        .andStubThrow(new XmlSimpleSignException("no signature"));
    expect(fetcher.fetch(httpRequest)).andReturn(new FakeResponse(SITE_XRD));

    control.replay();
    List<SecureDiscoveryInformation> result =
        xrdResolver.findOpEndpointsForSite(host, siteXrdsUri);
View Full Code Here

    URI siteXrdsUri = URI.create("http://example.com/xrds");

    FetchRequest httpRequest = FetchRequest.createGetRequest(siteXrdsUri);

    expect(verifier.verify(isA(byte[].class), (String) isNull()))
        .andStubThrow(new XmlSimpleSignException("no signature"));
    expect(fetcher.fetch(httpRequest)).andReturn(new FakeResponse(USER_XRD));

    control.replay();
    List<SecureDiscoveryInformation> result =
        xrdResolver.findOpEndpointsForUser(user, siteXrdsUri);
View Full Code Here

    URI siteXrdsUri = URI.create("http://example.com/xrds");

    FetchRequest httpRequest = FetchRequest.createGetRequest(siteXrdsUri);

    expect(verifier.verify(isA(byte[].class), (String) isNull()))
        .andStubThrow(new XmlSimpleSignException("no signature"));
    expect(fetcher.fetch(httpRequest)).andReturn(new FakeResponse(USER_XRD_WITH_LOCAL_ID));

    control.replay();
    List<SecureDiscoveryInformation> result =
        xrdResolver.findOpEndpointsForUser(user, siteXrdsUri);
View Full Code Here

    URI siteXrdsUri = URI.create("http://example.com/xrds");

    FetchRequest httpRequest = FetchRequest.createGetRequest(siteXrdsUri);

    expect(verifier.verify(isA(byte[].class), (String) isNull()))
        .andStubThrow(new XmlSimpleSignException("no signature"));
    expect(fetcher.fetch(httpRequest)).andReturn(new FakeResponse(SITE_XRD));

    String userXrdsUri = "https://www.google.com/accounts/o8/user-xrds?uri="
        + URLEncoder.encode(user.getIdentifier(), "UTF-8");
View Full Code Here

TOP

Related Classes of com.google.step2.discovery.LinkValue$Parser

Copyright © 2018 www.massapicom. 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.