org.apache.james.transport.mailets.smime
Class SMIMESign

java.lang.Object
  extended by org.apache.mailet.GenericMailet
      extended by org.apache.james.transport.mailets.smime.AbstractSign
          extended by org.apache.james.transport.mailets.smime.Sign
              extended by org.apache.james.transport.mailets.smime.SMIMESign
All Implemented Interfaces:
org.apache.mailet.Mailet, org.apache.mailet.MailetConfig

public class SMIMESign
extends Sign

Puts a server-side SMIME signature on a message.
It is a concrete subclass of Sign, with very few modifications to it, to specialize for SMIME.

Handles the following init parameters (will comment only the differences from AbstractSign):

Since:
2.3.0
Version:
CVS $Revision: 647925 $ $Date: 2008-04-14 19:38:17 +0100 (Mon, 14 Apr 2008) $

Constructor Summary
SMIMESign()
           
 
Method Summary
protected  java.lang.String[] getAllowedInitParameters()
          Gets the expected init parameters.
 java.lang.String getExplanationText()
          If the <explanationText> init parameter is missing returns the following default explanation template string:
 java.lang.String getMailetInfo()
          Return a string describing this mailet.
protected  javax.mail.internet.MimeBodyPart getWrapperBodyPart(org.apache.mailet.Mail mail)
          A text file with the massaged contents of getExplanationText() is attached to the original message.
protected  void initKeyHolderClass()
          Initializer for property keyHolderClass.
protected  void initPostmasterSigns()
          If the <postmasterSigns> init parameter is missing sets it to true.
protected  void initRebuildFrom()
          If the <rebuildFrom> init parameter is missing sets it to true.
 
Methods inherited from class org.apache.james.transport.mailets.smime.AbstractSign
fromAddressSameAsReverse, getKeyHolder, getKeyHolderClass, getMessageHeaders, getReplacedExplanationText, getSignerName, init, initDebug, initExplanationText, initKeyHolder, initSignerName, isDebug, isOkToSign, isPostmasterSigns, isRebuildFrom, service, setDebug, setExplanationText, setKeyHolder, setKeyHolderClass, setPostmasterSigns, setRebuildFrom, setSignerName
 
Methods inherited from class org.apache.mailet.GenericMailet
arrayToString, checkInitParameters, destroy, getInitParameter, getInitParameter, getInitParameterNames, getMailetConfig, getMailetContext, getMailetName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SMIMESign

public SMIMESign()
Method Detail

getMailetInfo

public java.lang.String getMailetInfo()
Return a string describing this mailet.

Specified by:
getMailetInfo in interface org.apache.mailet.Mailet
Overrides:
getMailetInfo in class Sign
Returns:
a string describing this mailet

getAllowedInitParameters

protected java.lang.String[] getAllowedInitParameters()
Description copied from class: AbstractSign
Gets the expected init parameters.

Overrides:
getAllowedInitParameters in class Sign
Returns:
An array containing the parameter names allowed for this mailet.

getExplanationText

public java.lang.String getExplanationText()
If the <explanationText> init parameter is missing returns the following default explanation template string:

 The message this file is attached to has been signed on the server by
     "[signerName]" <[signerAddress]>
 to certify that the sender is known and truly has the following address (reverse-path):
     [reversePath]
 and that the original message has the following message headers:

 [headers]

 The signature envelopes this attachment too.
 Please check the signature integrity.

     "[signerName]" <[signerAddress]>
 

Overrides:
getExplanationText in class Sign
Returns:
Value of property explanationText.

initKeyHolderClass

protected void initKeyHolderClass()
                           throws javax.mail.MessagingException
Initializer for property keyHolderClass. Hardcodes it to SMIMEKeyHolder.

Overrides:
initKeyHolderClass in class AbstractSign
Throws:
javax.mail.MessagingException

initPostmasterSigns

protected void initPostmasterSigns()
If the <postmasterSigns> init parameter is missing sets it to true.

Overrides:
initPostmasterSigns in class Sign

initRebuildFrom

protected void initRebuildFrom()
                        throws javax.mail.MessagingException
If the <rebuildFrom> init parameter is missing sets it to true.

Overrides:
initRebuildFrom in class Sign
Throws:
javax.mail.MessagingException

getWrapperBodyPart

protected javax.mail.internet.MimeBodyPart getWrapperBodyPart(org.apache.mailet.Mail mail)
                                                       throws javax.mail.MessagingException,
                                                              java.io.IOException
A text file with the massaged contents of getExplanationText() is attached to the original message.

Overrides:
getWrapperBodyPart in class Sign
Parameters:
mail - The mail to massage.
Returns:
The massaged MimeBodyPart to sign, or null to have the whole message signed "as is".
Throws:
javax.mail.MessagingException
java.io.IOException


Copyright © 2008 The Apache Software Foundation. All Rights Reserved.