#include <cert_wrapper.hpp>
Collaboration diagram for yaSSL::CertManager:

Definition at line 74 of file cert_wrapper.hpp.
typedef mySTL::list<x509*> yaSSL::CertManager::CertList [private] |
Definition at line 75 of file cert_wrapper.hpp.
| yaSSL::CertManager::CertManager | ( | ) |
Definition at line 98 of file cert_wrapper.cpp.
00099 : peerX509_(0), verifyPeer_(false), verifyNone_(false), failNoCert_(false), 00100 sendVerify_(false) 00101 {}
| yaSSL::CertManager::~CertManager | ( | ) |
Definition at line 104 of file cert_wrapper.cpp.
References mySTL::list< T >::begin(), mySTL::list< T >::end(), mySTL::for_each(), list_, peerList_, peerX509_, signers_, and yaSSL::ysDelete().
00105 { 00106 ysDelete(peerX509_); 00107 00108 mySTL::for_each(signers_.begin(), signers_.end(), del_ptr_zero()) ; 00109 00110 mySTL::for_each(peerList_.begin(), peerList_.end(), del_ptr_zero()) ; 00111 00112 mySTL::for_each(list_.begin(), list_.end(), del_ptr_zero()) ; 00113 }
Here is the call graph for this function:

| yaSSL::CertManager::CertManager | ( | const CertManager & | ) | [private] |
| void yaSSL::CertManager::AddPeerCert | ( | x509 * | x | ) |
Definition at line 164 of file cert_wrapper.cpp.
References peerList_, mySTL::list< T >::push_back(), and x.
Referenced by yaSSL::Certificate::Process().
Here is the call graph for this function:

Here is the caller graph for this function:

| int yaSSL::CertManager::CopyCaCert | ( | const x509 * | x | ) |
Definition at line 178 of file cert_wrapper.cpp.
References TaoCrypt::CertDecoder::CA, cert, key, NEW_YS, signers_, verifyNone_, and x.
Referenced by yaSSL::SSL::SSL().
00179 { 00180 TaoCrypt::Source source(x->get_buffer(), x->get_length()); 00181 TaoCrypt::CertDecoder cert(source, true, &signers_, verifyNone_, 00182 TaoCrypt::CertDecoder::CA); 00183 00184 if (!cert.GetError().What()) { 00185 const TaoCrypt::PublicKey& key = cert.GetPublicKey(); 00186 signers_.push_back(NEW_YS TaoCrypt::Signer(key.GetKey(), key.size(), 00187 cert.GetCommonName(), cert.GetHash())); 00188 } 00189 // just don't add, not an error return cert.GetError().What(); 00190 return 0; 00191 }
Here is the caller graph for this function:

| void yaSSL::CertManager::CopySelfCert | ( | const x509 * | x | ) |
Definition at line 170 of file cert_wrapper.cpp.
References list_, NEW_YS, mySTL::list< T >::push_back(), and x.
Referenced by yaSSL::SSL::SSL().
Here is the call graph for this function:

Here is the caller graph for this function:

| bool yaSSL::CertManager::failNoCert | ( | ) | const |
Definition at line 128 of file cert_wrapper.cpp.
References failNoCert_.
00129 { 00130 return failNoCert_; 00131 }
| const x509 * yaSSL::CertManager::get_cert | ( | ) | const |
Definition at line 194 of file cert_wrapper.cpp.
References mySTL::list< T >::front(), and list_.
Referenced by yaSSL::CertificateRequest::Process(), and yaSSL::sendCertificate().
Here is the call graph for this function:

Here is the caller graph for this function:

| SignatureAlgorithm yaSSL::CertManager::get_keyType | ( | ) | const |
Definition at line 218 of file cert_wrapper.cpp.
References keyType_.
00219 { 00220 return keyType_; 00221 }
| const opaque * yaSSL::CertManager::get_peerKey | ( | ) | const |
Definition at line 200 of file cert_wrapper.cpp.
References yaSSL::input_buffer::get_buffer(), and peerPublicKey_.
00201 { 00202 return peerPublicKey_.get_buffer(); 00203 }
Here is the call graph for this function:

| uint yaSSL::CertManager::get_peerKeyLength | ( | ) | const |
Definition at line 224 of file cert_wrapper.cpp.
References yaSSL::input_buffer::get_size(), and peerPublicKey_.
00225 { 00226 return peerPublicKey_.get_size(); 00227 }
Here is the call graph for this function:

| SignatureAlgorithm yaSSL::CertManager::get_peerKeyType | ( | ) | const |
Definition at line 212 of file cert_wrapper.cpp.
References peerKeyType_.
00213 { 00214 return peerKeyType_; 00215 }
| X509 * yaSSL::CertManager::get_peerX509 | ( | ) | const |
Definition at line 206 of file cert_wrapper.cpp.
References peerX509_.
Referenced by yaSSL::SSL_get_peer_certificate().
00207 { 00208 return peerX509_; 00209 }
Here is the caller graph for this function:

| const opaque * yaSSL::CertManager::get_privateKey | ( | ) | const |
Definition at line 230 of file cert_wrapper.cpp.
References yaSSL::input_buffer::get_buffer(), and privateKey_.
Referenced by yaSSL::CertificateRequest::Process().
00231 { 00232 return privateKey_.get_buffer(); 00233 }
Here is the call graph for this function:

Here is the caller graph for this function:

| uint yaSSL::CertManager::get_privateKeyLength | ( | ) | const |
Definition at line 236 of file cert_wrapper.cpp.
References yaSSL::input_buffer::get_size(), and privateKey_.
00237 { 00238 return privateKey_.get_size(); 00239 }
Here is the call graph for this function:

| CertManager& yaSSL::CertManager::operator= | ( | const CertManager & | ) | [private] |
| bool yaSSL::CertManager::sendVerify | ( | ) | const |
Definition at line 134 of file cert_wrapper.cpp.
References sendVerify_.
Referenced by yaSSL::SSL_connect().
00135 { 00136 return sendVerify_; 00137 }
Here is the caller graph for this function:

| void yaSSL::CertManager::setFailNoCert | ( | ) |
Definition at line 152 of file cert_wrapper.cpp.
References failNoCert_.
Referenced by yaSSL::SSL::SSL().
00153 { 00154 failNoCert_ = true; 00155 }
Here is the caller graph for this function:

| int yaSSL::CertManager::SetPrivateKey | ( | const x509 & | ) |
Definition at line 292 of file cert_wrapper.cpp.
References yaSSL::input_buffer::allocate(), yaSSL::input_buffer::assign(), cert, TaoCrypt::CertDecoder::DecodeToKey(), yaSSL::dsa_sa_algo, err, mySTL::list< T >::front(), TaoCrypt::BER_Decoder::GetError(), TaoCrypt::CertDecoder::GetKeyType(), key, keyType_, list_, privateKey_, yaSSL::rsa_sa_algo, and TaoCrypt::RSAk.
Referenced by yaSSL::SSL::SSL().
00293 { 00294 privateKey_.allocate(key.get_length()); 00295 privateKey_.assign(key.get_buffer(), key.get_length()); 00296 00297 // set key type 00298 if (x509* cert = list_.front()) { 00299 TaoCrypt::Source source(cert->get_buffer(), cert->get_length()); 00300 TaoCrypt::CertDecoder cd(source, false); 00301 cd.DecodeToKey(); 00302 if (int err = cd.GetError().What()) 00303 return err; 00304 if (cd.GetKeyType() == TaoCrypt::RSAk) 00305 keyType_ = rsa_sa_algo; 00306 else 00307 keyType_ = dsa_sa_algo; 00308 } 00309 return 0; 00310 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void yaSSL::CertManager::setSendVerify | ( | ) |
Definition at line 158 of file cert_wrapper.cpp.
References sendVerify_.
Referenced by yaSSL::CertificateRequest::Process().
00159 { 00160 sendVerify_ = true; 00161 }
Here is the caller graph for this function:

| void yaSSL::CertManager::setVerifyNone | ( | ) |
Definition at line 146 of file cert_wrapper.cpp.
References verifyNone_.
Referenced by yaSSL::SSL::SSL().
00147 { 00148 verifyNone_ = true; 00149 }
Here is the caller graph for this function:

| void yaSSL::CertManager::setVerifyPeer | ( | ) |
Definition at line 140 of file cert_wrapper.cpp.
References verifyPeer_.
Referenced by yaSSL::SSL::SSL().
00141 { 00142 verifyPeer_ = true; 00143 }
Here is the caller graph for this function:

| int yaSSL::CertManager::Validate | ( | ) |
Definition at line 243 of file cert_wrapper.cpp.
References yaSSL::input_buffer::allocate(), yaSSL::input_buffer::assign(), cert, count, yaSSL::dsa_sa_algo, err, key, NEW_YS, peerKeyType_, peerList_, peerPublicKey_, peerX509_, mySTL::list< T >::rbegin(), yaSSL::rsa_sa_algo, TaoCrypt::RSAk, signers_, mySTL::list< T >::size(), strlen(), and verifyNone_.
Referenced by yaSSL::Certificate::Process().
00244 { 00245 CertList::iterator last = peerList_.rbegin(); // fix this 00246 int count = peerList_.size(); 00247 00248 while ( count > 1 ) { 00249 TaoCrypt::Source source((*last)->get_buffer(), (*last)->get_length()); 00250 TaoCrypt::CertDecoder cert(source, true, &signers_, verifyNone_); 00251 00252 if (int err = cert.GetError().What()) 00253 return err; 00254 00255 const TaoCrypt::PublicKey& key = cert.GetPublicKey(); 00256 signers_.push_back(NEW_YS TaoCrypt::Signer(key.GetKey(), key.size(), 00257 cert.GetCommonName(), cert.GetHash())); 00258 --last; 00259 --count; 00260 } 00261 00262 if (count) { 00263 // peer's is at the front 00264 TaoCrypt::Source source((*last)->get_buffer(), (*last)->get_length()); 00265 TaoCrypt::CertDecoder cert(source, true, &signers_, verifyNone_); 00266 00267 if (int err = cert.GetError().What()) 00268 return err; 00269 00270 uint sz = cert.GetPublicKey().size(); 00271 peerPublicKey_.allocate(sz); 00272 peerPublicKey_.assign(cert.GetPublicKey().GetKey(), sz); 00273 00274 if (cert.GetKeyType() == TaoCrypt::RSAk) 00275 peerKeyType_ = rsa_sa_algo; 00276 else 00277 peerKeyType_ = dsa_sa_algo; 00278 00279 int iSz = strlen(cert.GetIssuer()) + 1; 00280 int sSz = strlen(cert.GetCommonName()) + 1; 00281 int bSz = strlen(cert.GetBeforeDate()) + 1; 00282 int aSz = strlen(cert.GetAfterDate()) + 1; 00283 peerX509_ = NEW_YS X509(cert.GetIssuer(), iSz, cert.GetCommonName(), 00284 sSz, cert.GetBeforeDate(), bSz, 00285 cert.GetAfterDate(), aSz); 00286 } 00287 return 0; 00288 }
Here is the call graph for this function:

Here is the caller graph for this function:

| bool yaSSL::CertManager::verifyNone | ( | ) | const |
Definition at line 122 of file cert_wrapper.cpp.
References verifyNone_.
00123 { 00124 return verifyNone_; 00125 }
| bool yaSSL::CertManager::verifyPeer | ( | ) | const |
Definition at line 116 of file cert_wrapper.cpp.
References verifyPeer_.
Referenced by yaSSL::SSL_accept().
00117 { 00118 return verifyPeer_; 00119 }
Here is the caller graph for this function:

bool yaSSL::CertManager::failNoCert_ [private] |
CertList yaSSL::CertManager::list_ [private] |
Definition at line 77 of file cert_wrapper.hpp.
Referenced by CopySelfCert(), get_cert(), SetPrivateKey(), and ~CertManager().
CertList yaSSL::CertManager::peerList_ [private] |
Definition at line 80 of file cert_wrapper.hpp.
Referenced by AddPeerCert(), Validate(), and ~CertManager().
Definition at line 81 of file cert_wrapper.hpp.
Referenced by get_peerKey(), get_peerKeyLength(), and Validate().
X509* yaSSL::CertManager::peerX509_ [private] |
Definition at line 82 of file cert_wrapper.hpp.
Referenced by get_peerX509(), Validate(), and ~CertManager().
input_buffer yaSSL::CertManager::privateKey_ [private] |
Definition at line 78 of file cert_wrapper.hpp.
Referenced by get_privateKey(), get_privateKeyLength(), and SetPrivateKey().
bool yaSSL::CertManager::sendVerify_ [private] |
SignerList yaSSL::CertManager::signers_ [private] |
Definition at line 87 of file cert_wrapper.hpp.
Referenced by CopyCaCert(), Validate(), and ~CertManager().
bool yaSSL::CertManager::verifyNone_ [private] |
Definition at line 90 of file cert_wrapper.hpp.
Referenced by CopyCaCert(), setVerifyNone(), Validate(), and verifyNone().
bool yaSSL::CertManager::verifyPeer_ [private] |
1.4.7

