* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License Version 2+ * @version $Id$ */ namespace EGroupware\Api\Mail; use EGroupware\Api; use Horde_Crypt_Smime; /** * EMailAdmin generic base class for SMTP */ class Smime extends Horde_Crypt_Smime { static $SMIME_TYPES = array ( 'application/pkcs8', 'application/pkcs7', 'application/pkcs10', 'application/pkcs8', 'multipart/signed', 'application/x-pkcs7-signature', 'application/x-pkcs7-mime', 'application/pkcs7-mime', 'application/pkcs7-signature', ); /** * Constructor. * * @param Horde_Crypt_Smime $smime S/MIME object. */ public function __construct($params = array()) { parent::__construct($params); } /** * Check if a given mime type is smime type * * @param string $_mime mime type * * @return boolean returns TRUE if the given mime is smime */ public static function isSmime ($_mime) { return in_array($_mime, self::$SMIME_TYPES); } /** * Check if the openssl is supported * * @return boolean returns True if openssl is supported */ public function enabled () { try { $this->checkForOpenSSL(); } catch (Exception $ex) { return false; } return true; } }