//  gnoMint: a graphical interface for managing a certification authority
//  Copyright (C) 2006-2009 David Marín Carreño <davefx@gmail.com>
//
//  This file is part of gnoMint.
//
//  gnoMint is free software; you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation; either version 3 of the License, or   
//  (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

#ifndef _EXPORT_H_
#define _EXPORT_H_

#include <glib.h>
#include <glib/gi18n.h>

gchar *export_dh_param (guint dh_size, gchar *filename);

#ifdef GNOMINTCLI

gchar * export_private_pem (guint64 id, gint type, gchar *filename);

#else

typedef void (*ExportPrivatePemCallback)(const gchar *error_msg, gpointer user_data);

void export_private_pem (guint64 id, gint type, gchar *filename,
                         ExportPrivatePemCallback cb, gpointer user_data);

#endif

#ifdef GNOMINTCLI

gchar * export_private_pkcs8 (guint64 id, gint type, gchar *filename);

gchar * export_pkcs12 (guint64 id, gint type, gchar *filename);

#else

typedef void (*ExportPkcs8Callback)(const gchar *error_msg, gpointer user_data);
typedef void (*ExportPkcs12Callback)(const gchar *error_msg, gpointer user_data);

void export_private_pkcs8 (guint64 id, gint type, gchar *filename,
                           ExportPkcs8Callback cb, gpointer user_data);

void export_pkcs12 (guint64 id, gint type, gchar *filename,
                    ExportPkcs12Callback cb, gpointer user_data);

#endif

#endif
