Class: Protocol::QUIC::TLS::Context
- Inherits:
-
Object
- Object
- Protocol::QUIC::TLS::Context
show all
- Defined in:
- ext/source/Ruby/Protocol/QUIC/TLS/Context.cpp
Instance Method Summary
collapse
Constructor Details
#initialize ⇒ Object
50
51
52
53
54
|
# File 'ext/source/Ruby/Protocol/QUIC/TLS/Context.cpp', line 50
static VALUE Ruby_Protocol_QUIC_TLS_Context_initialize(VALUE self) {
DATA_PTR(self) = new ::Protocol::QUIC::TLS::Context();
return self;
}
|
Instance Method Details
#add_protocol(name) ⇒ Object
56
57
58
59
60
61
62
63
64
65
66
67
|
# File 'ext/source/Ruby/Protocol/QUIC/TLS/Context.cpp', line 56
static VALUE Ruby_Protocol_QUIC_TLS_Context_add_protocol(VALUE self, VALUE name) {
StringValue(name);
::Protocol::QUIC::TLS::Context *tls_context;
TypedData_Get_Struct(self, ::Protocol::QUIC::TLS::Context, &Ruby_Protocol_QUIC_TLS_Context_type, tls_context);
tls_context->add_protocol(
std::string(RSTRING_PTR(name), RSTRING_LEN(name))
);
return self;
}
|
#load_certificate_file(path) ⇒ Object
69
70
71
72
73
74
75
76
|
# File 'ext/source/Ruby/Protocol/QUIC/TLS/Context.cpp', line 69
static VALUE Ruby_Protocol_QUIC_TLS_Context_load_certificate_file(VALUE self, VALUE path) {
StringValue(path);
auto tls_context = Ruby_Protocol_QUIC_TLS_Context_get(self);
tls_context->load_certificate_file(RSTRING_PTR(path));
return self;
}
|
#load_private_key_file(path) ⇒ Object
78
79
80
81
82
83
84
85
|
# File 'ext/source/Ruby/Protocol/QUIC/TLS/Context.cpp', line 78
static VALUE Ruby_Protocol_QUIC_TLS_Context_load_private_key_file(VALUE self, VALUE path) {
StringValue(path);
auto tls_context = Ruby_Protocol_QUIC_TLS_Context_get(self);
tls_context->load_private_key_file(RSTRING_PTR(path));
return self;
}
|
#protocols ⇒ Object
87
88
89
90
91
92
93
94
95
96
97
98
|
# File 'ext/source/Ruby/Protocol/QUIC/TLS/Context.cpp', line 87
static VALUE Ruby_Protocol_QUIC_TLS_Context_protocols(VALUE self) {
::Protocol::QUIC::TLS::Context *tls_context;
TypedData_Get_Struct(self, ::Protocol::QUIC::TLS::Context, &Ruby_Protocol_QUIC_TLS_Context_type, tls_context);
VALUE protocols = rb_ary_new();
for (auto & protocol : tls_context->protocols()) {
rb_ary_push(protocols, rb_str_new(protocol.data(), protocol.size()));
}
return protocols;
}
|