1 /*---------------------------------------------------------------------------* 2 Project: Horizon 3 File: ssl_ClientCert.h 4 Copyright (C)2009 Nintendo Co., Ltd. All rights reserved. 5 These coded instructions, statements, and computer programs contain 6 proprietary information of Nintendo of America Inc. and/or Nintendo 7 Company Ltd., and are protected by Federal copyright law. They may 8 not be disclosed to third parties or copied or duplicated in any form, 9 in whole or in part, without the prior written consent of Nintendo. 10 $Rev: 31762 $ 11 *--------------------------------------------------------------------------- 12 13 14 */ 15 16 #ifndef NN_SSL_SSL_CLIENTCERT_H_ 17 #define NN_SSL_SSL_CLIENTCERT_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 */ 33 class ClientCert : private nn::util::NonCopyable<ClientCert> 34 { 35 friend class Connection; 36 public: 37 /* Please see man pages for details 38 39 */ 40 explicit ClientCert(); 41 42 /* Please see man pages for details 43 44 */ 45 virtual ~ClientCert (void); 46 47 /* Please see man pages for details 48 49 50 51 52 53 54 55 56 57 58 */ 59 nn::Result Initialize(const u8* pCertData, size_t certDataSize, const u8* pPrivateKeyData, size_t privateKeyDataSize); 60 61 /* Please see man pages for details 62 63 64 65 66 67 68 69 */ 70 nn::Result Initialize(InternalClientCert inClientCertName); 71 72 /* Please see man pages for details 73 74 75 76 77 78 */ 79 nn::Result Finalize(void); 80 81 /* Please see man pages for details 82 83 84 */ GetID(void)85 CertId GetID(void){return m_certId;} 86 87 private: 88 bool m_isInitialized; 89 NN_PADDING3; 90 CertId m_certId; 91 92 /* Please see man pages for details 93 94 95 */ IsValid()96 bool IsValid(){return m_isInitialized;} 97 }; 98 99 } // end of namespace ssl 100 } // end of namespace nn 101 102 #endif // __cplusplus 103 104 105 #include <nn/util/detail/util_CLibImpl.h> 106 107 108 /* Please see man pages for details 109 110 111 112 113 114 115 116 117 */ 118 119 /* Please see man pages for details 120 121 122 123 124 */ 125 NN_UTIL_DETAIL_CLIBIMPL_DEFINE_BUFFER_CLASS(nnsslClientCert, nn::ssl::ClientCert, 12, u32); 126 127 /* Please see man pages for details 128 129 */ 130 NN_EXTERN_C nnResult nnsslClientCertInitialize(nnsslClientCert* this_, const u8* pCertData, size_t certDataSize, const u8* pPrivateKeyData, size_t privateKeyDataSize); 131 132 /* Please see man pages for details 133 134 */ 135 NN_EXTERN_C nnResult nnsslClientCertInitByInternalCert(nnsslClientCert* this_, NnSslInternalClientCert inClientCertName); 136 137 138 /* Please see man pages for details 139 140 */ 141 NN_EXTERN_C nnResult nnsslClientCertFinalize(nnsslClientCert* this_); 142 143 144 /* 145 146 147 148 */ 149 150 #endif /* NN_SSL_SSL_CLIENTCERT_H_ */ 151 152