1 /*---------------------------------------------------------------------------* 2 Project: Horizon 3 File: http_CertStore.h 4 5 Copyright (C)2010 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_HTTP_HTTP_CERTSTORE_H_ 17 #define NN_HTTP_HTTP_CERTSTORE_H_ 18 19 #include <nn/util/util_NonCopyable.h> 20 #include <nn/http/http_Types.h> 21 22 #ifdef __cplusplus 23 24 namespace nn { 25 namespace http { 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 nn::Result Finalize(void); 63 64 /* Please see man pages for details 65 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 */ 89 nn::Result RegisterCert(InternalCaCertId inCaCertName, CertId* pCertIdCourier=NULL); 90 91 /* Please see man pages for details 92 93 94 95 96 97 98 99 */ 100 nn::Result UnRegisterCert(CertId certId); 101 102 103 104 private: 105 bool m_isInitialized; 106 NN_PADDING3; 107 CertStoreId m_certStoreId; 108 109 /* Please see man pages for details 110 111 112 */ IsValid()113 bool IsValid(){return m_isInitialized;} 114 }; 115 116 } // end of namespace http 117 } // end of namespace nn 118 119 #endif // __cplusplus 120 121 122 #include <nn/util/detail/util_CLibImpl.h> 123 124 125 /* Please see man pages for details 126 127 128 129 130 131 132 133 134 */ 135 136 /* Please see man pages for details 137 138 139 140 141 */ 142 NN_UTIL_DETAIL_CLIBIMPL_DEFINE_BUFFER_CLASS(nnhttpCertStore, nn::http::CertStore, 12, u32); 143 144 /* Please see man pages for details 145 146 */ 147 NN_EXTERN_C nnResult nnhttpCertStoreInitialize(nnhttpCertStore* this_); 148 149 /* Please see man pages for details 150 151 */ 152 NN_EXTERN_C nnResult nnhttpCertStoreFinalize(nnhttpCertStore* this_); 153 154 /* Please see man pages for details 155 156 */ 157 NN_EXTERN_C nnResult nnhttpCertStoreRegisterCert(nnhttpCertStore* this_, const u8* pCertData, size_t certDataSize, NnHttpCertId* pCertIdCourier); 158 159 /* Please see man pages for details 160 161 */ 162 NN_EXTERN_C nnResult nnhttpCertStoreRegisterInternalCert(nnhttpCertStore* this_, NnHttpInternalCaCertId inCaCertName, NnHttpCertId* pCertIdCourier); 163 164 165 /* Please see man pages for details 166 167 */ 168 NN_EXTERN_C nnResult nnhttpCertStoreUnRegisterCert(nnhttpCertStore* this_, NnHttpCertId certId); 169 170 171 /* 172 173 174 175 */ 176 177 #endif /* NN_HTTP_HTTP_CERTSTORE_H_ */ 178