public void test404() throws Exception {
KeyPair keyPair = KeyPairGenerator.getInstance("RSA").generateKeyPair();
PkcsPkiEnvelopeEncoder envEnc = new PkcsPkiEnvelopeEncoder(
getCertificate(keyPair), "DES");
PkiMessageEncoder enc = new PkiMessageEncoder(keyPair.getPrivate(),
getCertificate(keyPair), envEnc);
TransactionId transId = TransactionId.createTransactionId();
Nonce senderNonce = Nonce.nextNonce();
X500Name name = new X500Name("CN=jscep.org");
BigInteger serialNumber = BigInteger.ONE;
IssuerAndSerialNumber iasn = new IssuerAndSerialNumber(name,
serialNumber);
GetCert getCert = new GetCert(transId, senderNonce, iasn);
PkiOperationRequest req = new PkiOperationRequest(enc.encode(getCert));
try {
transport.sendRequest(req, new PkiOperationResponseHandler());
} catch (TransportException e) {
Assert.assertEquals(e.getMessage(), "404 Not Found");