Package org.jscep.transaction

Examples of org.jscep.transaction.Transaction


        priKey);
    PkiMessageDecoder decoder = new PkiMessageDecoder(getRecipient(),
        envDecoder);

    Transport transport = new HttpGetTransport(getURL());
    Transaction t = new NonEnrollmentTransaction(transport, encoder,
        decoder, iasn, MessageType.GET_CRL);
    State s = t.send();

    assertThat(s, is(State.CERT_ISSUED));
  }
View Full Code Here


        priKey);
    PkiMessageDecoder decoder = new PkiMessageDecoder(getRecipient(),
        envDecoder);

    Transport transport = new HttpGetTransport(getURL());
    Transaction t = new NonEnrollmentTransaction(transport, encoder,
        decoder, iasn, MessageType.GET_CERT);
    State s = t.send();

    assertThat(s, is(State.CERT_NON_EXISTANT));
  }
View Full Code Here

        priKey);
    PkiMessageDecoder decoder = new PkiMessageDecoder(getRecipient(),
        envDecoder);

    Transport transport = new HttpGetTransport(getURL());
    Transaction t = new EnrollmentTransaction(transport, encoder, decoder,
        csr);

    State s = t.send();
    assertThat(s, is(State.CERT_ISSUED));
  }
View Full Code Here

        priKey);
    PkiMessageDecoder decoder = new PkiMessageDecoder(getRecipient(),
        envDecoder);

    Transport transport = new HttpGetTransport(getURL());
    Transaction t = new EnrollmentTransaction(transport, encoder, decoder,
        csr);

    State s = t.send();
    assertThat(s, is(State.CERT_ISSUED));
  }
View Full Code Here

    checkDistributionPoints(profile);

    X500Name name = new X500Name(issuer.getName());
    IssuerAndSerialNumber iasn = new IssuerAndSerialNumber(name, serial);
    Transport transport = createTransport(profile);
    final Transaction t = new NonEnrollmentTransaction(transport,
        getEncoder(identity, key, profile), getDecoder(identity, key,
            profile), iasn, MessageType.GET_CRL);
    State state;
    try {
      state = t.send();
    } catch (TransactionException e) {
      throw new ClientException(e);
    }

    if (state == State.CERT_ISSUED) {
      try {
        Collection<X509CRL> crls = (Collection<X509CRL>) t
            .getCertStore().getCRLs(null);
        if (crls.size() == 0) {
          return null;
        }
        return crls.iterator().next();
      } catch (CertStoreException e) {
        throw new RuntimeException(e);
      }
    } else if (state == State.CERT_REQ_PENDING) {
      throw new IllegalStateException();
    } else {
      throw new OperationFailureException(t.getFailInfo());
    }
  }
View Full Code Here

    final X509Certificate ca = certs.getIssuer();

    X500Name name = new X500Name(ca.getIssuerX500Principal().toString());
    IssuerAndSerialNumber iasn = new IssuerAndSerialNumber(name, serial);
    Transport transport = createTransport(profile);
    final Transaction t = new NonEnrollmentTransaction(transport,
        getEncoder(identity, key, profile), getDecoder(identity, key,
            profile), iasn, MessageType.GET_CERT);

    State state;
    try {
      state = t.send();
    } catch (TransactionException e) {
      throw new ClientException(e);
    }

    if (state == State.CERT_ISSUED) {
      return t.getCertStore();
    } else if (state == State.CERT_REQ_PENDING) {
      throw new IllegalStateException();
    } else {
      throw new OperationFailureException(t.getFailInfo());
    }
  }
View Full Code Here

TOP

Related Classes of org.jscep.transaction.Transaction

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.