rpd.setSignAttachments(sep.isAttachments());
rpd.setSignAllHeaders(sep.isSignAllHeaders());
rpd.setSignBodyOptional(sep.isOptional());
rpd.setSignAttachmentsOptional(sep.isOptional());
while (it.hasNext()) {
Header header = (Header) it.next();
rpd.addSignedPart(header.getNamespace(), header.getName());
}
} else {
rpd.setEncryptBody(sep.isBody());
rpd.setEncryptAttachments(sep.isAttachments());
rpd.setEncryptBodyOptional(sep.isOptional());
rpd.setEncryptAttachmentsOptional(sep.isOptional());
while (it.hasNext()) {
Header header = (Header) it.next();
rpd.setEncryptedParts(header.getNamespace(), header.getName(),"Header");
}
}
}