## OpenCA - CA Command
## (c) 1998-2001 by Massimiliano Pala and OpenCA Group
## (c) Copyright 2002-2004 The OpenCA Project
##
##   File Name: issueCertificate
##     Version: $Revision: 1.5.2.2 $
##       Brief: Issue a Certificate
## Description: Issue a new Certificate
##  Parameters: key, dataType, passwd

use strict;

sub cmdIssueCertificate {

	## Get the parameters
	my $key 	= $query->param('key');
	my $dataType    = $query->param('dataType');

	my $cert = libIssueCertificate (KEY      => $key,
					DATATYPE => $dataType);
	if (not $cert) {
		generalError ($errval, $errno);
	}

	## Send Success Page
	success( gettext("Certificate Issued"),
		 gettext("Certificate issued and Certificate Request archived.")."\n",
		 "<pre>".$cert->getTXT()."</pre>" );
}

1;
