1 /**************************************************************** 2 * Licensed to the Apache Software Foundation (ASF) under one * 3 * or more contributor license agreements. See the NOTICE file * 4 * distributed with this work for additional information * 5 * regarding copyright ownership. The ASF licenses this file * 6 * to you under the Apache License, Version 2.0 (the * 7 * "License"); you may not use this file except in compliance * 8 * with the License. You may obtain a copy of the License at * 9 * * 10 * http://www.apache.org/licenses/LICENSE-2.0 * 11 * * 12 * Unless required by applicable law or agreed to in writing, * 13 * software distributed under the License is distributed on an * 14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * 15 * KIND, either express or implied. See the License for the * 16 * specific language governing permissions and limitations * 17 * under the License. * 18 ****************************************************************/ 19 20 21 package org.apache.james.mailet.crypto; 22 23 import javax.mail.internet.MimeBodyPart; 24 import javax.mail.internet.MimeMessage; 25 import javax.mail.internet.MimeMultipart; 26 27 /** 28 * <p>Interface to an object that will do cryptographic activity on a MimeMessage, 29 * and contains the needed cryptographic key.</p> 30 * <p>The implementing objects have the role of being a simpler intermediate to the crypto libraries.</p> 31 * @version CVS $Revision: 721862 $ $Date: 2008-11-30 17:38:25 +0000 (Sun, 30 Nov 2008) $ 32 * @since 3.0 33 */ 34 public interface KeyHolder { 35 36 /** 37 * Generates a signed MimeMultipart from a MimeMessage. 38 * @param message The message to sign. 39 * @return The signed <CODE>MimeMultipart</CODE>. 40 */ 41 public MimeMultipart generate(MimeMessage message) throws Exception; 42 43 /** 44 * Generates a signed MimeMultipart from a MimeBodyPart. 45 * @param content The content to sign. 46 * @return The signed <CODE>MimeMultipart</CODE>. 47 */ 48 public MimeMultipart generate(MimeBodyPart content) throws Exception; 49 50 /** 51 * Getter for property signerDistinguishedName. 52 * @return Value of property signerDistinguishedName. 53 */ 54 public String getSignerDistinguishedName(); 55 56 /** 57 * Getter for property signerCN. 58 * @return Value of property signerCN. 59 */ 60 public String getSignerCN(); 61 62 /** 63 * Getter for property signerAddress. 64 * @return Value of property signerMailAddress. 65 */ 66 public String getSignerAddress(); 67 68 }