Coverage Report - org.mule.module.pgp.SignedMessage
 
Classes in this File Line Coverage Branch Coverage Complexity
SignedMessage
0%
0/7
N/A
1
 
 1  
 /*
 2  
  * $Id: SignedMessage.java 20320 2010-11-24 15:03:31Z dfeist $
 3  
  * --------------------------------------------------------------------------------------
 4  
  * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
 5  
  *
 6  
  * The software in this package is published under the terms of the CPAL v1.0
 7  
  * license, a copy of which has been included with this distribution in the
 8  
  * LICENSE.txt file.
 9  
  */
 10  
 
 11  
 package org.mule.module.pgp;
 12  
 
 13  
 import java.io.IOException;
 14  
 import java.io.InputStream;
 15  
 
 16  
 import org.apache.commons.io.IOUtils;
 17  
 import org.bouncycastle.openpgp.PGPPublicKey;
 18  
 import org.bouncycastle.openpgp.PGPSecretKey;
 19  
 
 20  
 public class SignedMessage implements Message
 21  
 {
 22  
 
 23  
     private LazyInputStream encryptedMessage;
 24  
 
 25  
     public SignedMessage(InputStream toBeDecrypted,
 26  
                          PGPPublicKey publicKey,
 27  
                          PGPSecretKey secretKey,
 28  
                          String password) throws IOException
 29  0
     {
 30  0
         OutputStreamWriter writer = new DecryptOutputStreamWriter(toBeDecrypted, publicKey, secretKey,
 31  
             password);
 32  0
         this.encryptedMessage = new LazyInputStream(writer);
 33  0
     }
 34  
 
 35  
     public boolean verify()
 36  
     {
 37  
         // TODO Signed messages is not implemented yet
 38  0
         return false;
 39  
     }
 40  
 
 41  
     public Message getContents() throws IOException
 42  
     {
 43  0
         String contents = IOUtils.toString(this.encryptedMessage);
 44  0
         return new LiteralMessage(contents.getBytes());
 45  
     }
 46  
 
 47  
 }