byte[] encoded = derObject.getEncoded();
return encoded;
}
protected TimeStampResponse getTimeStampResponse(final TimeStampRequest request, final byte[] responseBytes) throws IOException, TSPException {
TimeStampResponse response = new TimeStampResponse(responseBytes);
response.validate(request);
PKIFailureInfo failure = response.getFailInfo();
if ((failure != null) && (failure.intValue() != 0)) {
throw new IllegalStateException("Failure Status " + failure.intValue());
}
TimeStampToken timeStampToken = response.getTimeStampToken();
if (timeStampToken == null) {
throw new IllegalStateException("TimeStampToken not found in response");
}
return response;
}