You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(44) |
Aug
(98) |
Sep
(97) |
Oct
(130) |
Nov
(118) |
Dec
(102) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(139) |
Feb
(74) |
Mar
(128) |
Apr
(104) |
May
(121) |
Jun
(32) |
Jul
(29) |
Aug
(9) |
Sep
(16) |
Oct
|
Nov
(11) |
Dec
(29) |
| 2004 |
Jan
(15) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
(9) |
Sep
(2) |
Oct
(9) |
Nov
(3) |
Dec
(2) |
| 2005 |
Jan
(1) |
Feb
(3) |
Mar
(3) |
Apr
|
May
(1) |
Jun
(5) |
Jul
|
Aug
(12) |
Sep
|
Oct
(2) |
Nov
|
Dec
|
| 2006 |
Jan
(3) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
(1) |
Oct
(5) |
Nov
(5) |
Dec
|
| 2007 |
Jan
(2) |
Feb
(5) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <bob...@us...> - 2003-08-14 04:16:23
|
Update of /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/handler
In directory sc8-pr-cvs1:/tmp/cvs-serv10958/src/hk/hku/cecid/phoenix/message/handler
Modified Files:
Tag: b0931
MessageServiceHandler.java
Log Message:
Fix bug on NullPointerException on registering when runs on JRE1.3
The bug is due to the case that URL.getPath() will be null for a
deserialized URL.
Index: MessageServiceHandler.java
===================================================================
RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/handler/MessageServiceHandler.java,v
retrieving revision 1.148.2.17
retrieving revision 1.148.2.18
diff -C2 -d -r1.148.2.17 -r1.148.2.18
*** MessageServiceHandler.java 21 May 2003 15:09:17 -0000 1.148.2.17
--- MessageServiceHandler.java 14 Aug 2003 03:50:27 -0000 1.148.2.18
***************
*** 1502,1505 ****
--- 1502,1520 ----
// Not client message listener and it's not using trusted repository
if (clientUrl.getProtocol().equals(MessageListener.PROTOCOL_FILE)) {
+ /*
+ fix for JSDK1.3, where null will be return if clientUrl.getPath()
+ on deserialized URL.
+ */
+ try {
+ clientUrl = new URL(clientUrl.getProtocol(),
+ clientUrl.getHost(), clientUrl.getPort(),
+ clientUrl.getFile());
+ } catch (MalformedURLException e) {
+ String err = ErrorMessages.getMessage(
+ ErrorMessages.ERR_HERMES_REGISTRATION_FAILED,
+ "Invalid client url : " + clientUrl);
+ logger.warn(err);
+ throw new MessageServiceHandlerException(err);
+ }
File clientUrlFile = new File(clientUrl.getPath());
boolean isServerRepository = false;
|
|
From: <kc...@us...> - 2003-08-04 02:36:28
|
Update of /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/pki
In directory sc8-pr-cvs1:/tmp/cvs-serv3024/src/hk/hku/cecid/phoenix/pki
Modified Files:
CompositeKeyStore.java
Log Message:
use bouncycastle to handle pkcs12 keystore instead of jsse (jsse is buggy)
Index: CompositeKeyStore.java
===================================================================
RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/pki/CompositeKeyStore.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** CompositeKeyStore.java 9 Apr 2003 07:48:59 -0000 1.4
--- CompositeKeyStore.java 4 Aug 2003 02:36:25 -0000 1.5
***************
*** 231,234 ****
--- 231,235 ----
}
else if (ksp.getType().toUpperCase().equals("PKCS12")) {
+ /*
if (isUsingJSSE()) {
try {
***************
*** 259,262 ****
--- 260,286 ----
catch (KeyStoreException e) {}
}
+ */
+
+ try {
+ Class clsProv = Class.forName(
+ "org.bouncycastle.jce.provider.BouncyCastleProvider");
+ Constructor c = clsProv.getConstructor(null);
+ Provider provider = (Provider) c.newInstance(null);
+ if (Security.getProvider(provider.getName()) == null) {
+ Security.addProvider(provider);
+ }
+ }
+ catch (ClassNotFoundException e) {}
+ catch (NoSuchMethodException e) {}
+ catch (InstantiationException e) {}
+ catch (IllegalAccessException e) {}
+ catch (InvocationTargetException e) {}
+
+ try {
+ ks = KeyStore.getInstance("PKCS12", "BC");
+ }
+ catch (NoSuchProviderException e) {}
+ catch (KeyStoreException e) {}
+
}
if (ks != null) {
|
|
From: <kc...@us...> - 2003-08-04 02:29:03
|
Update of /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/handler
In directory sc8-pr-cvs1:/tmp/cvs-serv2042/src/hk/hku/cecid/phoenix/message/handler
Modified Files:
ErrorMessages.java
Log Message:
correct a typo
Index: ErrorMessages.java
===================================================================
RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/handler/ErrorMessages.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** ErrorMessages.java 27 May 2003 06:48:57 -0000 1.18
--- ErrorMessages.java 4 Aug 2003 02:29:00 -0000 1.19
***************
*** 155,159 ****
load(ERR_HERMES_FILE_NOT_FOUND_ERROR, "File not found");
load(ERR_HERMES_HTTP_POST_FAILED, "HTTP POST request failed");
! load(ERR_HERMES_SERVLET_IO_ERROR, "Serviet IO error");
load(ERR_HERMES_AUTHENTICATION_FAILED, "Authentication failed");
load(ERR_HERMES_REGISTRATION_FAILED, "Registration failed");
--- 155,159 ----
load(ERR_HERMES_FILE_NOT_FOUND_ERROR, "File not found");
load(ERR_HERMES_HTTP_POST_FAILED, "HTTP POST request failed");
! load(ERR_HERMES_SERVLET_IO_ERROR, "Servlet IO error");
load(ERR_HERMES_AUTHENTICATION_FAILED, "Authentication failed");
load(ERR_HERMES_REGISTRATION_FAILED, "Registration failed");
|
|
From: <kc...@us...> - 2003-08-04 02:28:02
|
Update of /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/handler
In directory sc8-pr-cvs1:/tmp/cvs-serv1912/src/hk/hku/cecid/phoenix/message/handler
Modified Files:
Tag: b0931
ErrorMessages.java
Log Message:
correct a typo
Index: ErrorMessages.java
===================================================================
RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/handler/ErrorMessages.java,v
retrieving revision 1.14.2.2
retrieving revision 1.14.2.3
diff -C2 -d -r1.14.2.2 -r1.14.2.3
*** ErrorMessages.java 12 May 2003 02:55:46 -0000 1.14.2.2
--- ErrorMessages.java 4 Aug 2003 02:27:59 -0000 1.14.2.3
***************
*** 153,157 ****
load(ERR_HERMES_FILE_NOT_FOUND_ERROR, "File not found");
load(ERR_HERMES_HTTP_POST_FAILED, "HTTP POST request failed");
! load(ERR_HERMES_SERVLET_IO_ERROR, "Serviet IO error");
load(ERR_HERMES_AUTHENTICATION_FAILED, "Authentication failed");
load(ERR_HERMES_REGISTRATION_FAILED, "Registration failed");
--- 153,157 ----
load(ERR_HERMES_FILE_NOT_FOUND_ERROR, "File not found");
load(ERR_HERMES_HTTP_POST_FAILED, "HTTP POST request failed");
! load(ERR_HERMES_SERVLET_IO_ERROR, "Servlet IO error");
load(ERR_HERMES_AUTHENTICATION_FAILED, "Authentication failed");
load(ERR_HERMES_REGISTRATION_FAILED, "Registration failed");
|
|
From: <kc...@us...> - 2003-08-04 02:26:51
|
Update of /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/pki
In directory sc8-pr-cvs1:/tmp/cvs-serv1748/src/hk/hku/cecid/phoenix/pki
Modified Files:
Tag: b0931
CompositeKeyStore.java
Log Message:
use bouncycastle to handle pkcs12 keystore instead of jsse (jsse is buggy)
Index: CompositeKeyStore.java
===================================================================
RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/pki/CompositeKeyStore.java,v
retrieving revision 1.3.2.1
retrieving revision 1.3.2.2
diff -C2 -d -r1.3.2.1 -r1.3.2.2
*** CompositeKeyStore.java 9 Apr 2003 08:41:44 -0000 1.3.2.1
--- CompositeKeyStore.java 4 Aug 2003 02:26:48 -0000 1.3.2.2
***************
*** 231,234 ****
--- 231,235 ----
}
else if (ksp.getType().toUpperCase().equals("PKCS12")) {
+ /*
if (isUsingJSSE()) {
try {
***************
*** 259,262 ****
--- 260,286 ----
catch (KeyStoreException e) {}
}
+ */
+
+ try {
+ Class clsProv = Class.forName(
+ "org.bouncycastle.jce.provider.BouncyCastleProvider");
+ Constructor c = clsProv.getConstructor(null);
+ Provider provider = (Provider) c.newInstance(null);
+ if (Security.getProvider(provider.getName()) == null) {
+ Security.addProvider(provider);
+ }
+ }
+ catch (ClassNotFoundException e) {}
+ catch (NoSuchMethodException e) {}
+ catch (InstantiationException e) {}
+ catch (IllegalAccessException e) {}
+ catch (InvocationTargetException e) {}
+
+ try {
+ ks = KeyStore.getInstance("PKCS12", "BC");
+ }
+ catch (NoSuchProviderException e) {}
+ catch (KeyStoreException e) {}
+
}
if (ks != null) {
|
|
From: <cy...@us...> - 2003-07-31 06:58:44
|
Update of /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/monitor
In directory sc8-pr-cvs1:/tmp/cvs-serv12420
Modified Files:
MessageFrame.java
Log Message:
Adapt to the code change of PayloadContainer.
Index: MessageFrame.java
===================================================================
RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/monitor/MessageFrame.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** MessageFrame.java 9 Apr 2003 07:48:14 -0000 1.6
--- MessageFrame.java 31 Jul 2003 06:58:41 -0000 1.7
***************
*** 77,80 ****
--- 77,81 ----
import java.util.Date;
import java.util.Iterator;
+ import javax.activation.DataHandler;
import javax.swing.JFrame;
import javax.swing.JPanel;
***************
*** 87,91 ****
import javax.swing.text.StyleConstants;
import javax.xml.soap.SOAPException;
- import javax.xml.soap.AttachmentPart;
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;
--- 88,91 ----
***************
*** 254,258 ****
while (iter.hasNext()) {
PayloadContainer payload = (PayloadContainer) iter.next();
! AttachmentPart part = payload.getAttachmentPart();
if (part.getContentType().equals("text/xml")) {
StreamSource ss = (StreamSource) part.getContent();
--- 254,258 ----
while (iter.hasNext()) {
PayloadContainer payload = (PayloadContainer) iter.next();
! DataHandler part = payload.getDataHandler();
if (part.getContentType().equals("text/xml")) {
StreamSource ss = (StreamSource) part.getContent();
***************
*** 281,285 ****
}
}
! catch (SOAPException e) {}
}
--- 281,285 ----
}
}
! catch (IOException e) {}
}
|
|
From: <cy...@us...> - 2003-07-31 06:57:51
|
Update of /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/handler
In directory sc8-pr-cvs1:/tmp/cvs-serv11783
Modified Files:
MessageServer.java Request.java
Log Message:
Adapt to the code change of PayloadContainer.
Index: MessageServer.java
===================================================================
RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/handler/MessageServer.java,v
retrieving revision 1.140
retrieving revision 1.141
diff -C2 -d -r1.140 -r1.141
*** MessageServer.java 16 Jul 2003 08:56:11 -0000 1.140
--- MessageServer.java 31 Jul 2003 06:57:48 -0000 1.141
***************
*** 3703,3731 ****
contentType, encoding);
final DataHandler dh = new DataHandler(ads);
! final AttachmentPart attachment = soapMessage.
! createAttachmentPart(dh);
for (Iterator i=attachmentHeaders.getAllHeaders() ;
i.hasNext() ; ) {
final MimeHeader header = (MimeHeader) i.next();
final String name = header.getName();
! if (!name.equals(Constants.CONTENT_TYPE)) {
attachment.setMimeHeader(name, header.getValue());
}
}
! // soapMessage.addAttachmentPart(attachment);
! if (EbxmlMessage.needPatch) {
! String contentId = attachment.getContentId();
! if (!contentId.startsWith("<") ||
! !contentId.endsWith(">")) {
! contentId = "<" + contentId + ">";
! }
! payloads.add(new PayloadContainer(attachment,
! contentId, null));
! }
! else {
! payloads.add(new PayloadContainer(attachment,
! attachment.getContentId(), null));
! }
!
offset += (length + line.length);
--- 3703,3723 ----
contentType, encoding);
final DataHandler dh = new DataHandler(ads);
! String contentId = null;
! ahs = attachmentHeaders.getHeader(Constants.CONTENT_ID);
! if (ahs != null) {
! contentId = ahs[0];
! }
! PayloadContainer attachment = new PayloadContainer
! (dh, contentId, null);
for (Iterator i=attachmentHeaders.getAllHeaders() ;
i.hasNext() ; ) {
final MimeHeader header = (MimeHeader) i.next();
final String name = header.getName();
! if (!name.equals(Constants.CONTENT_TYPE) &&
! !name.equals(Constants.CONTENT_ID)) {
attachment.setMimeHeader(name, header.getValue());
}
}
! payloads.add(attachment);
offset += (length + line.length);
***************
*** 3759,3762 ****
--- 3751,3755 ----
}
catch (Exception e) {
+ e.printStackTrace();
String err = ErrorMessages.getMessage(
ErrorMessages.ERR_HERMES_UNKNOWN_ERROR, e);
Index: Request.java
===================================================================
RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/handler/Request.java,v
retrieving revision 1.73
retrieving revision 1.74
diff -C2 -d -r1.73 -r1.74
*** Request.java 9 Jun 2003 07:57:00 -0000 1.73
--- Request.java 31 Jul 2003 06:57:48 -0000 1.74
***************
*** 1314,1319 ****
*
* @param ebxmlMessage Message to be sent.
! * @param signed true if the message should be signed;
! * false otherwise.
* @throws RequestException
*/
--- 1314,1319 ----
*
* @param ebxmlMessage Message to be sent.
! * @param signed true if the acknowledgment response
! * should be signed; false otherwise.
* @throws RequestException
*/
***************
*** 1676,1692 ****
PayloadContainer pc = (PayloadContainer) i.next();
if (maxPayloadSize >= 0) {
! try {
! if (pc.getDataHandler().getDataSource() instanceof
! AttachmentDataSource) {
! AttachmentDataSource source = (AttachmentDataSource)
! pc.getDataHandler().getDataSource();
! if (source.getLength() > maxPayloadSize) {
! throw new RequestException(
! "Message containing larger payloads than "
! + "allowed.");
! }
}
}
- catch (SOAPException e) {}
}
count++;
--- 1676,1688 ----
PayloadContainer pc = (PayloadContainer) i.next();
if (maxPayloadSize >= 0) {
! if (pc.getDataHandler().getDataSource() instanceof
! AttachmentDataSource) {
! AttachmentDataSource source = (AttachmentDataSource)
! pc.getDataHandler().getDataSource();
! if (source.getLength() > maxPayloadSize) {
! throw new RequestException("Message containing " +
! "larger payloads than allowed.");
}
}
}
count++;
|
|
From: <cy...@us...> - 2003-07-31 06:56:02
|
Update of /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/packaging
In directory sc8-pr-cvs1:/tmp/cvs-serv11313
Modified Files:
EbxmlMessage.java PayloadContainer.java
Log Message:
Remove SAAJ's AttachmentPart from PayloadContainer. Now, PayloadContainer
encapsulates a DataHandler directly and it also supports MIME headers
other than Content-Type and Content-ID.
Index: EbxmlMessage.java
===================================================================
RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/packaging/EbxmlMessage.java,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** EbxmlMessage.java 31 Jul 2003 05:58:54 -0000 1.34
--- EbxmlMessage.java 31 Jul 2003 06:55:59 -0000 1.35
***************
*** 265,269 ****
if (cidMap.containsKey(contentId)) {
payloadContainers.add(new PayloadContainer
! (attachment, attachment.getContentId(),
(Reference) cidMap.get(contentId)));
}
--- 265,269 ----
if (cidMap.containsKey(contentId)) {
payloadContainers.add(new PayloadContainer
! (attachment.getDataHandler(), contentId,
(Reference) cidMap.get(contentId)));
}
***************
*** 1007,1013 ****
}
- final AttachmentPart attachment = soapMessage.
- createAttachmentPart(dataHandler);
-
Manifest manifest = headerContainer.getManifest();
if (manifest == null) {
--- 1007,1010 ----
***************
*** 1022,1029 ****
if (needPatch) {
payload = new PayloadContainer
! (attachment, "<" + contentId + ">", reference);
}
else {
! payload = new PayloadContainer(attachment, contentId, reference);
}
payloadContainers.add(payload);
--- 1019,1026 ----
if (needPatch) {
payload = new PayloadContainer
! (dataHandler, "<" + contentId + ">", reference);
}
else {
! payload = new PayloadContainer(dataHandler, contentId, reference);
}
payloadContainers.add(payload);
Index: PayloadContainer.java
===================================================================
RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/packaging/PayloadContainer.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** PayloadContainer.java 13 Jun 2003 06:49:25 -0000 1.10
--- PayloadContainer.java 31 Jul 2003 06:55:59 -0000 1.11
***************
*** 69,74 ****
package hk.hku.cecid.phoenix.message.packaging;
! import javax.xml.soap.AttachmentPart;
! import javax.xml.soap.SOAPException;
import javax.activation.DataHandler;
import javax.activation.DataSource;
--- 69,75 ----
package hk.hku.cecid.phoenix.message.packaging;
! import hk.hku.cecid.phoenix.message.handler.Constants;
! import java.util.HashMap;
! import java.util.Map;
import javax.activation.DataHandler;
import javax.activation.DataSource;
***************
*** 109,116 ****
/**
! * SOAP <code>AttachmentPart</code> representing this
* <code>PayloadContainer</code>.
*/
! private final AttachmentPart attachmentPart;
/**
--- 110,117 ----
/**
! * <code>DataHandler</code> representing this
* <code>PayloadContainer</code>.
*/
! private final DataHandler dataHandler;
/**
***************
*** 120,156 ****
private final Reference reference;
! /**
! * Content-Id of this <code>PayloadContainer</code>.
*/
! private String contentId;
/**
* Create a <code>PayloadContainer</code> from the specified
! * <code>AttachmentPart</code>.
! */
! public PayloadContainer(AttachmentPart attachmentPart, String contentId,
! Reference reference) {
! this.attachmentPart = attachmentPart;
! this.attachmentPart.setContentId(contentId);
this.reference = reference;
! this.contentId = contentId;
! if (this.contentId.startsWith("<") && EbxmlMessage.needPatch) {
! this.contentId = this.contentId.substring(1);
! if (this.contentId.endsWith(">")) {
! this.contentId = this.contentId.substring
! (0, this.contentId.length() - 1);
}
}
! }
!
! /**
! * Return the <code>AttachmentPart</code> that this
! * <code>PayloadContainer</code> encapsulates.
! *
! * @deprecated use other methods such as getDataHandler(), etc. to
! * get information of this <code>PayloadContainer</code>.
! */
! public AttachmentPart getAttachmentPart() {
! return attachmentPart;
}
--- 121,147 ----
private final Reference reference;
! /*
! * MIME headers of this <code>PayloadContainer</code>.
*/
! private final HashMap mimeHeaders;
/**
* Create a <code>PayloadContainer</code> from the specified
! * <code>DataHandler</code>.
! */
! public PayloadContainer(DataHandler dataHandler, String contentId,
! Reference reference) {
! this.dataHandler = dataHandler;
this.reference = reference;
! this.mimeHeaders = new HashMap();
! String id = contentId;
! if (id != null && id.startsWith("<") && EbxmlMessage.needPatch) {
! id = id.substring(1);
! if (id.endsWith(">")) {
! id = id.substring(0, id.length() - 1);
}
}
! mimeHeaders.put(Constants.CONTENT_TYPE, dataHandler.getContentType());
! mimeHeaders.put(Constants.CONTENT_ID, id);
}
***************
*** 159,163 ****
*/
public String getContentId() {
! return contentId;
}
--- 150,154 ----
*/
public String getContentId() {
! return (String) mimeHeaders.get(Constants.CONTENT_ID);
}
***************
*** 166,170 ****
*/
public String getHref() {
! return HREF_PREFIX + contentId;
}
--- 157,161 ----
*/
public String getHref() {
! return HREF_PREFIX + getContentId();
}
***************
*** 173,186 ****
*/
public String getContentType() {
! return attachmentPart.getContentType();
}
/**
* Get <code>javax.activation.DataHandler</code> of this attachment.
- *
- * @exception SOAPException
*/
! public DataHandler getDataHandler() throws SOAPException {
! return attachmentPart.getDataHandler();
}
--- 164,191 ----
*/
public String getContentType() {
! return dataHandler.getContentType();
! }
!
! /*
! * Get all MIME headers of this attachment.
! */
! public Map getMimeHeaders() {
! return mimeHeaders;
! }
!
! /*
! * Set a MIME header of this attachment.
! */
! public void setMimeHeader(String name, String value) {
! if (name != null) {
! mimeHeaders.put(name, value);
! }
}
/**
* Get <code>javax.activation.DataHandler</code> of this attachment.
*/
! public DataHandler getDataHandler() {
! return dataHandler;
}
***************
*** 202,216 ****
*/
public long getContentLength() {
! try {
! DataSource source = attachmentPart.getDataHandler().getDataSource();
! if (source instanceof AttachmentDataSource) {
! AttachmentDataSource ads = (AttachmentDataSource) source;
! return ads.getLength();
! }
! else {
! return -1;
! }
}
! catch (SOAPException e) {
return -1;
}
--- 207,216 ----
*/
public long getContentLength() {
! DataSource source = dataHandler.getDataSource();
! if (source instanceof AttachmentDataSource) {
! AttachmentDataSource ads = (AttachmentDataSource) source;
! return ads.getLength();
}
! else {
return -1;
}
|
|
From: <bob...@us...> - 2003-07-31 05:58:57
|
Update of /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/packaging
In directory sc8-pr-cvs1:/tmp/cvs-serv2327/src/hk/hku/cecid/phoenix/message/packaging
Modified Files:
EbxmlMessage.java
Log Message:
Force the content type to have charset = "UTF-8" in soap part.
Index: EbxmlMessage.java
===================================================================
RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/packaging/EbxmlMessage.java,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** EbxmlMessage.java 29 Jul 2003 09:23:54 -0000 1.33
--- EbxmlMessage.java 31 Jul 2003 05:58:54 -0000 1.34
***************
*** 1220,1225 ****
buffer = Constants.MIME_BOUNDARY_PREFIX + mimeBoundary + Constants.CRLF;
buffer = buffer + Constants.CONTENT_TYPE + ": "
! + Constants.TEXT_XML_TYPE + Constants.CRLF;
! buffer = buffer + Constants.CONTENT_ID + ": "
+ soapMessage.getSOAPPart().getContentId() + Constants.CRLF;
buffer = buffer + Constants.CONTENT_TRANSFER_ENCODING + ": "
--- 1220,1226 ----
buffer = Constants.MIME_BOUNDARY_PREFIX + mimeBoundary + Constants.CRLF;
buffer = buffer + Constants.CONTENT_TYPE + ": "
! + Constants.TEXT_XML_TYPE + "; " + Constants.CHARACTER_SET + "=\""
! + Constants.CHARACTER_ENCODING + "\"" + Constants.CRLF;
! buffer = buffer + Constants.CONTENT_ID + ": "
+ soapMessage.getSOAPPart().getContentId() + Constants.CRLF;
buffer = buffer + Constants.CONTENT_TRANSFER_ENCODING + ": "
|
|
From: <bob...@us...> - 2003-07-31 05:58:57
|
Update of /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/handler
In directory sc8-pr-cvs1:/tmp/cvs-serv2327/src/hk/hku/cecid/phoenix/message/handler
Modified Files:
Constants.java
Log Message:
Force the content type to have charset = "UTF-8" in soap part.
Index: Constants.java
===================================================================
RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/handler/Constants.java,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** Constants.java 13 Jun 2003 06:33:39 -0000 1.29
--- Constants.java 31 Jul 2003 05:58:54 -0000 1.30
***************
*** 640,647 ****
public static final String CHARACTER_SET = "charset";
/**
* Default XML character encoding.
*/
! public static final String CHARACTER_ENCODING = "utf-8";
/**
--- 640,648 ----
public static final String CHARACTER_SET = "charset";
+
/**
* Default XML character encoding.
*/
! public static final String CHARACTER_ENCODING = "UTF-8";
/**
|
|
From: <bob...@us...> - 2003-07-29 09:23:57
|
Update of /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/packaging
In directory sc8-pr-cvs1:/tmp/cvs-serv25832/src/hk/hku/cecid/phoenix/message/packaging
Modified Files:
EbxmlMessage.java
Log Message:
Fix the bug on EbxmlMessage constructor with argument SOAPMessage
so that the writeTo() will not make MimeBoundary on MimeBoundary.
Index: EbxmlMessage.java
===================================================================
RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/packaging/EbxmlMessage.java,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** EbxmlMessage.java 18 Jul 2003 14:53:26 -0000 1.32
--- EbxmlMessage.java 29 Jul 2003 09:23:54 -0000 1.33
***************
*** 195,198 ****
--- 195,233 ----
public EbxmlMessage(SOAPMessage soapMessage)
throws SOAPException {
+ SOAPMessage partOnlyMessage
+ = MessageFactory.newInstance().createMessage();
+ /*
+ copy the soap message mime headers to the part only message
+ */
+ Iterator soapMessageHeadersIterator
+ = soapMessage.getMimeHeaders().getAllHeaders();
+ while (soapMessageHeadersIterator.hasNext()) {
+ MimeHeader header = (MimeHeader) soapMessageHeadersIterator.next();
+ partOnlyMessage.getMimeHeaders().setHeader(header.getName(),
+ header.getValue());
+ }
+
+ SOAPPart inputSoapPart = soapMessage.getSOAPPart();
+ /*
+ copy the soap part's mime header to the part only message
+ */
+ Iterator soapPartHeadersIterator = inputSoapPart.getAllMimeHeaders();
+ while (soapPartHeadersIterator.hasNext()) {
+ MimeHeader header = (MimeHeader) soapPartHeadersIterator.next();
+ partOnlyMessage.getSOAPPart().setMimeHeader(header.getName(),
+ header.getValue());
+ }
+
+ /*
+ copy the soap part content to the part only message.
+ */
+ partOnlyMessage.getSOAPPart().setContent(inputSoapPart.getContent());
+
+ this.soapMessage = partOnlyMessage;
+ this.soapEnvelope = this.soapMessage.getSOAPPart().getEnvelope();
+ headerContainer = new HeaderContainer(partOnlyMessage.getSOAPPart());
+ payloadContainers = new ArrayList();
+
+ /*
this.soapMessage = soapMessage;
this.soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
***************
*** 201,205 ****
headerContainer = new HeaderContainer(soapMessage.getSOAPPart());
payloadContainers = new ArrayList();
!
Manifest manifest = headerContainer.getManifest();
if (manifest != null) {
--- 236,240 ----
headerContainer = new HeaderContainer(soapMessage.getSOAPPart());
payloadContainers = new ArrayList();
! */
Manifest manifest = headerContainer.getManifest();
if (manifest != null) {
***************
*** 235,239 ****
--- 270,290 ----
}
}
+ String[] soapAction =
+ this.soapMessage.getMimeHeaders().getHeader(SOAP_ACTION);
+ if (headerContainer.getMessageHeader() == null || soapAction == null ||
+ !soapAction[0].equals(SOAP_ACTION_VALUE)) {
+ this.soapMessage.getMimeHeaders().setHeader(
+ SOAP_ACTION, SOAP_ACTION_VALUE);
+ }
+ String soapPartContentId
+ = this.soapMessage.getSOAPPart().getContentId();
+ if (soapPartContentId == null || soapPartContentId.equals("")) {
+ soapPartContentId = (needPatch ? "<" + SOAP_PART_CONTENT_ID + ">" :
+ SOAP_PART_CONTENT_ID);
+ this.soapMessage.getSOAPPart().setContentId(soapPartContentId);
+ }
+
+ /*
String[] soapAction =
soapMessage.getMimeHeaders().getHeader(SOAP_ACTION);
***************
*** 250,253 ****
--- 301,305 ----
soapMessage.getSOAPPart().setContentId(soapPartContentId);
}
+ */
saveChanges();
|
|
From: <cy...@us...> - 2003-07-26 15:18:15
|
Update of /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/handler
In directory sc8-pr-cvs1:/tmp/cvs-serv15893
Modified Files:
Tag: b0931
MessageServer.java
Log Message:
Bug fix for digital signature.
Index: MessageServer.java
===================================================================
RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/handler/MessageServer.java,v
retrieving revision 1.119.2.11
retrieving revision 1.119.2.12
diff -C2 -d -r1.119.2.11 -r1.119.2.12
*** MessageServer.java 25 Jul 2003 16:13:50 -0000 1.119.2.11
--- MessageServer.java 26 Jul 2003 15:18:12 -0000 1.119.2.12
***************
*** 3433,3436 ****
--- 3433,3438 ----
final PushbackInputStream fileStream = new PushbackInputStream(fis);
String boundary = null;
+ int soapMessageFileOffset = 0;
+ int soapMessageLength = 0;
ByteArrayOutputStream out = new ByteArrayOutputStream();
byte[] line = readLine(fileStream);
***************
*** 3445,3448 ****
--- 3447,3451 ----
}
byte[] soapMessageBytes = out.toByteArray();
+ soapMessageLength = soapMessageBytes.length;
int lastIndex = soapMessageBytes.length - 1;
***************
*** 3478,3481 ****
--- 3481,3485 ----
with offset being the beginning position
*/
+ soapMessageFileOffset = (int) offset;
out = new ByteArrayOutputStream();
line = readLine(fileStream);
***************
*** 3499,3502 ****
--- 3503,3507 ----
soapMessageBytes = out.toByteArray();
+ soapMessageLength = soapMessageBytes.length;
lastIndex = soapMessageBytes.length - 1;
for ( ; lastIndex >= 0 ; lastIndex--) {
***************
*** 3669,3672 ****
--- 3674,3679 ----
if (withAttachments) {
EbxmlMessage message = new EbxmlMessage(soapMessage);
+ message.setSOAPMessageFileOffset
+ (soapMessageFileOffset, soapMessageLength);
message.setFileName(file.getCanonicalPath());
logger.debug("<= MessageServer.getMessageFromFile");
|
Update of /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/packaging
In directory sc8-pr-cvs1:/tmp/cvs-serv15660
Modified Files:
Tag: b0931
EbxmlMessage.java PKISignatureImpl.java Signature.java
Log Message:
Bug fix for digital signature.
Index: EbxmlMessage.java
===================================================================
RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/packaging/EbxmlMessage.java,v
retrieving revision 1.24.2.6
retrieving revision 1.24.2.7
diff -C2 -d -r1.24.2.6 -r1.24.2.7
*** EbxmlMessage.java 17 Jul 2003 09:41:59 -0000 1.24.2.6
--- EbxmlMessage.java 26 Jul 2003 15:17:33 -0000 1.24.2.7
***************
*** 160,163 ****
--- 160,167 ----
private final ArrayList payloadContainers;
+ private int soapMessageFileOffset;
+
+ private int soapMessageLength;
+
/**
* Optional file name in which the message is persisted.
***************
*** 254,257 ****
--- 258,263 ----
saveChanges();
+ soapMessageFileOffset = 0;
+ soapMessageLength = 0;
filename = null;
messageOrder = null;
***************
*** 907,912 ****
CertResolver certResolver)
throws SOAPException, SignatureException {
! Signature signature = Signature.newInstance(this);
! return signature.verify(password, keyStoreLocation, certResolver);
}
--- 913,933 ----
CertResolver certResolver)
throws SOAPException, SignatureException {
! boolean result = true;
! Iterator i = headerContainer.getSignatures();
! if (i.hasNext()) {
! while (i.hasNext()) {
! Signature sig = (Signature) i.next();
! Signature signature = Signature.newInstance
! (this, sig.soapEnvelope, sig.getSOAPElement());
! result = result && signature.verify
! (password, keyStoreLocation, certResolver);
! }
! }
! else {
! throw new SignatureException("No <" + Signature.
! NAMESPACE_PREFIX_DS + ":" + Signature.ELEMENT_SIGNATURE +
! "> element is found to be verified!");
! }
! return result;
}
***************
*** 1192,1195 ****
--- 1213,1228 ----
return null;
+ }
+
+ public void setSOAPMessageFileOffset(int offset, int length) {
+ soapMessageFileOffset = offset;
+ soapMessageLength = length;
+ }
+
+ public int[] getSOAPMessageFileOffset() {
+ int[] offset = new int[2];
+ offset[0] = soapMessageFileOffset;
+ offset[1] = soapMessageLength;
+ return offset;
}
Index: PKISignatureImpl.java
===================================================================
RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/packaging/PKISignatureImpl.java,v
retrieving revision 1.3.2.4
retrieving revision 1.3.2.5
diff -C2 -d -r1.3.2.4 -r1.3.2.5
*** PKISignatureImpl.java 5 May 2003 08:39:21 -0000 1.3.2.4
--- PKISignatureImpl.java 26 Jul 2003 15:17:33 -0000 1.3.2.5
***************
*** 76,81 ****
import hk.hku.cecid.phoenix.pki.SignException;
import hk.hku.cecid.phoenix.pki.VerifyException;
! import java.io.ByteArrayInputStream;
! import java.io.ByteArrayOutputStream;
import java.security.PrivateKey;
import java.security.PublicKey;
--- 76,80 ----
import hk.hku.cecid.phoenix.pki.SignException;
import hk.hku.cecid.phoenix.pki.VerifyException;
! import java.io.*;
import java.security.PrivateKey;
import java.security.PublicKey;
***************
*** 114,121 ****
}
! PKISignatureImpl(SOAPEnvelope soapEnvelope, SOAPElement soapElement)
! throws SOAPException {
super(soapEnvelope, soapElement);
! this.ebxmlMessage = null;
}
--- 113,120 ----
}
! PKISignatureImpl(EbxmlMessage ebxmlMessage, SOAPEnvelope soapEnvelope,
! SOAPElement soapElement) throws SOAPException {
super(soapEnvelope, soapElement);
! this.ebxmlMessage = ebxmlMessage;
}
***************
*** 236,246 ****
throws SignatureException {
try {
- final SOAPPart soapPart = ebxmlMessage.getSOAPMessage().
- getSOAPPart();
- DocumentResult docResult = new DocumentResult();
- TransformerFactory.newInstance().newTransformer().
- transform(soapPart.getContent(), docResult);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
! (new XMLWriter(baos)).write(docResult.getDocument());
DocumentBuilderFactory factory = DocumentBuilderFactory.
newInstance();
--- 235,270 ----
throws SignatureException {
try {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
! String fileName = ebxmlMessage.getFileName();
! if (fileName != null) {
! FileInputStream fis = new FileInputStream(fileName);
! int skipped = ebxmlMessage.getSOAPMessageFileOffset()[0];
! byte[] buffer = new byte[skipped];
! if (skipped > 0) {
! fis.read(buffer, 0, skipped);
! }
! int length = 0;
! for (int c = fis.read() ; c != -1 &&
! length < ebxmlMessage.getSOAPMessageFileOffset()[1] ;
! c = fis.read()) {
! baos.write(c);
! length++;
! }
! if (length != ebxmlMessage.getSOAPMessageFileOffset()[1]) {
! throw new VerifyException(ebxmlMessage.
! getSOAPMessageFileOffset()[1] + " bytes should be " +
! "read from <" + fileName + "> but only " + length +
! " bytes are successfully read");
! }
! fis.close();
! }
! else {
! final SOAPPart soapPart = ebxmlMessage.getSOAPMessage().
! getSOAPPart();
! DocumentResult docResult = new DocumentResult();
! TransformerFactory.newInstance().newTransformer().
! transform(soapPart.getContent(), docResult);
! (new XMLWriter(baos)).write(docResult.getDocument());
! }
DocumentBuilderFactory factory = DocumentBuilderFactory.
newInstance();
***************
*** 249,257 ****
final Document soapPartDocument = factory.newDocumentBuilder().
parse(new ByteArrayInputStream(baos.toByteArray()));
- final String soapHeaderName = soapPart.getEnvelope().getHeader().
- getElementName().getLocalName();
- final Element soapHeader = (Element) soapPartDocument.
- getElementsByTagNameNS(NAMESPACE_URI_SOAP_ENVELOPE,
- soapHeaderName).item(0);
ApacheXMLDSigner signature = new ApacheXMLDSigner();
--- 273,276 ----
***************
*** 326,330 ****
if (!name.equals(nsPrefix + NAMESPACE_PREFIX_DS) &&
! !name.equals(XML_NS_DECL_PREFIX)) {
addedChild.addAttribute(soapEnvelope.
createName(name), value);
--- 345,349 ----
if (!name.equals(nsPrefix + NAMESPACE_PREFIX_DS) &&
! !name.startsWith(XML_NS_DECL_PREFIX)) {
addedChild.addAttribute(soapEnvelope.
createName(name), value);
Index: Signature.java
===================================================================
RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/packaging/Signature.java,v
retrieving revision 1.4.4.3
retrieving revision 1.4.4.4
diff -C2 -d -r1.4.4.3 -r1.4.4.4
*** Signature.java 5 May 2003 08:39:21 -0000 1.4.4.3
--- Signature.java 26 Jul 2003 15:17:33 -0000 1.4.4.4
***************
*** 349,353 ****
static Signature newInstance(SOAPEnvelope soapEnvelope,
SOAPElement soapElement) throws SOAPException {
! return new PKISignatureImpl(soapEnvelope, soapElement);
}
--- 349,359 ----
static Signature newInstance(SOAPEnvelope soapEnvelope,
SOAPElement soapElement) throws SOAPException {
! return new PKISignatureImpl(null, soapEnvelope, soapElement);
! }
!
! static Signature newInstance(EbxmlMessage ebxmlMessage,
! SOAPEnvelope soapEnvelope, SOAPElement soapElement)
! throws SOAPException {
! return new PKISignatureImpl(ebxmlMessage, soapEnvelope, soapElement);
}
|
|
From: <cy...@us...> - 2003-07-26 11:59:45
|
Update of /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/handler
In directory sc8-pr-cvs1:/tmp/cvs-serv14551
Modified Files:
Tag: b0931
MessageServer.java
Log Message:
Bug fix: getSentSequenceMap() should consider only those messages with
message orders, i.e. sequence number >= 0 or <=-1000.
Index: MessageServer.java
===================================================================
RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/handler/MessageServer.java,v
retrieving revision 1.119.2.10
retrieving revision 1.119.2.11
diff -C2 -d -r1.119.2.10 -r1.119.2.11
*** MessageServer.java 22 May 2003 03:25:53 -0000 1.119.2.10
--- MessageServer.java 25 Jul 2003 16:13:50 -0000 1.119.2.11
***************
*** 627,633 ****
}
catch (Exception e) {
! String err = ErrorMessages.getMessage(
! ErrorMessages.ERR_HERMES_UNKNOWN_ERROR, e);
! logger.error(err);
exception = new MessageServerException(err);
}
--- 627,633 ----
}
catch (Exception e) {
! String err = ErrorMessages.getMessage
! (ErrorMessages.ERR_HERMES_UNKNOWN_ERROR, e);
! logger.error(err);
exception = new MessageServerException(err);
}
***************
*** 687,693 ****
}
catch (Exception e) {
! String err = ErrorMessages.getMessage(
! ErrorMessages.ERR_HERMES_UNKNOWN_ERROR, e);
! logger.error(err);
exception = new MessageServerException(err);
}
--- 687,693 ----
}
catch (Exception e) {
! String err = ErrorMessages.getMessage
! (ErrorMessages.ERR_HERMES_UNKNOWN_ERROR, e);
! logger.error(err);
exception = new MessageServerException(err);
}
***************
*** 746,752 ****
}
catch (Exception e) {
! String err = ErrorMessages.getMessage(
! ErrorMessages.ERR_HERMES_UNKNOWN_ERROR, e);
! logger.error(err);
exception = new MessageServerException(err);
}
--- 746,752 ----
}
catch (Exception e) {
! String err = ErrorMessages.getMessage
! (ErrorMessages.ERR_HERMES_UNKNOWN_ERROR, e);
! logger.error(err);
exception = new MessageServerException(err);
}
***************
*** 2841,2847 ****
"MAX(" + DbTableManager.ATTRIBUTE_SEQUENCE_NUMBER + ")"
},
! new String [] { DbTableManager.ATTRIBUTE_STATE },
! new int [] { DbTableManager.GREATER_EQUAL },
! new String [] { String.valueOf(SENT_FROM_RANGE) },
null,
new String [] { DbTableManager.ATTRIBUTE_CONVERSATION_ID }
--- 2841,2853 ----
"MAX(" + DbTableManager.ATTRIBUTE_SEQUENCE_NUMBER + ")"
},
! new String [] { DbTableManager.ATTRIBUTE_STATE,
! DbTableManager.ATTRIBUTE_SEQUENCE_NUMBER,
! DbTableManager.ATTRIBUTE_SEQUENCE_NUMBER },
! new int [] { DbTableManager.GREATER_EQUAL,
! DbTableManager.LESS_EQUAL,
! DbTableManager.GREATER_EQUAL },
! new String [] { String.valueOf(SENT_FROM_RANGE),
! String.valueOf(FIRST_MESSAGE_ORDER_DELIVERED),
! String.valueOf(FIRST_MESSAGE_ORDER_UNDELIVERED) },
null,
new String [] { DbTableManager.ATTRIBUTE_CONVERSATION_ID }
***************
*** 2952,2955 ****
--- 2958,2962 ----
deliveryMap.put(conversationId, deliveryRecord);
}
+ logger.debug("conversation id: " + conversationId);
deliveryRecord.addUndelivered(seqNo);
}
|
|
From: <cy...@us...> - 2003-07-26 10:43:24
|
Update of /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/handler
In directory sc8-pr-cvs1:/tmp/cvs-serv10698
Modified Files:
Tag: b0931
Request.java
Log Message:
Incorrect Javadoc description about sendReliably().
Index: Request.java
===================================================================
RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/handler/Request.java,v
retrieving revision 1.63.2.6
retrieving revision 1.63.2.7
diff -C2 -d -r1.63.2.6 -r1.63.2.7
*** Request.java 20 May 2003 08:57:10 -0000 1.63.2.6
--- Request.java 25 Jul 2003 16:00:35 -0000 1.63.2.7
***************
*** 1264,1269 ****
*
* @param ebxmlMessage Message to be sent.
! * @param signed true if the message should be signed;
! * false otherwise.
* @throws RequestException
*/
--- 1264,1269 ----
*
* @param ebxmlMessage Message to be sent.
! * @param signed true if the acknowledgment response
! * should be signed; false otherwise.
* @throws RequestException
*/
|
|
From: <cy...@us...> - 2003-07-18 14:53:33
|
Update of /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/packaging
In directory sc8-pr-cvs1:/tmp/cvs-serv25300
Modified Files:
EbxmlMessage.java
Log Message:
Add getMimeHeaders() method with no argument.
Index: EbxmlMessage.java
===================================================================
RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/packaging/EbxmlMessage.java,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** EbxmlMessage.java 16 Jul 2003 08:54:10 -0000 1.31
--- EbxmlMessage.java 18 Jul 2003 14:53:26 -0000 1.32
***************
*** 1063,1067 ****
/**
* Gets the MIME headers of this ebXML message
! *
* @return the MIME headers of this ebXML message
*/
--- 1063,1081 ----
/**
* Gets the MIME headers of this ebXML message
! *
! * @return the MIME headers of this ebXML message
! */
! public Map getMimeHeaders() throws IOException, SOAPException {
! return getMimeHeaders(Constants.DEFAULT_CONTENT_TRANSFER_ENCODING,
! Constants.DEFAULT_CONTENT_TRANSFER_ENCODING);
! }
!
! /**
! * Gets the MIME headers of this ebXML message
! *
! * @param soapEncoding content transfer encoding to be applied to SOAP
! * part when computing length
! * @param payloadEncoding content transfer encoding to be applied to
! * payload when computing length
* @return the MIME headers of this ebXML message
*/
***************
*** 1103,1107 ****
*
* @param out <code>OutputStream</code> to write the message to.
! * @param encoding content transfer encoding to be applied to payload
* @param getLengthOnly get length only and do no actual serialization
* @return the content length of the serialization
--- 1117,1122 ----
*
* @param out <code>OutputStream</code> to write the message to.
! * @param soapEncoding content transfer encoding to be applied to SOAPPart
! * @param payloadEncoding content transfer encoding to be applied to payload
* @param getLengthOnly get length only and do no actual serialization
* @return the content length of the serialization
|
|
From: <kc...@us...> - 2003-07-17 09:53:59
|
Update of /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/handler
In directory sc8-pr-cvs1:/tmp/cvs-serv1203/src/hk/hku/cecid/phoenix/message/handler
Modified Files:
Tag: b0931
Utility.java
Log Message:
update version number
Index: Utility.java
===================================================================
RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/handler/Utility.java,v
retrieving revision 1.18.2.12
retrieving revision 1.18.2.13
diff -C2 -d -r1.18.2.12 -r1.18.2.13
*** Utility.java 8 Jul 2003 07:15:40 -0000 1.18.2.12
--- Utility.java 17 Jul 2003 09:46:30 -0000 1.18.2.13
***************
*** 116,120 ****
* implementation.
*/
! private static final String RELEASE = "0.9.3.1-sp2";
/**
--- 116,120 ----
* implementation.
*/
! private static final String RELEASE = "0.9.3.1-sp3";
/**
|
|
From: <kc...@us...> - 2003-07-17 09:42:02
|
Update of /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/transport
In directory sc8-pr-cvs1:/tmp/cvs-serv547/src/hk/hku/cecid/phoenix/message/transport
Modified Files:
Tag: b0931
Mail.java
Log Message:
added flag to indicate a message is encrypted or not
Index: Mail.java
===================================================================
RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/transport/Mail.java,v
retrieving revision 1.35.2.5
retrieving revision 1.35.2.6
diff -C2 -d -r1.35.2.5 -r1.35.2.6
*** Mail.java 17 Jul 2003 08:08:13 -0000 1.35.2.5
--- Mail.java 17 Jul 2003 09:41:59 -0000 1.35.2.6
***************
*** 715,718 ****
--- 715,719 ----
final MimeHeaders mimeHeaders = new MimeHeaders();
final SOAPMessage soapMessage;
+ boolean encrypted = false;
try {
String type = messages[i].getContentType();
***************
*** 732,736 ****
smimeKeyStoreAlias == null) {
logger.debug("Cannot decrypt, invalid keystore");
! throw new SMIMEException("Cannot decrypt, invalid keystore");
}
else {
--- 733,738 ----
smimeKeyStoreAlias == null) {
logger.debug("Cannot decrypt, invalid keystore");
! throw new SMIMEException(
! "Cannot decrypt, invalid keystore");
}
else {
***************
*** 744,747 ****
--- 746,750 ----
soapMessage = messageFactory.createMessage
(mimeHeaders, msg.getInputStream());
+ encrypted = true;
}
}
***************
*** 781,785 ****
}
! ebxmlMessages.add(new EbxmlMessage(soapMessage));
messages[i].setFlag(Flags.Flag.DELETED, true);
}
--- 784,792 ----
}
! EbxmlMessage ebxmlMessage = new EbxmlMessage(soapMessage);
! if (encrypted) {
! ebxmlMessage.setSMIMEEncrypted();
! }
! ebxmlMessages.add(ebxmlMessage);
messages[i].setFlag(Flags.Flag.DELETED, true);
}
|
|
From: <kc...@us...> - 2003-07-17 09:42:02
|
Update of /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/packaging
In directory sc8-pr-cvs1:/tmp/cvs-serv547/src/hk/hku/cecid/phoenix/message/packaging
Modified Files:
Tag: b0931
EbxmlMessage.java
Log Message:
added flag to indicate a message is encrypted or not
Index: EbxmlMessage.java
===================================================================
RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/packaging/EbxmlMessage.java,v
retrieving revision 1.24.2.5
retrieving revision 1.24.2.6
diff -C2 -d -r1.24.2.5 -r1.24.2.6
*** EbxmlMessage.java 17 Jul 2003 08:08:13 -0000 1.24.2.5
--- EbxmlMessage.java 17 Jul 2003 09:41:59 -0000 1.24.2.6
***************
*** 953,956 ****
--- 953,966 ----
/**
+ * Indicates this message is smime encrypted. This is nothing to do with
+ * further encryption. This is only used by mail.java. When we receive an
+ * encyrpted message, we decrypt it. And then we set this flag to notify
+ * the user that this message has been encrypted.
+ */
+ public void setSMIMEEncrypted() {
+ encryption = true;
+ }
+
+ /**
* Add an ebXML message payload container.
*
|
|
From: <kc...@us...> - 2003-07-17 08:52:19
|
Update of /cvsroot/ebxmlms/ebxmlms/doc
In directory sc8-pr-cvs1:/tmp/cvs-serv25918/doc
Modified Files:
Tag: b0931
change.txt
Log Message:
update change log
Index: change.txt
===================================================================
RCS file: /cvsroot/ebxmlms/ebxmlms/doc/change.txt,v
retrieving revision 1.85.2.5
retrieving revision 1.85.2.6
diff -C2 -d -r1.85.2.5 -r1.85.2.6
*** change.txt 2 Jun 2003 02:27:57 -0000 1.85.2.5
--- change.txt 17 Jul 2003 08:52:10 -0000 1.85.2.6
***************
*** 629,630 ****
--- 629,632 ----
bug fixed: cert path verifier result not checked
+
+ Modified s/mime encryption and decryption mechanism in order to suit ebmail usage
|
|
From: <kc...@us...> - 2003-07-17 08:08:19
|
Update of /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/pki
In directory sc8-pr-cvs1:/tmp/cvs-serv19796/src/hk/hku/cecid/phoenix/pki
Modified Files:
Tag: b0931
SMIMEEncrypter.java
Log Message:
modified s/mime encryption/decryption calling mechanism to suit ebmail usage
Index: SMIMEEncrypter.java
===================================================================
RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/pki/SMIMEEncrypter.java,v
retrieving revision 1.2.2.1
retrieving revision 1.2.2.2
diff -C2 -d -r1.2.2.1 -r1.2.2.2
*** SMIMEEncrypter.java 9 Apr 2003 08:41:44 -0000 1.2.2.1
--- SMIMEEncrypter.java 17 Jul 2003 08:08:13 -0000 1.2.2.2
***************
*** 100,103 ****
--- 100,107 ----
}
+ protected SMIMEEncrypter() {
+ initiate();
+ }
+
/**
The application should use this method to get a instance of SMIMEEncrypter
***************
*** 117,120 ****
--- 121,135 ----
}
+ public static SMIMEEncrypter getInstance() {
+ if (instance == null) {
+ synchronized(SMIMEEncrypter.class) {
+ if (instance == null) {
+ instance = new SMIMEEncrypter();
+ }
+ }
+ }
+ return instance;
+ }
+
/**
Create a encrypted MimeBodyPart.
***************
*** 131,136 ****
CertificateEncodingException {
try {
SMIMEEncryptedGenerator generator = new SMIMEEncryptedGenerator();
! generator.addKeyTransRecipient(getCertificate(alias));
generator.setContent(mimeMessage, session);
generator.setContentEncryptionAlgorithm(SMIMEEncryptedGenerator.
--- 146,165 ----
CertificateEncodingException {
try {
+ return createEncryptedMimeMessage(
+ getCertificate(alias), mimeMessage, session);
+ }
+ catch (Exception e) {
+ throw new SMIMEException("Cannot generate the encrypted " +
+ "MimeMessage", e);
+ }
+ }
+
+ public MimeMessage createEncryptedMimeMessage(
+ java.security.cert.Certificate cert, MimeMessage mimeMessage,
+ Session session) throws SMIMEException, KeyStoreException,
+ CertificateEncodingException {
+ try {
SMIMEEncryptedGenerator generator = new SMIMEEncryptedGenerator();
! generator.addKeyTransRecipient(convertCert(cert));
generator.setContent(mimeMessage, session);
generator.setContentEncryptionAlgorithm(SMIMEEncryptedGenerator.
***************
*** 162,169 ****
implementation of Certificate
*/
! private java.security.cert.X509Certificate getCertificate(String alias)
throws KeyStoreException, CertificateEncodingException, CertificateException
{
! java.security.cert.Certificate cert = compositeKs.getCertificate(alias);
/*
We need to firsly get the encoded form of the certificate and then
--- 191,198 ----
implementation of Certificate
*/
! private java.security.cert.Certificate getCertificate(String alias)
throws KeyStoreException, CertificateEncodingException, CertificateException
{
! return compositeKs.getCertificate(alias);
/*
We need to firsly get the encoded form of the certificate and then
***************
*** 172,175 ****
--- 201,208 ----
own certificate implementation!
*/
+ }
+
+ private java.security.cert.X509Certificate convertCert(
+ java.security.cert.Certificate cert) throws CertificateException {
JDKX509CertificateFactory certFactory = new JDKX509CertificateFactory();
return (java.security.cert.X509Certificate) certFactory.
|
|
From: <kc...@us...> - 2003-07-17 08:08:17
|
Update of /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/transport
In directory sc8-pr-cvs1:/tmp/cvs-serv19796/src/hk/hku/cecid/phoenix/message/transport
Modified Files:
Tag: b0931
Mail.java
Log Message:
modified s/mime encryption/decryption calling mechanism to suit ebmail usage
Index: Mail.java
===================================================================
RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/transport/Mail.java,v
retrieving revision 1.35.2.4
retrieving revision 1.35.2.5
diff -C2 -d -r1.35.2.4 -r1.35.2.5
*** Mail.java 20 May 2003 04:58:47 -0000 1.35.2.4
--- Mail.java 17 Jul 2003 08:08:13 -0000 1.35.2.5
***************
*** 76,80 ****
import hk.hku.cecid.phoenix.message.packaging.*;
import hk.hku.cecid.phoenix.pki.SMIMEDecrypter;
! import hk.hku.cecid.phoenix.pki.SMIMEEncrypter;
import hk.hku.cecid.phoenix.pki.SMIMEException;
import java.io.BufferedReader;
--- 76,80 ----
import hk.hku.cecid.phoenix.message.packaging.*;
import hk.hku.cecid.phoenix.pki.SMIMEDecrypter;
! //import hk.hku.cecid.phoenix.pki.SMIMEEncrypter;
import hk.hku.cecid.phoenix.pki.SMIMEException;
import java.io.BufferedReader;
***************
*** 88,92 ****
import java.security.NoSuchAlgorithmException;
import java.security.UnrecoverableKeyException;
! import java.security.cert.CertificateEncodingException;
import java.util.ArrayList;
import java.util.Properties;
--- 88,92 ----
import java.security.NoSuchAlgorithmException;
import java.security.UnrecoverableKeyException;
! //import java.security.cert.CertificateEncodingException;
import java.util.ArrayList;
import java.util.Properties;
***************
*** 264,268 ****
* Default transfer encoding for MIME messages.
*/
! private static final String MAIL_TRANSFER_ENCODING = "base64";
/**
--- 264,268 ----
* Default transfer encoding for MIME messages.
*/
! public static final String MAIL_TRANSFER_ENCODING = "base64";
/**
***************
*** 521,551 ****
session.setDebug(debug);
! final SOAPMessage soapMessage = ebxmlMessage.getSOAPMessage();
! final boolean hasAttachments =
! soapMessage.getAttachments().hasNext();
! if (hasAttachments) {
! Utility.addContentTransferEncoding(
! soapMessage, MAIL_TRANSFER_ENCODING,
! MAIL_TRANSFER_ENCODING);
! soapMessage.saveChanges();
! }
!
! final ByteArrayOutputStream out = new ByteArrayOutputStream();
! ebxmlMessage.writeTo(out);
! final String[] contentType = soapMessage.getMimeHeaders().
! getHeader(CONTENT_TYPE);
! String type = contentType[0];
! final AttachmentDataSource content =
! new AttachmentDataSource(out.toByteArray(), type);
! MimeMessage mimeMessage = new MimeMessage(session);
! MimeMultipart multipart = null;
! if (hasAttachments) {
! multipart = new MimeMultipart(content);
}
else {
! mimeMessage.setDataHandler(new DataHandler(content));
! mimeMessage.setHeader(Constants.CONTENT_TRANSFER_ENCODING,
! MAIL_TRANSFER_ENCODING);
}
String fromPartyId = ((MessageHeader.PartyId) ebxmlMessage.
getFromPartyIds().next()).getId();
--- 521,567 ----
session.setDebug(debug);
! SOAPMessage soapMessage = null;
! boolean hasAttachments = false;
! MimeMessage mimeMessage = null;
!
! if (ebxmlMessage.isSMIMEEncrypted()) {
! final ByteArrayOutputStream out = new ByteArrayOutputStream();
! ebxmlMessage.writeTo(out);
! mimeMessage = new MimeMessage(
! session, new ByteArrayInputStream(out.toByteArray()));
}
else {
! soapMessage = ebxmlMessage.getSOAPMessage();
! hasAttachments = soapMessage.getAttachments().hasNext();
! if (hasAttachments) {
! Utility.addContentTransferEncoding(
! soapMessage, MAIL_TRANSFER_ENCODING,
! MAIL_TRANSFER_ENCODING);
! soapMessage.saveChanges();
! }
!
! final ByteArrayOutputStream out = new ByteArrayOutputStream();
! ebxmlMessage.writeTo(out);
! final String[] contentType = soapMessage.getMimeHeaders().
! getHeader(CONTENT_TYPE);
! String type = contentType[0];
! final AttachmentDataSource content =
! new AttachmentDataSource(out.toByteArray(), type);
! mimeMessage = new MimeMessage(session);
! MimeMultipart multipart = null;
! if (hasAttachments) {
! multipart = new MimeMultipart(content);
! }
! else {
! mimeMessage.setDataHandler(new DataHandler(content));
! mimeMessage.setHeader(Constants.CONTENT_TRANSFER_ENCODING,
! MAIL_TRANSFER_ENCODING);
! }
!
! if (multipart != null) {
! mimeMessage.setContent(multipart);
! }
}
+
String fromPartyId = ((MessageHeader.PartyId) ebxmlMessage.
getFromPartyIds().next()).getId();
***************
*** 554,573 ****
(MAIL_PREFIX.length(), fromPartyId.length());
}
!
mimeMessage.setFrom(new InternetAddress(fromPartyId));
mimeMessage.setRecipient(Message.RecipientType.TO,
new InternetAddress(toMshUrl));
mimeMessage.setSubject(ebxmlMessage.getConversationId());
- /* some mail servers cannot receive messages correctly
- if the sent date is set */
- // mimeMessage.setSentDate(new Date());
-
mimeMessage.setHeader(SOAP_ACTION, EBXML_SOAP_ACTION);
- if (multipart != null) {
- mimeMessage.setContent(multipart);
- }
mimeMessage.saveChanges();
if (smime) {
mimeMessage = SMIMEEncrypter.getInstance
--- 570,583 ----
(MAIL_PREFIX.length(), fromPartyId.length());
}
!
mimeMessage.setFrom(new InternetAddress(fromPartyId));
mimeMessage.setRecipient(Message.RecipientType.TO,
new InternetAddress(toMshUrl));
mimeMessage.setSubject(ebxmlMessage.getConversationId());
mimeMessage.setHeader(SOAP_ACTION, EBXML_SOAP_ACTION);
mimeMessage.saveChanges();
+ /*
if (smime) {
mimeMessage = SMIMEEncrypter.getInstance
***************
*** 576,579 ****
--- 586,590 ----
createEncryptedMimeMessage(toMshUrl, mimeMessage, session);
}
+ */
try {
***************
*** 587,593 ****
}
! if (hasAttachments) {
! Utility.removeContentTransferEncoding(soapMessage);
! soapMessage.saveChanges();
}
--- 598,607 ----
}
!
! if (!ebxmlMessage.isSMIMEEncrypted()) {
! if (hasAttachments) {
! Utility.removeContentTransferEncoding(soapMessage);
! soapMessage.saveChanges();
! }
}
***************
*** 612,615 ****
--- 626,630 ----
ErrorMessages.ERR_SMTP_CANNOT_COMPOSE_MESSAGE));
}
+ /*
catch (SMIMEException e) {
logger.error(ErrorMessages.getMessage(
***************
*** 630,633 ****
--- 645,649 ----
ErrorMessages.ERR_PKI_INVALID_KEYSTORE));
}
+ */
catch (Exception e) {
String err = ErrorMessages.getMessage(
***************
*** 638,659 ****
}
- /** Receive mails from a remote mail box in <code>smtpHost</code> using
- the specified <code>protocol</code>, <code>username</code> and
- <code>password</code>
-
- @param protocol protocols such as <code>imap</code> or
- <code>pop3</code> to connect to remote mail box
- @param smtpHost SMTP mail server name
- @param port SMTP mail server port
- @param folderName remote mail box name such as <code>INBOX</code>
- @param username username for mail box authentication
- @param password password for mail box authentication
- @return an array of <code>EbxmlMessage</code>s'
- */
public static EbxmlMessage[] receive(String protocol, String smtpHost,
String port, String folderName,
! String username, String password)
throws TransportException {
-
logger.debug("=> Mail.receive");
logger.info("Receiving " + protocol + " messages from " + smtpHost
--- 654,664 ----
}
public static EbxmlMessage[] receive(String protocol, String smtpHost,
String port, String folderName,
! String username, String password,
! String smimeKeyStoreAlias,
! String smimeKeyStorePassword,
! String smimeKeyStoreLocation)
throws TransportException {
logger.debug("=> Mail.receive");
logger.info("Receiving " + protocol + " messages from " + smtpHost
***************
*** 724,737 ****
if (type.toLowerCase().startsWith(SMIME_ENCRYPTED)) {
logger.debug("Message S/MIME encrypted, now decrypt");
! messages[i] = SMIMEDecrypter.getInstance
! (smimeDecKeyStorePath + File.separator
! + smimeDecKeyStoreFile, smimeDecKeyStorePassword).
! decryptMimeMessage(smimeDecKeyStoreAlias,
! smimeDecKeyStorePassword,
! (MimeMessage) messages[i], session);
! mimeHeaders.addHeader(CONTENT_TYPE, messages[i].
! getContentType());
! soapMessage = messageFactory.createMessage
! (mimeHeaders, messages[i].getInputStream());
}
else if (changeSubType && index >= 0) {
--- 729,748 ----
if (type.toLowerCase().startsWith(SMIME_ENCRYPTED)) {
logger.debug("Message S/MIME encrypted, now decrypt");
! if (smimeKeyStoreLocation == null ||
! smimeKeyStoreAlias == null) {
! logger.debug("Cannot decrypt, invalid keystore");
! throw new SMIMEException("Cannot decrypt, invalid keystore");
! }
! else {
! MimeMessage msg = SMIMEDecrypter.getInstance
! (smimeKeyStoreLocation, smimeKeyStorePassword).
! decryptMimeMessage(smimeKeyStoreAlias,
! smimeKeyStorePassword,
! (MimeMessage) messages[i], session);
! mimeHeaders.addHeader(CONTENT_TYPE, msg.
! getContentType());
! soapMessage = messageFactory.createMessage
! (mimeHeaders, msg.getInputStream());
! }
}
else if (changeSubType && index >= 0) {
***************
*** 842,845 ****
--- 853,883 ----
throw new TransportException(err);
}
+ }
+
+ /** Receive mails from a remote mail box in <code>smtpHost</code> using
+ the specified <code>protocol</code>, <code>username</code> and
+ <code>password</code>
+
+ @param protocol protocols such as <code>imap</code> or
+ <code>pop3</code> to connect to remote mail box
+ @param smtpHost SMTP mail server name
+ @param port SMTP mail server port
+ @param folderName remote mail box name such as <code>INBOX</code>
+ @param username username for mail box authentication
+ @param password password for mail box authentication
+ @return an array of <code>EbxmlMessage</code>s'
+ */
+ public static EbxmlMessage[] receive(String protocol, String smtpHost,
+ String port, String folderName,
+ String username, String password)
+ throws TransportException {
+ String smimeKeyStoreLocation = null;
+ if (smimeDecKeyStorePath != null && smimeDecKeyStoreFile != null) {
+ smimeKeyStoreLocation = smimeDecKeyStorePath + File.separator
+ + smimeDecKeyStoreFile;
+ }
+ return receive(protocol, smtpHost, port, folderName, username, password,
+ smimeDecKeyStoreAlias, smimeDecKeyStorePassword,
+ smimeKeyStoreLocation);
}
|
|
From: <kc...@us...> - 2003-07-17 08:08:17
|
Update of /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/packaging
In directory sc8-pr-cvs1:/tmp/cvs-serv19796/src/hk/hku/cecid/phoenix/message/packaging
Modified Files:
Tag: b0931
EbxmlMessage.java
Log Message:
modified s/mime encryption/decryption calling mechanism to suit ebmail usage
Index: EbxmlMessage.java
===================================================================
RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/packaging/EbxmlMessage.java,v
retrieving revision 1.24.2.4
retrieving revision 1.24.2.5
diff -C2 -d -r1.24.2.4 -r1.24.2.5
*** EbxmlMessage.java 6 May 2003 06:16:52 -0000 1.24.2.4
--- EbxmlMessage.java 17 Jul 2003 08:08:13 -0000 1.24.2.5
***************
*** 72,80 ****
--- 72,88 ----
import hk.hku.cecid.phoenix.message.packaging.validation.SOAPValidationException;
import hk.hku.cecid.phoenix.message.packaging.validation.EbxmlValidationException;
+ import hk.hku.cecid.phoenix.message.transport.Mail;
import hk.hku.cecid.phoenix.pki.CertResolver;
+ import hk.hku.cecid.phoenix.pki.CompositeKeyStore;
+ import hk.hku.cecid.phoenix.pki.SMIMEException;
+ import hk.hku.cecid.phoenix.pki.SMIMEEncrypter;
import java.io.*;
+ import java.security.cert.Certificate;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.HashMap;
+ import java.util.Properties;
+ import javax.mail.*;
+ import javax.mail.internet.*;
import javax.xml.soap.*;
import javax.activation.DataHandler;
***************
*** 157,160 ****
--- 165,173 ----
private String filename;
+ private boolean encryption;
+
+ private Certificate encryptionCert;
+
+
/** Constructs an <code>EbxmlMessage</code> using the default JAXM
<code>MessageFactory</code> implementation
***************
*** 899,902 ****
--- 912,956 ----
/**
+ * Encrypts this ebxml message using s/mime. The actual encryption would
+ * be done when writeTo() is called
+ * @param alias
+ * @param password
+ * @param keyStoreLocation
+ */
+ public void SMIMEEncrypt(String alias, char[] password,
+ String keyStoreLocation)
+ throws SMIMEException {
+ CompositeKeyStore compositeKs = new CompositeKeyStore();
+ compositeKs.addKeyStoreFile(keyStoreLocation , null, password);
+ try {
+ encryptionCert = compositeKs.getCertificate(alias);
+ encryption = true;
+ }
+ catch (Exception e) {
+ throw new SMIMEException("Cannot resolve encryption certificate");
+ }
+ }
+
+ /**
+ * Encrypts this ebxml message using s/mime. The actual encryption would
+ * be done when writeTo() is called
+ * @param c
+ */
+ public void SMIMEEncrypt(CertResolver c) throws SMIMEException {
+ Certificate[] certs = c.resolve(this);
+ if (certs != null && certs.length > 0) {
+ encryptionCert = certs[0];
+ encryption = true;
+ }
+ else {
+ throw new SMIMEException("Cannot resolve encryption certificate");
+ }
+ }
+
+ public boolean isSMIMEEncrypted() {
+ return encryption;
+ }
+
+ /**
* Add an ebXML message payload container.
*
***************
*** 1013,1017 ****
public void writeTo(OutputStream out)
throws IOException, SOAPException {
! soapMessage.writeTo(out);
}
--- 1067,1112 ----
public void writeTo(OutputStream out)
throws IOException, SOAPException {
! if (!encryption || encryptionCert == null) {
! soapMessage.writeTo(out);
! }
! else {
! try {
! final boolean hasAttachments =
! soapMessage.getAttachments().hasNext();
! final ByteArrayOutputStream bytes = new ByteArrayOutputStream();
! soapMessage.writeTo(bytes);
! final String[] contentType = soapMessage.getMimeHeaders().
! getHeader(Constants.CONTENT_TYPE);
! String type = contentType[0];
! final AttachmentDataSource content =
! new AttachmentDataSource(bytes.toByteArray(), type);
! final Session session = Session.getInstance(new Properties());
! MimeMessage mimeMessage = new MimeMessage(session);
! MimeMultipart multipart = null;
! if (hasAttachments) {
! multipart = new MimeMultipart(content);
! }
! else {
! mimeMessage.setDataHandler(new DataHandler(content));
! mimeMessage.setHeader(Constants.CONTENT_TRANSFER_ENCODING,
! Mail.MAIL_TRANSFER_ENCODING);
! }
!
! if (multipart != null) {
! mimeMessage.setContent(multipart);
! }
!
! mimeMessage.saveChanges();
!
! mimeMessage = SMIMEEncrypter.getInstance().
! createEncryptedMimeMessage(encryptionCert, mimeMessage,
! session);
!
! mimeMessage.writeTo(out);
! }
! catch (Exception e) {
! throw new SOAPException(e.getMessage());
! }
! }
}
|
|
From: <cy...@us...> - 2003-07-16 09:00:19
|
Update of /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/pki
In directory sc8-pr-cvs1:/tmp/cvs-serv20825
Modified Files:
ApacheXMLDSigner.java
Log Message:
Patch method addNamespaceDeclaration() should not be needed now.
Index: ApacheXMLDSigner.java
===================================================================
RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/pki/ApacheXMLDSigner.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** ApacheXMLDSigner.java 2 Jun 2003 02:27:07 -0000 1.9
--- ApacheXMLDSigner.java 16 Jul 2003 09:00:15 -0000 1.10
***************
*** 450,454 ****
}
Element signatureElement = (Element) nodeList.item(0);
! addNamespaceDeclaration(signatureElement);
logger.debug("got the signature element");
--- 450,454 ----
}
Element signatureElement = (Element) nodeList.item(0);
! // addNamespaceDeclaration(signatureElement);
logger.debug("got the signature element");
***************
*** 567,570 ****
--- 567,571 ----
}
+ /*
private void addNamespaceDeclaration(Element element) {
NodeList nodeList = element.getChildNodes();
***************
*** 586,588 ****
--- 587,590 ----
}
}
+ */
}
|
|
From: <cy...@us...> - 2003-07-16 08:56:14
|
Update of /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/handler
In directory sc8-pr-cvs1:/tmp/cvs-serv20226
Modified Files:
MessageServer.java
Log Message:
In getMessageFromFile(), setSOAPMessageFileOffset() should be invoked now
in the constructin of EbxmlMessage.
Index: MessageServer.java
===================================================================
RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/handler/MessageServer.java,v
retrieving revision 1.139
retrieving revision 1.140
diff -C2 -d -r1.139 -r1.140
*** MessageServer.java 17 Jun 2003 04:28:01 -0000 1.139
--- MessageServer.java 16 Jul 2003 08:56:11 -0000 1.140
***************
*** 3489,3492 ****
--- 3489,3494 ----
final PushbackInputStream fileStream = new PushbackInputStream(fis);
String boundary = null;
+ int soapMessageFileOffset = 0;
+ int soapMessageLength = 0;
ByteArrayOutputStream out = new ByteArrayOutputStream();
byte[] line = readLine(fileStream);
***************
*** 3501,3504 ****
--- 3503,3507 ----
}
byte[] soapMessageBytes = out.toByteArray();
+ soapMessageLength = soapMessageBytes.length;
int lastIndex = soapMessageBytes.length - 1;
***************
*** 3534,3537 ****
--- 3537,3541 ----
with offset being the beginning position
*/
+ soapMessageFileOffset = (int) offset;
out = new ByteArrayOutputStream();
line = readLine(fileStream);
***************
*** 3555,3558 ****
--- 3559,3563 ----
soapMessageBytes = out.toByteArray();
+ soapMessageLength = soapMessageBytes.length;
lastIndex = soapMessageBytes.length - 1;
for ( ; lastIndex >= 0 ; lastIndex--) {
***************
*** 3740,3743 ****
--- 3745,3750 ----
EbxmlMessage message = new EbxmlMessage(soapMessage);
message.setPayloadContainers(payloads);
+ message.setSOAPMessageFileOffset
+ (soapMessageFileOffset, soapMessageLength);
message.setFileName(file.getCanonicalPath());
logger.debug("<= MessageServer.getMessageFromFile");
|