}
/**
*/
public void test03CmsCAEncryptDecrypt() throws Exception {
CmsCAServiceRequest request = new CmsCAServiceRequest(doc, CmsCAServiceRequest.MODE_ENCRYPT);
CmsCAServiceResponse resp = null;
// Try the request again
boolean active = true;
try {
resp = (CmsCAServiceResponse) caAdminSession.extendedService(admin, getTestCAId(), request);
} catch (ExtendedCAServiceNotActiveException e) {
active = false;
}
// By default the CA service is not active
assertTrue(active);
assertNotNull(resp);
byte[] respdoc = resp.getCmsDocument();
assertNotNull(respdoc);
assertFalse(Arrays.equals(respdoc, doc));
request = new CmsCAServiceRequest(respdoc, CmsCAServiceRequest.MODE_DECRYPT);
// Try the request again
active = true;
try {
resp = (CmsCAServiceResponse) caAdminSession.extendedService(admin, getTestCAId(), request);