try {
Marshaller writer = getMarshaller();
CryptoProcessor dep;
dep = new CryptoProcessor(Cipher.ENCRYPT_MODE, eht.getEncryptedData().getEncryptionMethod().getAlgorithm(), data, key);
CVAdapter adapter = new CVAdapter(dep);
writer.setAdapter(CVAdapter.class,adapter);
com.sun.xml.ws.security.secext11.ObjectFactory obj = new com.sun.xml.ws.security.secext11.ObjectFactory();
JAXBElement eh = obj.createEncryptedHeader(eht);
writer.marshal(eh,os);
}catch (com.sun.xml.wss.XWSSecurityException ex) {