Package org.jscep.transport

Examples of org.jscep.transport.HttpGetTransport.sendRequest()


  private X509Certificate getRecipient() throws Exception {
    GetCaCertRequest req = new GetCaCertRequest();
    Transport transport = new HttpGetTransport(getURL());

    CertStore store = transport.sendRequest(req,
        new GetCaCertResponseHandler());
    Collection<? extends Certificate> certs = store.getCertificates(null);

    if (certs.size() > 0) {
      return (X509Certificate) certs.iterator().next();
View Full Code Here


  @Test
  public void testGetCaCaps() throws Exception {
    GetCaCapsRequest req = new GetCaCapsRequest();
    Transport transport = new HttpGetTransport(getURL());
    Capabilities caps = transport.sendRequest(req,
        new GetCaCapsResponseHandler());

    System.out.println(caps);
  }
View Full Code Here

  @Test
  public void getNextCaCertificateGood() throws Exception {
    GetNextCaCertRequest req = new GetNextCaCertRequest(goodIdentifier);
    Transport transport = new HttpGetTransport(getURL());
    CertStore certs = transport.sendRequest(req,
        new GetNextCaCertResponseHandler(getRecipient()));

    assertThat(certs.getCertificates(null).size(), is(1));
  }
View Full Code Here

  @Test(expected = TransportException.class)
  public void getNextCaCertificateBad() throws Exception {
    GetNextCaCertRequest req = new GetNextCaCertRequest(badIdentifier);
    Transport transport = new HttpGetTransport(getURL());
    CertStore certs = transport.sendRequest(req,
        new GetNextCaCertResponseHandler(getRecipient()));

    assertThat(certs.getCertificates(null).size(), is(1));
  }
View Full Code Here

    LOGGER.debug("Determining capabilities of SCEP server");
    // NON-TRANSACTIONAL
    final GetCaCapsRequest req = new GetCaCapsRequest(profile);
    final Transport trans = new HttpGetTransport(url);
    try {
      return trans.sendRequest(req, new GetCaCapsResponseHandler());
    } catch (TransportException e) {
      LOGGER.warn("Transport problem when determining capabilities.  Using empty capabilities.");
      return new Capabilities();
    }
  }
View Full Code Here

    final GetCaCertRequest req = new GetCaCertRequest(profile);
    final Transport trans = new HttpGetTransport(url);

    CertStore store;
    try {
      store = trans.sendRequest(req, new GetCaCertResponseHandler());
    } catch (TransportException e) {
      throw new ClientException(e);
    }
    CertStoreInspector certs = CertStoreInspector.getInstance(store);
    verifyCA(certs.getIssuer());
View Full Code Here

    final Transport trans = new HttpGetTransport(url);
    final GetNextCaCertRequest req = new GetNextCaCertRequest(profile);

    try {
      return trans.sendRequest(req, new GetNextCaCertResponseHandler(
          signer));
    } catch (TransportException e) {
      throw new ClientException(e);
    }
  }
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.