FileDocCategorySizeDatePackage
IsSMIMESigned.javaAPI DocApache James 2.3.12303Fri Jan 12 12:56:32 GMT 2007org.apache.james.transport.matchers.smime

IsSMIMESigned

public class IsSMIMESigned extends org.apache.mailet.GenericMatcher
checks if a mail is smime signed.

Fields Summary
Constructors Summary
Methods Summary
public java.util.Collectionmatch(org.apache.mailet.Mail mail)

see
org.apache.mailet.Matcher#match(org.apache.mailet.Mail)

        if (mail == null) return null;
        
        MimeMessage message = mail.getMessage();
        if (message == null) return null;
        
        
        if (message.isMimeType("multipart/signed") 
                || message.isMimeType("application/pkcs7-signature")
                || message.isMimeType("application/x-pkcs7-signature")
                || ((message.isMimeType("application/pkcs7-mime") || message.isMimeType("application/x-pkcs7-mime")) 
                        && message.getContentType().indexOf("signed-data") != -1)) {
            return mail.getRecipients();
        } else return null;