1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     ssl_CertStore.h
4 
5   Copyright (C)2009 Nintendo Co., Ltd.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law. They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Rev: 38552 $
14  *---------------------------------------------------------------------------*/
15 
16 #ifndef NN_SSL_SSL_CERTSTORE_H_
17 #define NN_SSL_SSL_CERTSTORE_H_
18 
19 #include <nn/util/util_NonCopyable.h>
20 #include <nn/ssl/ssl_Types.h>
21 
22 #ifdef __cplusplus
23 
24 namespace nn {
25 namespace ssl {
26 
27 class Connection;
28 
29 /* Please see man pages for details
30 
31 */
32 class CertStore : private nn::util::NonCopyable<CertStore>
33 {
34     friend class Connection;
35 public:
36     /* Please see man pages for details
37 
38     */
39     explicit CertStore();
40 
41     /* Please see man pages for details
42 
43     */
44     virtual ~CertStore (void);
45 
46     /* Please see man pages for details
47 
48 
49 
50 
51 
52     */
53     nn::Result Initialize(void);
54 
55     /* Please see man pages for details
56 
57 
58 
59 
60 
61 
62     */
63     nn::Result Finalize(void);
64 
65     /* Please see man pages for details
66 
67 
68 
69 
70 
71 
72 
73 
74 
75     */
76     nn::Result RegisterCert(const u8* pCertData, size_t certDataSize, CertId* pCertIdCourier=NULL);
77 
78     /* Please see man pages for details
79 
80 
81 
82 
83 
84 
85 
86 
87     */
88     nn::Result RegisterCert(InternalCaCert inCaCertName, CertId* pCertIdCourier=NULL);
89 
90     /* Please see man pages for details
91 
92 
93 
94 
95 
96 
97 
98     */
99     nn::Result UnRegisterCert(CertId certId);
100 
101     /* Please see man pages for details
102 
103 
104     */
GetID(void)105     CertStoreId GetID(void){return m_certStoreId;}
106 
107 
108 private:
109     bool m_isInitialized;
110     NN_PADDING3;
111     CertStoreId m_certStoreId;
112 
113     /* Please see man pages for details
114 
115 
116     */
IsValid()117     bool IsValid(){return m_isInitialized;}
118 };
119 
120 } // end of namespace ssl
121 } // end of namespace nn
122 
123 #endif // __cplusplus
124 
125 
126 #include <nn/util/detail/util_CLibImpl.h>
127 
128 
129 /* Please see man pages for details
130 
131 
132 
133 
134 
135 
136 
137 
138 */
139 
140 /* Please see man pages for details
141 
142 
143 
144 
145 */
146 NN_UTIL_DETAIL_CLIBIMPL_DEFINE_BUFFER_CLASS(nnsslCertStore, nn::ssl::CertStore, 12, u32);
147 
148 /* Please see man pages for details
149 
150 */
151 NN_EXTERN_C nnResult nnsslCertStoreInitialize(nnsslCertStore* this_);
152 
153 /* Please see man pages for details
154 
155 */
156 NN_EXTERN_C nnResult nnsslCertStoreFinalize(nnsslCertStore* this_);
157 
158 /* Please see man pages for details
159 
160 */
161 NN_EXTERN_C nnResult nnsslCertStoreRegisterCert(nnsslCertStore* this_, const u8* pCertData, size_t certDataSize, NnSslCertId* pCertIdCourier);
162 
163 /* Please see man pages for details
164 
165 */
166 NN_EXTERN_C nnResult nnsslCertStoreRegistByInternalCert(nnsslCertStore* this_, NnSslInternalCaCert inCaCertName);
167 
168 
169 
170 /* Please see man pages for details
171 
172 */
173 NN_EXTERN_C nnResult nnsslCertStoreUnRegisterCert(nnsslCertStore* this_,  NnSslCertId certId);
174 
175 
176 /*
177 
178 
179 
180 */
181 
182 #endif /* NN_SSL_SSL_CERTSTORE_H_ */
183