mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2024-11-12 18:57:16 +01:00
4a6bfc086c
Switched to POCO library for unified platform/library interface. Deprecated the external module API. It was creating more problems than solving. Removed most built-in libraries in favor of system libraries for easier maintenance. Cleaned and secured code with help from static analyzers.
54 lines
1.4 KiB
C++
54 lines
1.4 KiB
C++
//
|
|
// PKCS12ContainerTest.h
|
|
//
|
|
// Definition of the PKCS12ContainerTest class.
|
|
//
|
|
// Copyright (c) 2012, Applied Informatics Software Engineering GmbH.
|
|
// and Contributors.
|
|
//
|
|
// SPDX-License-Identifier: BSL-1.0
|
|
//
|
|
|
|
|
|
#ifndef PKCS12ContainerTest_INCLUDED
|
|
#define PKCS12ContainerTest_INCLUDED
|
|
|
|
|
|
#include "Poco/Crypto/Crypto.h"
|
|
#include "CppUnit/TestCase.h"
|
|
#include "Poco/Crypto/PKCS12Container.h"
|
|
#include "Poco/Crypto/X509Certificate.h"
|
|
|
|
|
|
class PKCS12ContainerTest: public CppUnit::TestCase
|
|
{
|
|
public:
|
|
PKCS12ContainerTest(const std::string& name);
|
|
~PKCS12ContainerTest();
|
|
|
|
void testFullPKCS12();
|
|
void testCertsOnlyPKCS12();
|
|
void testPEMReadWrite();
|
|
|
|
void setUp();
|
|
void tearDown();
|
|
|
|
static CppUnit::Test* suite();
|
|
|
|
private:
|
|
std::string getTestFilesPath(const std::string& name,
|
|
const std::string& ext = "p12");
|
|
void certsOnly(const Poco::Crypto::PKCS12Container& pkcs12);
|
|
void certsOnlyList(const Poco::Crypto::PKCS12Container::CAList& caList,
|
|
const Poco::Crypto::PKCS12Container::CANameList& caNamesList,
|
|
const std::vector<int>& certOrder);
|
|
void full(const Poco::Crypto::PKCS12Container& pkcs12);
|
|
void fullCert(const Poco::Crypto::X509Certificate& x509);
|
|
void fullList(const Poco::Crypto::PKCS12Container::CAList& caList,
|
|
const Poco::Crypto::PKCS12Container::CANameList& caNamesList,
|
|
const std::vector<int>& certOrder);
|
|
};
|
|
|
|
|
|
#endif // PKCS12ContainerTest_INCLUDED
|