public List createAttachedKeyParts() {
LinkedList keyParts = new LinkedList();
List attachKeys = getAttachKeys();
if (attachKeys != null) {
for (int i = 0; i < attachKeys.size(); i++) {
EncryptionKey currentKey = (EncryptionKey)attachKeys.get(i);
try {
EncryptionUtils utils = currentKey.getEncryptionUtils();
keyParts.add(utils.createPublicKeyPart(new Key[] { currentKey }));
} catch (Exception e) {
// FIXME ignore for now.
System.out.println("caught exception adding key to message: " + e);
e.printStackTrace();