reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
WinSecurity.hxx
Go to the documentation of this file.
1#if !defined(RESIP_WINSECURITY_HXX)
2#define RESIP_WINSECURITY_HXX
3
4#if defined(HAVE_CONFIG_H)
5 #include "config.h"
6#endif
7
8
10#include <wincrypt.h>
11
12namespace resip
13{
14
21class WinSecurity : public Security
22{
23 public:
24
25 typedef enum
26 {
27 ROOT_CA_STORE=1, //"ROOT": predefined system store
28 CA_STORE=2, //"CA": predefined system store
29 PRIVATE_STORE=3, //"MY": predefined system store; should store the domain certificate/private key
30 USERS_STORE=4 //"DOMAIN_USERS" (only for server):
31 //administrator-defined system store; should store the
32 //certificate/private keys for the users associated
33 //with the domain
35 //for details on certificate stores, see
36 //http://msdn.microsoft.com/en-us/library/windows/desktop/aa376539(v=vs.85).aspx
37 //http://msdn.microsoft.com/en-us/library/windows/desktop/aa386971(v=vs.85).aspx
38
40 const Data& defaultPrivateKeyPassPhrase = Data::Empty,
41 const Data& dHParamsFilename = Data::Empty) :
42 Security(cipherList, defaultPrivateKeyPassPhrase, dHParamsFilename) {}
43 WinSecurity(const Data& pathToCerts,
44 const CipherList& cipherList = ExportableSuite,
45 const Data & defaultPrivateKeyPassPhrase = Data::Empty,
46 const Data & dHParamsFilename = Data::Empty) :
47 Security(pathToCerts, cipherList, defaultPrivateKeyPassPhrase, dHParamsFilename) {}
48
49 virtual void preload();
50 virtual void onReadPEM(const Data& name, PEMType type, Data& buffer) const;
51 virtual void onWritePEM(const Data& name, PEMType type, const Data& buffer) const;
52 virtual void onRemovePEM(const Data& name, PEMType type) const;
53
54
55 protected:
56 HCERTSTORE openSystemCertStore(const Data& name);
57 void getCerts(MsCertStoreType eType);
59 void closeCertifStore(HCERTSTORE);
60};
61
62}
63#endif
64
65/* ====================================================================
66 * The Vovida Software License, Version 1.0
67 *
68 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
69 *
70 * Redistribution and use in source and binary forms, with or without
71 * modification, are permitted provided that the following conditions
72 * are met:
73 *
74 * 1. Redistributions of source code must retain the above copyright
75 * notice, this list of conditions and the following disclaimer.
76 *
77 * 2. Redistributions in binary form must reproduce the above copyright
78 * notice, this list of conditions and the following disclaimer in
79 * the documentation and/or other materials provided with the
80 * distribution.
81 *
82 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
83 * and "Vovida Open Communication Application Library (VOCAL)" must
84 * not be used to endorse or promote products derived from this
85 * software without prior written permission. For written
86 * permission, please contact vocal@vovida.org.
87 *
88 * 4. Products derived from this software may not be called "VOCAL", nor
89 * may "VOCAL" appear in their name, without prior written
90 * permission of Vovida Networks, Inc.
91 *
92 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
93 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
94 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
95 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
96 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
97 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
98 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
99 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
100 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
101 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
102 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
103 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
104 * DAMAGE.
105 *
106 * ====================================================================
107 *
108 * This software consists of voluntary contributions made by Vovida
109 * Networks, Inc. and many individuals on behalf of Vovida Networks,
110 * Inc. For more information on Vovida Networks, Inc., please see
111 * <http://www.vovida.org/>.
112 *
113 */
static CipherList ExportableSuite
Definition Security.hxx:80
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
static const Data Empty
Constant that represents a zero-length data.
Definition Data.hxx:882
WARNING - This class is only appropriate for client TLS connections, as it only loads root certs.
virtual void preload()
void getCredentials(MsCertStoreType eType)
void closeCertifStore(HCERTSTORE)
virtual void onRemovePEM(const Data &name, PEMType type) const
void getCerts(MsCertStoreType eType)
WinSecurity(const Data &pathToCerts, const CipherList &cipherList=ExportableSuite, const Data &defaultPrivateKeyPassPhrase=Data::Empty, const Data &dHParamsFilename=Data::Empty)
virtual void onWritePEM(const Data &name, PEMType type, const Data &buffer) const
virtual void onReadPEM(const Data &name, PEMType type, Data &buffer) const
HCERTSTORE openSystemCertStore(const Data &name)
WinSecurity(const CipherList &cipherList=ExportableSuite, const Data &defaultPrivateKeyPassPhrase=Data::Empty, const Data &dHParamsFilename=Data::Empty)
dcm! – add UnusedChecking(_enum) below;