/*
- * Copyright 2001-2007 The Apache Software Foundation.
+ * Copyright 2001-2010 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
/**
* OpenSSLCryptoX509CRL.cpp
*
- * OpenSSL-based class for handling X.509 CRLs
+ * OpenSSL-based class for handling X.509 CRLs.
*/
#include "internal.h"
using namespace xmltooling;
+OpenSSLCryptoX509CRL::OpenSSLCryptoX509CRL() : mp_X509CRL(nullptr), m_DERX509CRL("")
+{
+}
+
OpenSSLCryptoX509CRL::~OpenSSLCryptoX509CRL()
{
if (mp_X509CRL)
BIO_free_all(b64);
}
-void OpenSSLCryptoX509CRL::loadX509CRLBase64Bin(const char* buf, unsigned int len) {
+const XMLCh* OpenSSLCryptoX509CRL::getProviderName() const
+{
+ return DSIGConstants::s_unicodeStrPROVOpenSSL;
+}
+
+void OpenSSLCryptoX509CRL::loadX509CRLBase64Bin(const char* buf, unsigned int len)
+{
// Free anything currently held.
if (bufLen > 0) {
#if defined(XSEC_OPENSSL_D2IX509_CONST_BUFFER)
- mp_X509CRL= d2i_X509_CRL(NULL, (const unsigned char **) (&outBuf), bufLen);
+ mp_X509CRL= d2i_X509_CRL(nullptr, (const unsigned char **) (&outBuf), bufLen);
#else
- mp_X509CRL= d2i_X509_CRL(NULL, &outBuf, bufLen);
+ mp_X509CRL= d2i_X509_CRL(nullptr, &outBuf, bufLen);
#endif
}
// Check to see if we have a CRL....
- if (mp_X509CRL == NULL) {
+ if (mp_X509CRL == nullptr) {
throw XSECCryptoException(XSECCryptoException::X509Error,
"OpenSSL:X509CRL - Error translating Base64 DER encoding into OpenSSL X509 CRL structure");
}
m_DERX509CRL.sbStrcpyIn(buf);
}
+
+safeBuffer& OpenSSLCryptoX509CRL::getDEREncodingSB()
+{
+ return m_DERX509CRL;
+}
+
+X509_CRL* OpenSSLCryptoX509CRL::getOpenSSLX509CRL()
+{
+ return mp_X509CRL;
+}
+
+XSECCryptoX509CRL* OpenSSLCryptoX509CRL::clone() const
+{
+ OpenSSLCryptoX509CRL* copy = new OpenSSLCryptoX509CRL();
+ copy->mp_X509CRL = X509_CRL_dup(mp_X509CRL);
+ copy->m_DERX509CRL = m_DERX509CRL;
+ return copy;
+}