/*
 * qca_systemstore_flatfile.cpp - Qt Cryptographic Architecture
 * Copyright (C) 2004,2005  Justin Karneges
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */

#include "qca_systemstore.h"

#include <QtCore>

namespace QCA {

bool qca_have_systemstore()
{
	QFile f(QCA_SYSTEMSTORE_PATH);
	return f.open(QFile::ReadOnly);
}

CertificateCollection qca_get_systemstore(const QString &provider)
{
	return CertificateCollection::fromFlatTextFile(QCA_SYSTEMSTORE_PATH, 0, provider);
}

}

/*
 * qca_systemstore_flatfile.cpp - Qt Cryptographic Architecture
 * Copyright (C) 2004,2005  Justin Karneges
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */

#include "qca_systemstore.h"

#include <QtCore>

namespace QCA {

bool qca_have_systemstore()
{
#ifdef QCA_NO_SYSTEMSTORE
	return false;
#else
	QFile f(QCA_SYSTEMSTORE_PATH);
	return f.open(QFile::ReadOnly);
#endif
}

CertificateCollection qca_get_systemstore(const QString &provider)
{
#ifdef QCA_NO_SYSTEMSTORE
	Q_UNUSED(provider);
	return CertificateCollection();
#else
	return CertificateCollection::fromFlatTextFile(QCA_SYSTEMSTORE_PATH, 0, provider);
#endif
}

}

Add in support for when there is no system store support.
Add in support for when there is no system store support.

svn path=/trunk/kdesupport/qca/; revision=407460
