Source0: %{name}-%{version}.tar.gz
Source1001: %{name}.manifest
BuildRequires: cmake
-BuildRequires: boost-devel
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(openssl)
BuildRequires: pkgconfig(evas)
BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: pkgconfig(libxslt)
BuildRequires: pkgconfig(libtzplatform-config)
-Requires(post): /sbin/ldconfig
-Requires(postun): /sbin/ldconfig
+Requires: ca-certificates
Requires: libtzplatform-config
-Provides: libcert-svc-vcore.so.1
%description
Certification service
Requires: %{name} = %{version}-%{release}
%description devel
-Certification service (developement files)
+Certification service (development files)
%prep
%setup -q
#define _VALIDATION_CORE_CERTSTORETYPE_H_
#include <string.h>
-#include <boost/optional.hpp>
namespace ValidationCore {
namespace CertStoreId {
return DPL::FromUTF8String(buffer);
}
-boost::optional<DPL::String> Certificate::getField(FieldType type,
+DPL::String Certificate::getField(FieldType type,
int fieldNid) const
{
X509_NAME *subjectName = getX509Name(type);
X509_NAME_ENTRY *subjectEntry = NULL;
- boost::optional < DPL::String > output;
+ DPL::String output;
int entryCount = X509_NAME_entry_count(subjectName);
for (int i = 0; i < entryCount; ++i) {
return output;
}
-boost::optional<DPL::String> Certificate::getCommonName(FieldType type) const
+DPL::String Certificate::getCommonName(FieldType type) const
{
return getField(type, NID_commonName);
}
-boost::optional<DPL::String> Certificate::getCountryName(FieldType type) const
+DPL::String Certificate::getCountryName(FieldType type) const
{
return getField(type, NID_countryName);
}
-boost::optional<DPL::String> Certificate::getStateOrProvinceName(FieldType type) const
+DPL::String Certificate::getStateOrProvinceName(FieldType type) const
{
return getField(type, NID_stateOrProvinceName);
}
-boost::optional<DPL::String> Certificate::getLocalityName(FieldType type) const
+DPL::String Certificate::getLocalityName(FieldType type) const
{
return getField(type, NID_localityName);
}
-boost::optional<DPL::String> Certificate::getOrganizationName(FieldType type) const
+DPL::String Certificate::getOrganizationName(FieldType type) const
{
return getField(type, NID_organizationName);
}
-boost::optional<DPL::String> Certificate::getOrganizationalUnitName(FieldType type) const
+DPL::String Certificate::getOrganizationalUnitName(FieldType type) const
{
return getField(type, NID_organizationalUnitName);
}
-boost::optional<DPL::String> Certificate::getEmailAddres(FieldType type) const
+DPL::String Certificate::getEmailAddres(FieldType type) const
{
return getField(type, NID_pkcs9_emailAddress);
}
-boost::optional<DPL::String> Certificate::getOCSPURL() const
+DPL::String Certificate::getOCSPURL() const
{
// TODO verify this code
- boost::optional<DPL::String> retValue;
+ DPL::String retValue;
AUTHORITY_INFO_ACCESS *aia = static_cast<AUTHORITY_INFO_ACCESS*>(
X509_get_ext_d2i(m_x509,
NID_info_access,
ad->location->type == GEN_URI)
{
void* data = ASN1_STRING_data(ad->location->d.ia5);
- retValue = boost::optional<DPL::String>(DPL::FromUTF8String(
+ retValue = DPL::String(DPL::FromUTF8String(
static_cast<char*>(data)));
break;
#include <dpl/noncopyable.h>
#include <memory>
#include <dpl/string.h>
-#include <boost/optional.hpp>
-
#include <openssl/x509.h>
// getName uses deprecated functions. Usage is strongly discouraged.
DPL::String getOneLine(FieldType type = FIELD_SUBJECT) const;
- boost::optional<DPL::String> getCommonName(FieldType type = FIELD_SUBJECT) const;
- boost::optional<DPL::String> getCountryName(FieldType type = FIELD_SUBJECT) const;
- boost::optional<DPL::String> getStateOrProvinceName(
+ DPL::String getCommonName(FieldType type = FIELD_SUBJECT) const;
+ DPL::String getCountryName(FieldType type = FIELD_SUBJECT) const;
+ DPL::String getStateOrProvinceName(
FieldType type = FIELD_SUBJECT) const;
- boost::optional<DPL::String> getLocalityName(FieldType type = FIELD_SUBJECT) const;
- boost::optional<DPL::String> getOrganizationName(
+ DPL::String getLocalityName(FieldType type = FIELD_SUBJECT) const;
+ DPL::String getOrganizationName(
FieldType type = FIELD_SUBJECT) const;
- boost::optional<DPL::String> getOrganizationalUnitName(
+ DPL::String getOrganizationalUnitName(
FieldType type = FIELD_SUBJECT) const;
- boost::optional<DPL::String> getEmailAddres(FieldType type = FIELD_SUBJECT) const;
- boost::optional<DPL::String> getOCSPURL() const;
+ DPL::String getEmailAddres(FieldType type = FIELD_SUBJECT) const;
+ DPL::String getOCSPURL() const;
// Openssl supports 9 types of alternative name filed.
protected:
X509_NAME *getX509Name(FieldType type) const;
- boost::optional<DPL::String> getField(FieldType type,
+ DPL::String getField(FieldType type,
int fieldNid) const;
X509 *m_x509;
#include <dpl/assert.h>
#include <dpl/exception.h>
-#include <boost/optional.hpp>
-
#include <vcore/scoped_gpointer.h>
#include <vcore/OCSPCertMgrUtil.h>
typedef std::pair<char*, size_t> HttpResponseBuffer;
SoupWrapper::SoupMessageSendBase::RequestStatus sendOcspRequest(
- OCSP_REQUEST* argRequest,
- const boost::optional<DPL::String>& argUri);
+ OCSP_REQUEST* argRequest,
+ const DPL::String& argUri);
auto certPtr = iter->second;
- boost::optional<DPL::String> result;
+ DPL::String result;
switch(field) {
case CERTSVC_SUBJECT:
- result = boost::optional<DPL::String>(certPtr->getOneLine());
+ result = certPtr->getOneLine();
break;
case CERTSVC_ISSUER:
- result = boost::optional<DPL::String>(certPtr->getOneLine(Certificate::FIELD_ISSUER));
+ result = certPtr->getOneLine(Certificate::FIELD_ISSUER);
break;
case CERTSVC_SUBJECT_COMMON_NAME:
result = certPtr->getCommonName();
{
std::stringstream stream;
stream << (certPtr->getVersion()+1);
- result = boost::optional<DPL::String>(DPL::FromUTF8String(stream.str()));
+ result = DPL::FromUTF8String(stream.str());
break;
}
case CERTSVC_SERIAL_NUMBER:
- result = boost::optional<DPL::String>(certPtr->getSerialNumberString());
+ result = certPtr->getSerialNumberString();
break;
case CERTSVC_KEY_USAGE:
- result = boost::optional<DPL::String>(certPtr->getKeyUsageString());
+ result = certPtr->getKeyUsageString();
break;
case CERTSVC_KEY:
- result = boost::optional<DPL::String>(certPtr->getPublicKeyString());
+ result = certPtr->getPublicKeyString();
break;
case CERTSVC_SIGNATURE_ALGORITHM:
- result = boost::optional<DPL::String>(certPtr->getSignatureAlgorithmString());
+ result = certPtr->getSignatureAlgorithmString();
break;
default:
break;
}
- if (!result) {
+ if (result.empty()) {
buffer->privateHandler = NULL;
buffer->privateLength = 0;
buffer->privateInstance = cert.privateInstance;
return CERTSVC_SUCCESS;
}
- std::string output = DPL::ToUTF8String(*result);
+ std::string output = DPL::ToUTF8String(result);
char *cstring = new char[output.size()+1];
if (cstring == NULL) {