org.nhindirect.stagent.cryptography
Class SignedEntity

java.lang.Object
  extended by org.nhindirect.stagent.cryptography.SignedEntity

public class SignedEntity
extends Object

A specific type of MultipartEntity that has been signed.

Author:
Greg Meyer, Umesh Madan

Constructor Summary
SignedEntity(javax.mail.internet.ContentType mmContentType, javax.mail.internet.MimeMultipart mm)
          Constructs a signed entity from a JavaMail MimeMultipart.
SignedEntity(DigestAlgorithm algorithm, javax.mail.internet.MimeMultipart mm)
          Constructs a signed entity from a JavaMail MimeMultipart.
 
Method Summary
 MimeEntity getContent()
          Gets The content entity that was signed.
 byte[] getEntityBodyAsBytes()
          Gets the content (body) of the signed entity as a byte array.
 javax.mail.internet.MimeMultipart getMimeMultipart()
          Gets the original MimeMultipart object of the signed entity.
 MimeEntity getSignature()
          Gets the entity part that contains the message signature.
static SignedEntity load(javax.mail.internet.MimeMultipart source)
          Generates a signed entity from a MimeMultipart entity.
 void setContent(MimeEntity value)
          Sets the content entity that will be used to generate the signature.
 void setSignature(MimeEntity value)
          Sets the entity part that contains the message signature.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SignedEntity

public SignedEntity(javax.mail.internet.ContentType mmContentType,
                    javax.mail.internet.MimeMultipart mm)
             throws MimeException
Constructs a signed entity from a JavaMail MimeMultipart. The MimeMultipart object contains a part consisting of the message signature.

Parameters:
mmContentType - The content type of the entity.
mm - The MimeMultipart that contains the parts that were used to sign the message and the message signature part.
Throws:
MimeException

SignedEntity

public SignedEntity(DigestAlgorithm algorithm,
                    javax.mail.internet.MimeMultipart mm)
Constructs a signed entity from a JavaMail MimeMultipart. The MimeMultipart object contains a part consisting of the message signature.

Parameters:
algorithm - The digest algorithm used to create message signature.
mm - The MimeMultipart that contains the parts that were used to sign the message and the message signature part.
Method Detail

getContent

public MimeEntity getContent()
Gets The content entity that was signed.

Returns:
The content that was signed.

setContent

public void setContent(MimeEntity value)
Sets the content entity that will be used to generate the signature.

Parameters:
value - The content entity that will be used to generate the signature.

getSignature

public MimeEntity getSignature()
Gets the entity part that contains the message signature.

Returns:
The entity part that contains the message signature.

setSignature

public void setSignature(MimeEntity value)
Sets the entity part that contains the message signature.

Parameters:
value - The entity part that contains the message signature.

getMimeMultipart

public javax.mail.internet.MimeMultipart getMimeMultipart()
Gets the original MimeMultipart object of the signed entity.

Returns:
The original MimeMultipart object of the signed entity.

getEntityBodyAsBytes

public byte[] getEntityBodyAsBytes()
Gets the content (body) of the signed entity as a byte array. This includes both the content part and the signature part.

Returns:
The content (body) of the message as a byte array.

load

public static SignedEntity load(javax.mail.internet.MimeMultipart source)
Generates a signed entity from a MimeMultipart entity. The MIME entity should contain an entity part consisting of the message signature.

Parameters:
source - The MimeMultipart that will be parsed into a signed entity.
Returns:
A signed entity containing the content that was signed and the message signature.


Copyright © 2010-2014 NHIN Direct. All Rights Reserved.