@@ -118,6 +118,8 @@ public struct unitytls_tlsctx {}
118
118
[ StructLayout ( LayoutKind . Sequential ) ]
119
119
public struct unitytls_tlsctx_ref { public UInt64 handle ; }
120
120
121
+ public struct unitytls_x509name { }
122
+
121
123
public enum unitytls_ciphersuite : UInt32
122
124
{
123
125
// With exception of the INVALID value, this enum represents an IANA cipher ID.
@@ -142,6 +144,7 @@ public struct unitytls_tlsctx_protocolrange
142
144
public delegate size_t unitytls_tlsctx_write_callback ( void * userData , UInt8 * data , size_t bufferLen , unitytls_errorstate * errorState ) ;
143
145
public delegate size_t unitytls_tlsctx_read_callback ( void * userData , UInt8 * buffer , size_t bufferLen , unitytls_errorstate * errorState ) ;
144
146
public delegate void unitytls_tlsctx_trace_callback ( void * userData , unitytls_tlsctx * ctx , Int8 * traceMessage , size_t traceMessageLen ) ;
147
+ public delegate void unitytls_tlsctx_certificate_callback ( void * userData , unitytls_tlsctx * ctx , Int8 * cn , size_t cnLen , unitytls_x509name * caList , size_t caListLen , unitytls_x509list_ref * chain , unitytls_key_ref * key , unitytls_errorstate * errorState ) ;
145
148
public delegate unitytls_x509verify_result unitytls_tlsctx_x509verify_callback ( void * userData , unitytls_x509list_ref chain , unitytls_errorstate * errorState ) ;
146
149
147
150
[ StructLayout ( LayoutKind . Sequential ) ]
@@ -165,61 +168,65 @@ public class mono_unity_unitytls_interface
165
168
{
166
169
public readonly UInt64 UNITYTLS_INVALID_HANDLE ;
167
170
168
- public delegate unitytls_errorstate unitytls_errorstate_create_t ( ) ;
169
- public unitytls_errorstate_create_t unitytls_errorstate_create ;
170
- public delegate void unitytls_errorstate_raise_error_t ( unitytls_errorstate * errorState , unitytls_error_code errorCode ) ;
171
- public unitytls_errorstate_raise_error_t unitytls_errorstate_raise_error ;
172
-
173
- public delegate unitytls_key_ref unitytls_key_get_ref_t ( unitytls_key * key , unitytls_errorstate * errorState ) ;
174
- public unitytls_key_get_ref_t unitytls_key_get_ref ;
175
- public delegate unitytls_key * unitytls_key_parse_der_t ( UInt8 * buffer , size_t bufferLen , UInt8 * password , size_t passwordLen , unitytls_errorstate * errorState ) ;
176
- public unitytls_key_parse_der_t unitytls_key_parse_der ;
177
- public delegate void unitytls_key_free_t ( unitytls_key * key ) ;
178
- public unitytls_key_free_t unitytls_key_free ;
179
-
180
- public delegate size_t unitytls_x509_export_der_t ( unitytls_x509_ref cert , UInt8 * buffer , size_t bufferLen , unitytls_errorstate * errorState ) ;
181
- public unitytls_x509_export_der_t unitytls_x509_export_der ;
182
-
183
- public delegate unitytls_x509list_ref unitytls_x509list_get_ref_t ( unitytls_x509list * list , unitytls_errorstate * errorState ) ;
184
- public unitytls_x509list_get_ref_t unitytls_x509list_get_ref ;
185
- public delegate unitytls_x509_ref unitytls_x509list_get_x509_t ( unitytls_x509list_ref list , size_t index , unitytls_errorstate * errorState ) ;
186
- public unitytls_x509list_get_x509_t unitytls_x509list_get_x509 ;
187
- public delegate unitytls_x509list * unitytls_x509list_create_t ( unitytls_errorstate * errorState ) ;
188
- public unitytls_x509list_create_t unitytls_x509list_create ;
189
- public delegate void unitytls_x509list_append_t ( unitytls_x509list * list , unitytls_x509_ref cert , unitytls_errorstate * errorState ) ;
190
- public unitytls_x509list_append_t unitytls_x509list_append ;
191
- public delegate void unitytls_x509list_append_der_t ( unitytls_x509list * list , UInt8 * buffer , size_t bufferLen , unitytls_errorstate * errorState ) ;
192
- public unitytls_x509list_append_der_t unitytls_x509list_append_der ;
193
- public delegate void unitytls_x509list_free_t ( unitytls_x509list * list ) ;
194
- public unitytls_x509list_free_t unitytls_x509list_free ;
195
-
196
- public delegate unitytls_x509verify_result unitytls_x509verify_default_ca_t ( unitytls_x509list_ref chain , Int8 * cn , size_t cnLen , unitytls_x509verify_callback cb , void * userData , unitytls_errorstate * errorState ) ;
197
- public unitytls_x509verify_default_ca_t unitytls_x509verify_default_ca ;
198
- public delegate unitytls_x509verify_result unitytls_x509verify_explicit_ca_t ( unitytls_x509list_ref chain , unitytls_x509list_ref trustCA , Int8 * cn , size_t cnLen , unitytls_x509verify_callback cb , void * userData , unitytls_errorstate * errorState ) ;
199
- public unitytls_x509verify_explicit_ca_t unitytls_x509verify_explicit_ca ;
200
-
201
- public delegate unitytls_tlsctx * unitytls_tlsctx_create_server_t ( unitytls_tlsctx_protocolrange supportedProtocols , unitytls_tlsctx_callbacks callbacks , unitytls_x509list_ref certChain , unitytls_key_ref leafCertificateKey , unitytls_errorstate * errorState ) ;
202
- public unitytls_tlsctx_create_server_t unitytls_tlsctx_create_server ;
203
- public delegate unitytls_tlsctx * unitytls_tlsctx_create_client_t ( unitytls_tlsctx_protocolrange supportedProtocols , unitytls_tlsctx_callbacks callbacks , Int8 * cn , size_t cnLen , unitytls_errorstate * errorState ) ;
204
- public unitytls_tlsctx_create_client_t unitytls_tlsctx_create_client ;
205
- public delegate void unitytls_tlsctx_set_trace_callback_t ( unitytls_tlsctx * ctx , unitytls_tlsctx_trace_callback cb , void * userData , unitytls_errorstate * errorState ) ;
206
- public unitytls_tlsctx_set_trace_callback_t unitytls_tlsctx_set_trace_callback ;
207
- public delegate void unitytls_tlsctx_set_x509verify_callback_t ( unitytls_tlsctx * ctx , unitytls_tlsctx_x509verify_callback cb , void * userData , unitytls_errorstate * errorState ) ;
208
- public unitytls_tlsctx_set_x509verify_callback_t unitytls_tlsctx_set_x509verify_callback ;
209
- public delegate void unitytls_tlsctx_set_supported_ciphersuites_t ( unitytls_tlsctx * ctx , unitytls_ciphersuite * supportedCiphersuites , size_t supportedCiphersuitesLen , unitytls_errorstate * errorState ) ;
210
- public unitytls_tlsctx_set_supported_ciphersuites_t unitytls_tlsctx_set_supported_ciphersuites ;
211
- public delegate unitytls_ciphersuite unitytls_tlsctx_get_ciphersuite_t ( unitytls_tlsctx * ctx , unitytls_errorstate * errorState ) ;
212
- public unitytls_tlsctx_get_ciphersuite_t unitytls_tlsctx_get_ciphersuite ;
213
- public delegate unitytls_protocol unitytls_tlsctx_get_protocol_t ( unitytls_tlsctx * ctx , unitytls_errorstate * errorState ) ;
214
- public unitytls_tlsctx_get_protocol_t unitytls_tlsctx_get_protocol ;
215
- public delegate unitytls_x509verify_result unitytls_tlsctx_process_handshake_t ( unitytls_tlsctx * ctx , unitytls_errorstate * errorState ) ;
216
- public unitytls_tlsctx_process_handshake_t unitytls_tlsctx_process_handshake ;
217
- public delegate size_t unitytls_tlsctx_read_t ( unitytls_tlsctx * ctx , UInt8 * buffer , size_t bufferLen , unitytls_errorstate * errorState ) ;
218
- public unitytls_tlsctx_read_t unitytls_tlsctx_read ;
219
- public delegate size_t unitytls_tlsctx_write_t ( unitytls_tlsctx * ctx , UInt8 * data , size_t bufferLen , unitytls_errorstate * errorState ) ;
220
- public unitytls_tlsctx_write_t unitytls_tlsctx_write ;
221
- public delegate void unitytls_tlsctx_free_t ( unitytls_tlsctx * ctx ) ;
222
- public unitytls_tlsctx_free_t unitytls_tlsctx_free ;
171
+ public delegate unitytls_errorstate unitytls_errorstate_create_t ( ) ;
172
+ public unitytls_errorstate_create_t unitytls_errorstate_create ;
173
+ public delegate void unitytls_errorstate_raise_error_t ( unitytls_errorstate * errorState , unitytls_error_code errorCode ) ;
174
+ public unitytls_errorstate_raise_error_t unitytls_errorstate_raise_error ;
175
+
176
+ public delegate unitytls_key_ref unitytls_key_get_ref_t ( unitytls_key * key , unitytls_errorstate * errorState ) ;
177
+ public unitytls_key_get_ref_t unitytls_key_get_ref ;
178
+ public delegate unitytls_key * unitytls_key_parse_der_t ( UInt8 * buffer , size_t bufferLen , UInt8 * password , size_t passwordLen , unitytls_errorstate * errorState ) ;
179
+ public unitytls_key_parse_der_t unitytls_key_parse_der ;
180
+ public delegate void unitytls_key_free_t ( unitytls_key * key ) ;
181
+ public unitytls_key_free_t unitytls_key_free ;
182
+
183
+ public delegate size_t unitytls_x509_export_der_t ( unitytls_x509_ref cert , UInt8 * buffer , size_t bufferLen , unitytls_errorstate * errorState ) ;
184
+ public unitytls_x509_export_der_t unitytls_x509_export_der ;
185
+
186
+ public delegate unitytls_x509list_ref unitytls_x509list_get_ref_t ( unitytls_x509list * list , unitytls_errorstate * errorState ) ;
187
+ public unitytls_x509list_get_ref_t unitytls_x509list_get_ref ;
188
+ public delegate unitytls_x509_ref unitytls_x509list_get_x509_t ( unitytls_x509list_ref list , size_t index , unitytls_errorstate * errorState ) ;
189
+ public unitytls_x509list_get_x509_t unitytls_x509list_get_x509 ;
190
+ public delegate unitytls_x509list * unitytls_x509list_create_t ( unitytls_errorstate * errorState ) ;
191
+ public unitytls_x509list_create_t unitytls_x509list_create ;
192
+ public delegate void unitytls_x509list_append_t ( unitytls_x509list * list , unitytls_x509_ref cert , unitytls_errorstate * errorState ) ;
193
+ public unitytls_x509list_append_t unitytls_x509list_append ;
194
+ public delegate void unitytls_x509list_append_der_t ( unitytls_x509list * list , UInt8 * buffer , size_t bufferLen , unitytls_errorstate * errorState ) ;
195
+ public unitytls_x509list_append_der_t unitytls_x509list_append_der ;
196
+ public delegate void unitytls_x509list_free_t ( unitytls_x509list * list ) ;
197
+ public unitytls_x509list_free_t unitytls_x509list_free ;
198
+
199
+ public delegate unitytls_x509verify_result unitytls_x509verify_default_ca_t ( unitytls_x509list_ref chain , Int8 * cn , size_t cnLen , unitytls_x509verify_callback cb , void * userData , unitytls_errorstate * errorState ) ;
200
+ public unitytls_x509verify_default_ca_t unitytls_x509verify_default_ca ;
201
+ public delegate unitytls_x509verify_result unitytls_x509verify_explicit_ca_t ( unitytls_x509list_ref chain , unitytls_x509list_ref trustCA , Int8 * cn , size_t cnLen , unitytls_x509verify_callback cb , void * userData , unitytls_errorstate * errorState ) ;
202
+ public unitytls_x509verify_explicit_ca_t unitytls_x509verify_explicit_ca ;
203
+
204
+ public delegate unitytls_tlsctx * unitytls_tlsctx_create_server_t ( unitytls_tlsctx_protocolrange supportedProtocols , unitytls_tlsctx_callbacks callbacks , unitytls_x509list_ref certChain , unitytls_key_ref leafCertificateKey , unitytls_errorstate * errorState ) ;
205
+ public unitytls_tlsctx_create_server_t unitytls_tlsctx_create_server ;
206
+ public delegate unitytls_tlsctx * unitytls_tlsctx_create_client_t ( unitytls_tlsctx_protocolrange supportedProtocols , unitytls_tlsctx_callbacks callbacks , Int8 * cn , size_t cnLen , unitytls_errorstate * errorState ) ;
207
+ public unitytls_tlsctx_create_client_t unitytls_tlsctx_create_client ;
208
+ public delegate void unitytls_tlsctx_server_require_client_authentication_t ( unitytls_tlsctx * ctx , unitytls_x509list_ref clientAuthCAList , unitytls_errorstate * errorState ) ;
209
+ public unitytls_tlsctx_server_require_client_authentication_t unitytls_tlsctx_server_require_client_authentication ;
210
+ public delegate void unitytls_tlsctx_set_certificate_callback_t ( unitytls_tlsctx * ctx , unitytls_tlsctx_certificate_callback cb , void * userData , unitytls_errorstate * errorState ) ;
211
+ public unitytls_tlsctx_set_certificate_callback_t unitytls_tlsctx_set_certificate_callback ;
212
+ public delegate void unitytls_tlsctx_set_trace_callback_t ( unitytls_tlsctx * ctx , unitytls_tlsctx_trace_callback cb , void * userData , unitytls_errorstate * errorState ) ;
213
+ public unitytls_tlsctx_set_trace_callback_t unitytls_tlsctx_set_trace_callback ;
214
+ public delegate void unitytls_tlsctx_set_x509verify_callback_t ( unitytls_tlsctx * ctx , unitytls_tlsctx_x509verify_callback cb , void * userData , unitytls_errorstate * errorState ) ;
215
+ public unitytls_tlsctx_set_x509verify_callback_t unitytls_tlsctx_set_x509verify_callback ;
216
+ public delegate void unitytls_tlsctx_set_supported_ciphersuites_t ( unitytls_tlsctx * ctx , unitytls_ciphersuite * supportedCiphersuites , size_t supportedCiphersuitesLen , unitytls_errorstate * errorState ) ;
217
+ public unitytls_tlsctx_set_supported_ciphersuites_t unitytls_tlsctx_set_supported_ciphersuites ;
218
+ public delegate unitytls_ciphersuite unitytls_tlsctx_get_ciphersuite_t ( unitytls_tlsctx * ctx , unitytls_errorstate * errorState ) ;
219
+ public unitytls_tlsctx_get_ciphersuite_t unitytls_tlsctx_get_ciphersuite ;
220
+ public delegate unitytls_protocol unitytls_tlsctx_get_protocol_t ( unitytls_tlsctx * ctx , unitytls_errorstate * errorState ) ;
221
+ public unitytls_tlsctx_get_protocol_t unitytls_tlsctx_get_protocol ;
222
+ public delegate unitytls_x509verify_result unitytls_tlsctx_process_handshake_t ( unitytls_tlsctx * ctx , unitytls_errorstate * errorState ) ;
223
+ public unitytls_tlsctx_process_handshake_t unitytls_tlsctx_process_handshake ;
224
+ public delegate size_t unitytls_tlsctx_read_t ( unitytls_tlsctx * ctx , UInt8 * buffer , size_t bufferLen , unitytls_errorstate * errorState ) ;
225
+ public unitytls_tlsctx_read_t unitytls_tlsctx_read ;
226
+ public delegate size_t unitytls_tlsctx_write_t ( unitytls_tlsctx * ctx , UInt8 * data , size_t bufferLen , unitytls_errorstate * errorState ) ;
227
+ public unitytls_tlsctx_write_t unitytls_tlsctx_write ;
228
+ public delegate void unitytls_tlsctx_free_t ( unitytls_tlsctx * ctx ) ;
229
+ public unitytls_tlsctx_free_t unitytls_tlsctx_free ;
223
230
}
224
231
225
232
[ DllImport ( "__Internal" ) ]
0 commit comments