* @throws IOException
*/
public byte[] encode( PrivateMessage message ) throws IOException
{
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ASN1OutputStream aos = new ASN1OutputStream( baos );
DERSequence privateMessageSequence = encodePrivateMessageSequence( message );
aos
.writeObject( DERApplicationSpecific
.valueOf( message.getMessageType().getOrdinal(), privateMessageSequence ) );
aos.close();
return baos.toByteArray();
}