summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp')
-rw-r--r--cpp/include/Ice/SslRSACertificateGen.h26
-rw-r--r--cpp/include/Ice/SslRSAKeyPair.h14
-rw-r--r--cpp/include/Ice/SslRSAPrivateKey.h18
-rw-r--r--cpp/include/Ice/SslRSAPublicKey.h18
-rw-r--r--cpp/src/Glacier/CertVerifier.cpp16
-rw-r--r--cpp/src/Glacier/glacierrouter.dsp18
-rw-r--r--cpp/src/Ice/SslConnectionOpenSSL.cpp2
-rw-r--r--cpp/src/Ice/SslRSAKeyPair.cpp130
-rw-r--r--cpp/src/Ice/SslRSAPrivateKey.cpp1
-rw-r--r--cpp/src/Ice/SslRSAPublicKey.cpp1
-rw-r--r--cpp/src/Ice/ice.dsp40
-rw-r--r--cpp/test/Glacier/starter/CertVerifier.cpp31
12 files changed, 112 insertions, 203 deletions
diff --git a/cpp/include/Ice/SslRSACertificateGen.h b/cpp/include/Ice/SslRSACertificateGen.h
index 134aff83fc7..096159e9090 100644
--- a/cpp/include/Ice/SslRSACertificateGen.h
+++ b/cpp/include/Ice/SslRSACertificateGen.h
@@ -57,15 +57,15 @@ public:
//
RSACertificateGenContext();
- ~RSACertificateGenContext() {};
+ ~RSACertificateGenContext();
// Distinguished Name methods (setters)
- void setCountry(const string&);
- void setStateProvince(const string&);
- void setLocality(const string&);
- void setOrganization(const string&);
- void setOrgainizationalUnit(const string&);
- void setCommonName(const string&);
+ void setCountry(const std::string&);
+ void setStateProvince(const std::string&);
+ void setLocality(const std::string&);
+ void setOrganization(const std::string&);
+ void setOrgainizationalUnit(const std::string&);
+ void setCommonName(const std::string&);
// Setters
void setBitStrength(int);
@@ -85,12 +85,12 @@ public:
private:
- string _country;
- string _stateProvince;
- string _locality;
- string _organization;
- string _organizationalUnit;
- string _commonName;
+ std::string _country;
+ std::string _stateProvince;
+ std::string _locality;
+ std::string _organization;
+ std::string _organizationalUnit;
+ std::string _commonName;
int _modulusLength;
long _secondsValid;
};
diff --git a/cpp/include/Ice/SslRSAKeyPair.h b/cpp/include/Ice/SslRSAKeyPair.h
index 3246b5e67d4..e483d216f40 100644
--- a/cpp/include/Ice/SslRSAKeyPair.h
+++ b/cpp/include/Ice/SslRSAKeyPair.h
@@ -41,10 +41,7 @@ namespace Ssl
namespace OpenSSL
{
-using namespace std;
-using IceUtil::Shared;
-
-class RSAKeyPair : public Shared
+class ICE_API RSAKeyPair : public IceUtil::Shared
{
public:
@@ -69,19 +66,10 @@ public:
X509* getX509PublicKey() const;
private:
- // RSAKeyPair(RSA*, X509*);
RSAKeyPair(const RSAPrivateKeyPtr&, const RSAPublicKeyPtr&);
friend class RSACertificateGen;
- // void byteSeqToKey(const Ice::ByteSeq&);
- // void byteSeqToCert(const Ice::ByteSeq&);
- // void ucharToByteSeq(unsigned char*, int, Ice::ByteSeq&);
- // unsigned char* byteSeqToUChar(const Ice::ByteSeq&);
-
- // RSA* _privateKey;
- // X509* _publicKey;
-
RSAPrivateKeyPtr _privateKey;
RSAPublicKeyPtr _publicKey;
diff --git a/cpp/include/Ice/SslRSAPrivateKey.h b/cpp/include/Ice/SslRSAPrivateKey.h
index 57cfa70f2b9..5c5affbccf9 100644
--- a/cpp/include/Ice/SslRSAPrivateKey.h
+++ b/cpp/include/Ice/SslRSAPrivateKey.h
@@ -38,21 +38,15 @@ namespace Ssl
namespace OpenSSL
{
-using namespace std;
-using IceUtil::Shared;
-
-using std::string;
-using Ice::ByteSeq;
-
-class RSAPrivateKey : public Shared
+class ICE_API RSAPrivateKey : public IceUtil::Shared
{
public:
// Construction from Base64 encoding
- RSAPrivateKey(const string&);
+ RSAPrivateKey(const std::string&);
// Construction from ByteSeq
- RSAPrivateKey(const ByteSeq&);
+ RSAPrivateKey(const Ice::ByteSeq&);
// Construction from RSA Private Key structure
RSAPrivateKey(RSA*);
@@ -60,16 +54,16 @@ public:
~RSAPrivateKey();
// Conversions to Base64 encoding
- void keyToBase64(string&);
+ void keyToBase64(std::string&);
// Conversions to ByteSequence
- void keyToByteSeq(ByteSeq&);
+ void keyToByteSeq(Ice::ByteSeq&);
// Get the key structure
RSA* getRSAPrivateKey() const;
private:
- void byteSeqToKey(const ByteSeq&);
+ void byteSeqToKey(const Ice::ByteSeq&);
RSA* _privateKey;
diff --git a/cpp/include/Ice/SslRSAPublicKey.h b/cpp/include/Ice/SslRSAPublicKey.h
index 8f76d124173..59c40508f4d 100644
--- a/cpp/include/Ice/SslRSAPublicKey.h
+++ b/cpp/include/Ice/SslRSAPublicKey.h
@@ -38,38 +38,32 @@ namespace Ssl
namespace OpenSSL
{
-using namespace std;
-using IceUtil::Shared;
-
-using std::string;
-using Ice::ByteSeq;
-
-class RSAPublicKey : public Shared
+class ICE_API RSAPublicKey : public IceUtil::Shared
{
public:
// Construction from Base64 encodings
- RSAPublicKey(const string&);
+ RSAPublicKey(const std::string&);
// Construction from ByteSeq
- RSAPublicKey(const ByteSeq&);
+ RSAPublicKey(const Ice::ByteSeq&);
RSAPublicKey(X509*);
~RSAPublicKey();
// Conversions to Base64 encodings
- void certToBase64(string&);
+ void certToBase64(std::string&);
// Conversions to ByteSequences
- void certToByteSeq(ByteSeq&);
+ void certToByteSeq(Ice::ByteSeq&);
// Get the key structures
X509* getX509PublicKey() const;
private:
- void byteSeqToCert(const ByteSeq&);
+ void byteSeqToCert(const Ice::ByteSeq&);
X509* _publicKey;
diff --git a/cpp/src/Glacier/CertVerifier.cpp b/cpp/src/Glacier/CertVerifier.cpp
index f99ee3ae277..0e7e059cf16 100644
--- a/cpp/src/Glacier/CertVerifier.cpp
+++ b/cpp/src/Glacier/CertVerifier.cpp
@@ -8,7 +8,8 @@
//
// **********************************************************************
-#include <Glacier/CertVerifier.h>
+#include <Glacier/CertVerifier.h>
+#include <Ice/SslRSAPublicKey.h>
#include <openssl/err.h>
#include <algorithm>
#include <iostream>
@@ -96,9 +97,14 @@ CertVerifier::verify(int preVerifyOkay, X509_STORE_CTX* x509StoreContext, SSL* s
ByteSeq
CertVerifier::toByteSeq(X509* certificate)
-{
- ByteSeq certByteSeq;
-
+{
+ IceSecurity::Ssl::OpenSSL::RSAPublicKey publicKey(certificate);
+
+ ByteSeq certByteSeq;
+
+ publicKey.certToByteSeq(certByteSeq);
+
+/*
// Convert the X509 to a unsigned char buffer.
unsigned int certSize = i2d_X509(certificate, 0);
unsigned char* certBuffer = new unsigned char[certSize];
@@ -108,7 +114,7 @@ CertVerifier::toByteSeq(X509* certificate)
// Yet another conversion to a ByteSeq (easy comparison this way).
copy(certBuffer, (certBuffer + certSize), back_inserter(certByteSeq));
delete []certBuffer;
-
+*/
return certByteSeq;
}
diff --git a/cpp/src/Glacier/glacierrouter.dsp b/cpp/src/Glacier/glacierrouter.dsp
index c9bd22bc416..fdbb1e1b5ba 100644
--- a/cpp/src/Glacier/glacierrouter.dsp
+++ b/cpp/src/Glacier/glacierrouter.dsp
@@ -25,7 +25,7 @@ CFG=GlacierRouter - Win32 Debug
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
-CPP=xicl6.exe
+CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "GlacierRouter - Win32 Release"
@@ -49,9 +49,9 @@ RSC=rc.exe
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LINK32=xilink6.exe
+LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 /nologo /subsystem:console /machine:I386 /out:"C:\marc\ice\bin\glacier.exe" /libpath:"../../../lib"
+# ADD LINK32 libeay32.lib ssleay32.lib /nologo /subsystem:console /machine:I386 /out:"C:\marc\ice\bin\glacier.exe" /libpath:"../../../lib"
# SUBTRACT LINK32 /nodefaultlib
!ELSEIF "$(CFG)" == "GlacierRouter - Win32 Debug"
@@ -75,9 +75,9 @@ LINK32=xilink6.exe
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LINK32=xilink6.exe
+LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 /nologo /subsystem:console /debug /machine:I386 /out:"C:\marc\ice\bin\glacier.exe" /pdbtype:sept /libpath:"../../../lib"
+# ADD LINK32 libeay32.lib ssleay32.lib /nologo /subsystem:console /debug /machine:I386 /out:"C:\marc\ice\bin\glacier.exe" /pdbtype:sept /libpath:"../../../lib"
# SUBTRACT LINK32 /nodefaultlib
!ENDIF
@@ -91,6 +91,10 @@ LINK32=xilink6.exe
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
+SOURCE=.\CertVerifier.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\ClientBlobject.cpp
# End Source File
# Begin Source File
@@ -111,6 +115,10 @@ SOURCE=.\ServerBlobject.cpp
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
+SOURCE=.\CertVerifier.h
+# End Source File
+# Begin Source File
+
SOURCE=.\ClientBlobject.h
# End Source File
# Begin Source File
diff --git a/cpp/src/Ice/SslConnectionOpenSSL.cpp b/cpp/src/Ice/SslConnectionOpenSSL.cpp
index f7f5a33a4d3..90356d05045 100644
--- a/cpp/src/Ice/SslConnectionOpenSSL.cpp
+++ b/cpp/src/Ice/SslConnectionOpenSSL.cpp
@@ -105,7 +105,7 @@ IceSecurity::Ssl::OpenSSL::DefaultCertificateVerifier::verify(int preVerifyOkay,
ostringstream outStringStream;
- outStringStream << "depth = " << errorDepth << ":" << buf << endl;
+ outStringStream << "depth = " << dec << errorDepth << ":" << buf << std::endl;
if (!preVerifyOkay)
{
diff --git a/cpp/src/Ice/SslRSAKeyPair.cpp b/cpp/src/Ice/SslRSAKeyPair.cpp
index e2876ebc845..9f18a5e3af3 100644
--- a/cpp/src/Ice/SslRSAKeyPair.cpp
+++ b/cpp/src/Ice/SslRSAKeyPair.cpp
@@ -20,114 +20,47 @@ void ::IceInternal::decRef(::IceSecurity::Ssl::OpenSSL::RSAKeyPair* p) { p->__de
using std::back_inserter;
using std::string;
+using Ice::ByteSeq;
using IceUtil::Base64;
IceSecurity::Ssl::OpenSSL::RSAKeyPair::RSAKeyPair(const string& key, const string& cert) :
_privateKey(new RSAPrivateKey(key)),
_publicKey(new RSAPublicKey(cert))
{
-/*
- _privateKey = 0;
- _publicKey = 0;
-
- ByteSeq keySeq = Base64::decode(key);
- ByteSeq certSeq = Base64::decode(cert);
-
- byteSeqToKey(keySeq);
- byteSeqToCert(certSeq);
-*/
}
IceSecurity::Ssl::OpenSSL::RSAKeyPair::RSAKeyPair(const ByteSeq& keySeq, const ByteSeq& certSeq) :
_privateKey(new RSAPrivateKey(keySeq)),
_publicKey(new RSAPublicKey(certSeq))
{
-/*
- _privateKey = 0;
- _publicKey = 0;
- byteSeqToKey(keySeq);
- byteSeqToCert(certSeq);
-*/
}
IceSecurity::Ssl::OpenSSL::RSAKeyPair::~RSAKeyPair()
{
-/*
- RSA_free(_privateKey);
- X509_free(_publicKey);
-*/
}
void
IceSecurity::Ssl::OpenSSL::RSAKeyPair::keyToBase64(string& b64Key)
{
_privateKey->keyToBase64(b64Key);
-
-/*
- ByteSeq keySeq;
- keyToByteSeq(keySeq);
- b64Key = Base64::encode(keySeq);
-*/
}
void
IceSecurity::Ssl::OpenSSL::RSAKeyPair::certToBase64(string& b64Cert)
{
_publicKey->certToBase64(b64Cert);
-/*
- ByteSeq certSeq;
- certToByteSeq(certSeq);
- b64Cert = Base64::encode(certSeq);
-*/
}
void
IceSecurity::Ssl::OpenSSL::RSAKeyPair::keyToByteSeq(ByteSeq& keySeq)
{
_privateKey->keyToByteSeq(keySeq);
-/*
- assert(_privateKey);
-
- // Output the Private Key to a char buffer
- unsigned int privKeySize = i2d_RSAPrivateKey(_privateKey, 0);
-
- assert(privKeySize > 0);
-
- unsigned char* privateKeyBuffer = new unsigned char[privKeySize];
-
- // We have to do this because i2d_RSAPrivateKey changes the pointer.
- unsigned char* privKeyBuff = privateKeyBuffer;
- i2d_RSAPrivateKey(_privateKey, &privKeyBuff);
-
- ucharToByteSeq(privateKeyBuffer, privKeySize, keySeq);
-
- delete []privateKeyBuffer;
-*/
}
void
IceSecurity::Ssl::OpenSSL::RSAKeyPair::certToByteSeq(ByteSeq& certSeq)
{
_publicKey->certToByteSeq(certSeq);
-
-/*
- assert(_publicKey);
-
- // Output the Public Key to a char buffer
- unsigned int pubKeySize = i2d_X509(_publicKey, 0);
-
- assert(pubKeySize > 0);
-
- unsigned char* publicKeyBuffer = new unsigned char[pubKeySize];
-
- // We have to do this because i2d_X509_PUBKEY changes the pointer.
- unsigned char* pubKeyBuff = publicKeyBuffer;
- i2d_X509(_publicKey, &pubKeyBuff);
-
- ucharToByteSeq(publicKeyBuffer, pubKeySize, certSeq);
-
- delete []publicKeyBuffer;
-*/
}
RSA*
@@ -142,70 +75,9 @@ IceSecurity::Ssl::OpenSSL::RSAKeyPair::getX509PublicKey() const
return _publicKey->getX509PublicKey();
}
-// IceSecurity::Ssl::OpenSSL::RSAKeyPair::RSAKeyPair(RSA* rsa, X509* x509) :
-
IceSecurity::Ssl::OpenSSL::RSAKeyPair::RSAKeyPair(const RSAPrivateKeyPtr& rsa, const RSAPublicKeyPtr& x509) :
_privateKey(rsa),
_publicKey(x509)
{
}
-/*
-void
-IceSecurity::Ssl::OpenSSL::RSAKeyPair::byteSeqToKey(const ByteSeq& keySeq)
-{
- unsigned char* privateKeyBuffer = byteSeqToUChar(keySeq);
- assert(privateKeyBuffer);
-
- unsigned char* privKeyBuff = privateKeyBuffer;
- unsigned char** privKeyBuffpp = &privKeyBuff;
- RSA** rsapp = &_privateKey;
-
- _privateKey = d2i_RSAPrivateKey(rsapp, privKeyBuffpp, (long)keySeq.size());
- assert(_privateKey);
-
- delete []privateKeyBuffer;
-}
-
-void
-IceSecurity::Ssl::OpenSSL::RSAKeyPair::byteSeqToCert(const ByteSeq& certSeq)
-{
- unsigned char* publicKeyBuffer = byteSeqToUChar(certSeq);
- assert(publicKeyBuffer);
-
- // We have to do this because d2i_X509 changes the pointer.
- unsigned char* pubKeyBuff = publicKeyBuffer;
- unsigned char** pubKeyBuffpp = &pubKeyBuff;
-
- X509** x509pp = &_publicKey;
-
- _publicKey = d2i_X509(x509pp, pubKeyBuffpp, (long)certSeq.size());
- assert(_publicKey);
-
- delete []publicKeyBuffer;
-}
-
-
-void
-IceSecurity::Ssl::OpenSSL::RSAKeyPair::ucharToByteSeq(unsigned char* ucharBuffer, int length, ByteSeq& destBuffer)
-{
- destBuffer.reserve(length);
- std::copy(ucharBuffer, (ucharBuffer + length), back_inserter(destBuffer));
-}
-
-
-unsigned char*
-IceSecurity::Ssl::OpenSSL::RSAKeyPair::byteSeqToUChar(const ByteSeq& sequence)
-{
- int seqSize = sequence.size();
-
- assert(seqSize > 0);
-
- unsigned char* ucharSeq = new unsigned char[seqSize];
- unsigned char* ucharPtr = ucharSeq;
- std::copy(sequence.begin(), sequence.end(), ucharPtr);
-
- return ucharSeq;
-}
-*/
-
diff --git a/cpp/src/Ice/SslRSAPrivateKey.cpp b/cpp/src/Ice/SslRSAPrivateKey.cpp
index 2029a581a7a..6f2f3229a74 100644
--- a/cpp/src/Ice/SslRSAPrivateKey.cpp
+++ b/cpp/src/Ice/SslRSAPrivateKey.cpp
@@ -19,6 +19,7 @@ void ::IceInternal::decRef(::IceSecurity::Ssl::OpenSSL::RSAPrivateKey* p) { p->_
using std::back_inserter;
using std::string;
+using Ice::ByteSeq;
using IceUtil::Base64;
IceSecurity::Ssl::OpenSSL::RSAPrivateKey::RSAPrivateKey(const string& key)
diff --git a/cpp/src/Ice/SslRSAPublicKey.cpp b/cpp/src/Ice/SslRSAPublicKey.cpp
index 95391cc5b5c..0ff14313738 100644
--- a/cpp/src/Ice/SslRSAPublicKey.cpp
+++ b/cpp/src/Ice/SslRSAPublicKey.cpp
@@ -19,6 +19,7 @@ void ::IceInternal::decRef(::IceSecurity::Ssl::OpenSSL::RSAPublicKey* p) { p->__
using std::back_inserter;
using std::string;
+using Ice::ByteSeq;
using IceUtil::Base64;
IceSecurity::Ssl::OpenSSL::RSAPublicKey::RSAPublicKey(const string& cert)
diff --git a/cpp/src/Ice/ice.dsp b/cpp/src/Ice/ice.dsp
index 160de8c1a8d..2f7b12fbbff 100644
--- a/cpp/src/Ice/ice.dsp
+++ b/cpp/src/Ice/ice.dsp
@@ -352,6 +352,10 @@ SOURCE=.\SslGeneralConfig.cpp
# End Source File
# Begin Source File
+SOURCE=.\SslIceUtils.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\SslJanitors.cpp
# End Source File
# Begin Source File
@@ -368,6 +372,14 @@ SOURCE=.\SslRSAKeyPair.cpp
# End Source File
# Begin Source File
+SOURCE=.\SslRSAPrivateKey.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\SslRSAPublicKey.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\SslSystem.cpp
# End Source File
# Begin Source File
@@ -776,6 +788,10 @@ SOURCE=.\SecureUdp.h
# End Source File
# Begin Source File
+SOURCE=..\..\include\Ice\Security.h
+# End Source File
+# Begin Source File
+
SOURCE=..\..\include\Ice\ServantLocator.h
# End Source File
# Begin Source File
@@ -808,6 +824,10 @@ SOURCE=..\..\include\Ice\SslCertificateVerifierF.h
# End Source File
# Begin Source File
+SOURCE=..\..\include\Ice\SslCertificateVerifierOpenSSL.h
+# End Source File
+# Begin Source File
+
SOURCE=.\SslCertificateVerifierOpenSSL.h
# End Source File
# Begin Source File
@@ -852,6 +872,10 @@ SOURCE=.\SslGeneralConfig.h
# End Source File
# Begin Source File
+SOURCE=.\SslIceUtils.h
+# End Source File
+# Begin Source File
+
SOURCE=.\SslJanitors.h
# End Source File
# Begin Source File
@@ -876,6 +900,22 @@ SOURCE=..\..\include\Ice\SslRSAKeyPairF.h
# End Source File
# Begin Source File
+SOURCE=..\..\include\Ice\SslRSAPrivateKey.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\Ice\SslRSAPrivateKeyF.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\Ice\SslRSAPublicKey.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\Ice\SslRSAPublicKeyF.h
+# End Source File
+# Begin Source File
+
SOURCE=.\SslSystem.h
# End Source File
# Begin Source File
diff --git a/cpp/test/Glacier/starter/CertVerifier.cpp b/cpp/test/Glacier/starter/CertVerifier.cpp
index 1c6c2b0c46e..3b47af57f28 100644
--- a/cpp/test/Glacier/starter/CertVerifier.cpp
+++ b/cpp/test/Glacier/starter/CertVerifier.cpp
@@ -9,10 +9,10 @@
// **********************************************************************
#include <CertVerifier.h>
+#include <Ice/SslRSAPublicKey.h>
#include <openssl/err.h>
#include <algorithm>
#include <iostream>
-#include <IceUtil/Base64.h>
using namespace std;
@@ -98,18 +98,23 @@ CertVerifier::verify(int preVerifyOkay, X509_STORE_CTX* x509StoreContext, SSL* s
ByteSeq
CertVerifier::toByteSeq(X509* certificate)
{
- ByteSeq certByteSeq;
-
- // Convert the X509 to a unsigned char buffer.
- unsigned int certSize = i2d_X509(certificate, 0);
- unsigned char* certBuffer = new unsigned char[certSize];
- unsigned char* certPtr = certBuffer;
- i2d_X509(certificate, &certPtr);
-
- // Yet another conversion to a ByteSeq (easy comparison this way).
- copy(certBuffer, (certBuffer + certSize), back_inserter(certByteSeq));
- delete []certBuffer;
-
+ IceSecurity::Ssl::OpenSSL::RSAPublicKey publicKey(certificate);
+
+ ByteSeq certByteSeq;
+
+ publicKey.certToByteSeq(certByteSeq);
+
+/*
+ // Convert the X509 to a unsigned char buffer.
+ unsigned int certSize = i2d_X509(certificate, 0);
+ unsigned char* certBuffer = new unsigned char[certSize];
+ unsigned char* certPtr = certBuffer;
+ i2d_X509(certificate, &certPtr);
+
+ // Yet another conversion to a ByteSeq (easy comparison this way).
+ copy(certBuffer, (certBuffer + certSize), back_inserter(certByteSeq));
+ delete []certBuffer;
+*/
return certByteSeq;
}