ruby-paseto 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +8 -0
- data/CODE_OF_CONDUCT.md +84 -0
- data/LICENSE.txt +21 -0
- data/README.md +549 -0
- data/lib/paseto/asn1/algorithm_identifier.rb +17 -0
- data/lib/paseto/asn1/curve_private_key.rb +22 -0
- data/lib/paseto/asn1/ec_private_key.rb +27 -0
- data/lib/paseto/asn1/ecdsa_full_r.rb +26 -0
- data/lib/paseto/asn1/ecdsa_sig_value.rb +23 -0
- data/lib/paseto/asn1/ecdsa_signature.rb +49 -0
- data/lib/paseto/asn1/ed25519_identifier.rb +15 -0
- data/lib/paseto/asn1/named_curve.rb +17 -0
- data/lib/paseto/asn1/one_asymmetric_key.rb +32 -0
- data/lib/paseto/asn1/private_key.rb +17 -0
- data/lib/paseto/asn1/private_key_algorithm_identifier.rb +17 -0
- data/lib/paseto/asn1/public_key.rb +17 -0
- data/lib/paseto/asn1/subject_public_key_info.rb +28 -0
- data/lib/paseto/asn1.rb +101 -0
- data/lib/paseto/asymmetric_key.rb +100 -0
- data/lib/paseto/configuration/box.rb +23 -0
- data/lib/paseto/configuration/decode_configuration.rb +68 -0
- data/lib/paseto/configuration.rb +18 -0
- data/lib/paseto/interface/i_d.rb +23 -0
- data/lib/paseto/interface/key.rb +113 -0
- data/lib/paseto/interface/pbkd.rb +83 -0
- data/lib/paseto/interface/pie.rb +59 -0
- data/lib/paseto/interface/pke.rb +86 -0
- data/lib/paseto/interface/serializer.rb +19 -0
- data/lib/paseto/interface/version.rb +161 -0
- data/lib/paseto/interface/wrapper.rb +20 -0
- data/lib/paseto/operations/i_d.rb +48 -0
- data/lib/paseto/operations/id/i_dv3.rb +20 -0
- data/lib/paseto/operations/id/i_dv4.rb +20 -0
- data/lib/paseto/operations/pbkd/p_b_k_dv3.rb +85 -0
- data/lib/paseto/operations/pbkd/p_b_k_dv4.rb +94 -0
- data/lib/paseto/operations/pbkw.rb +73 -0
- data/lib/paseto/operations/pke/p_k_ev3.rb +97 -0
- data/lib/paseto/operations/pke/p_k_ev4.rb +95 -0
- data/lib/paseto/operations/pke.rb +57 -0
- data/lib/paseto/operations/wrap.rb +29 -0
- data/lib/paseto/paserk.rb +55 -0
- data/lib/paseto/paserk_types.rb +46 -0
- data/lib/paseto/protocol/version3.rb +100 -0
- data/lib/paseto/protocol/version4.rb +99 -0
- data/lib/paseto/result.rb +9 -0
- data/lib/paseto/serializer/optional_json.rb +30 -0
- data/lib/paseto/serializer/raw.rb +23 -0
- data/lib/paseto/sodium/curve_25519.rb +46 -0
- data/lib/paseto/sodium/safe_ed25519_loader.rb +19 -0
- data/lib/paseto/sodium/stream/base.rb +82 -0
- data/lib/paseto/sodium/stream/x_cha_cha20_xor.rb +31 -0
- data/lib/paseto/sodium.rb +5 -0
- data/lib/paseto/symmetric_key.rb +119 -0
- data/lib/paseto/token.rb +127 -0
- data/lib/paseto/token_types.rb +29 -0
- data/lib/paseto/util.rb +105 -0
- data/lib/paseto/v3/local.rb +63 -0
- data/lib/paseto/v3/public.rb +204 -0
- data/lib/paseto/v4/local.rb +56 -0
- data/lib/paseto/v4/public.rb +169 -0
- data/lib/paseto/validator.rb +154 -0
- data/lib/paseto/verifiers/footer.rb +30 -0
- data/lib/paseto/verifiers/payload.rb +42 -0
- data/lib/paseto/verify.rb +48 -0
- data/lib/paseto/version.rb +6 -0
- data/lib/paseto/versions.rb +25 -0
- data/lib/paseto/wrappers/pie/pie_v3.rb +72 -0
- data/lib/paseto/wrappers/pie/pie_v4.rb +72 -0
- data/lib/paseto/wrappers/pie.rb +71 -0
- data/lib/paseto.rb +99 -0
- data/paseto.gemspec +58 -0
- data/sorbet/config +3 -0
- data/sorbet/rbi/annotations/rainbow.rbi +269 -0
- data/sorbet/rbi/gems/ast@2.4.2.rbi +584 -0
- data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +1083 -0
- data/sorbet/rbi/gems/docile@1.4.0.rbi +376 -0
- data/sorbet/rbi/gems/ffi@1.15.5.rbi +1994 -0
- data/sorbet/rbi/gems/io-console@0.5.11.rbi +8 -0
- data/sorbet/rbi/gems/irb@1.5.1.rbi +342 -0
- data/sorbet/rbi/gems/json@2.6.3.rbi +1541 -0
- data/sorbet/rbi/gems/multi_json@1.15.0.rbi +267 -0
- data/sorbet/rbi/gems/netrc@0.11.0.rbi +158 -0
- data/sorbet/rbi/gems/oj@3.13.23.rbi +603 -0
- data/sorbet/rbi/gems/openssl@3.0.1.rbi +1735 -0
- data/sorbet/rbi/gems/parallel@1.22.1.rbi +277 -0
- data/sorbet/rbi/gems/rainbow@3.1.1.rbi +407 -0
- data/sorbet/rbi/gems/rake@13.0.6.rbi +3021 -0
- data/sorbet/rbi/gems/rbnacl@7.1.1.rbi +3218 -0
- data/sorbet/rbi/gems/regexp_parser@2.6.1.rbi +3481 -0
- data/sorbet/rbi/gems/reline@0.3.1.rbi +8 -0
- data/sorbet/rbi/gems/rexml@3.2.5.rbi +4717 -0
- data/sorbet/rbi/gems/rspec-core@3.12.0.rbi +10887 -0
- data/sorbet/rbi/gems/rspec-expectations@3.12.0.rbi +8090 -0
- data/sorbet/rbi/gems/rspec-mocks@3.12.0.rbi +5300 -0
- data/sorbet/rbi/gems/rspec-support@3.12.0.rbi +1617 -0
- data/sorbet/rbi/gems/rspec@3.12.0.rbi +88 -0
- data/sorbet/rbi/gems/ruby-progressbar@1.11.0.rbi +1239 -0
- data/sorbet/rbi/gems/simplecov-html@0.12.3.rbi +219 -0
- data/sorbet/rbi/gems/simplecov@0.21.2.rbi +2135 -0
- data/sorbet/rbi/gems/simplecov_json_formatter@0.1.4.rbi +8 -0
- data/sorbet/rbi/gems/thor@1.2.1.rbi +3956 -0
- data/sorbet/rbi/gems/timecop@0.9.6.rbi +350 -0
- data/sorbet/rbi/gems/unicode-display_width@2.3.0.rbi +48 -0
- data/sorbet/rbi/gems/webrick@1.7.0.rbi +2555 -0
- data/sorbet/rbi/gems/yard-sorbet@0.7.0.rbi +391 -0
- data/sorbet/rbi/gems/yard@0.9.28.rbi +17816 -0
- data/sorbet/rbi/gems/zeitwerk@2.6.6.rbi +950 -0
- data/sorbet/rbi/shims/multi_json.rbi +19 -0
- data/sorbet/rbi/shims/openssl.rbi +111 -0
- data/sorbet/rbi/shims/rbnacl.rbi +65 -0
- data/sorbet/rbi/shims/zeitwerk.rbi +6 -0
- data/sorbet/rbi/todo.rbi +7 -0
- data/sorbet/tapioca/config.yml +30 -0
- data/sorbet/tapioca/require.rb +12 -0
- metadata +376 -0
@@ -0,0 +1,1735 @@
|
|
1
|
+
# typed: false
|
2
|
+
|
3
|
+
# DO NOT EDIT MANUALLY
|
4
|
+
# This is an autogenerated file for types exported from the `openssl` gem.
|
5
|
+
# Please instead update this file by running `bin/tapioca gem openssl`.
|
6
|
+
|
7
|
+
# --
|
8
|
+
# Add double dispatch to Integer
|
9
|
+
# ++
|
10
|
+
class Integer < ::Numeric
|
11
|
+
# Casts an Integer as an OpenSSL::BN
|
12
|
+
#
|
13
|
+
# See `man bn` for more info.
|
14
|
+
#
|
15
|
+
# source://openssl//openssl/bn.rb#37
|
16
|
+
def to_bn; end
|
17
|
+
end
|
18
|
+
|
19
|
+
Integer::GMP_VERSION = T.let(T.unsafe(nil), String)
|
20
|
+
|
21
|
+
module OpenSSL
|
22
|
+
private
|
23
|
+
|
24
|
+
# Returns a Digest subclass by _name_
|
25
|
+
#
|
26
|
+
# require 'openssl'
|
27
|
+
#
|
28
|
+
# OpenSSL::Digest("MD5")
|
29
|
+
# # => OpenSSL::Digest::MD5
|
30
|
+
#
|
31
|
+
# Digest("Foo")
|
32
|
+
# # => NameError: wrong constant name Foo
|
33
|
+
#
|
34
|
+
# source://openssl//openssl/digest.rb#67
|
35
|
+
def Digest(name); end
|
36
|
+
|
37
|
+
class << self
|
38
|
+
# Returns a Digest subclass by _name_
|
39
|
+
#
|
40
|
+
# require 'openssl'
|
41
|
+
#
|
42
|
+
# OpenSSL::Digest("MD5")
|
43
|
+
# # => OpenSSL::Digest::MD5
|
44
|
+
#
|
45
|
+
# Digest("Foo")
|
46
|
+
# # => NameError: wrong constant name Foo
|
47
|
+
#
|
48
|
+
# source://openssl//openssl/digest.rb#67
|
49
|
+
def Digest(name); end
|
50
|
+
|
51
|
+
# call-seq:
|
52
|
+
# OpenSSL.secure_compare(string, string) -> boolean
|
53
|
+
#
|
54
|
+
# Constant time memory comparison. Inputs are hashed using SHA-256 to mask
|
55
|
+
# the length of the secret. Returns +true+ if the strings are identical,
|
56
|
+
# +false+ otherwise.
|
57
|
+
#
|
58
|
+
# source://openssl//openssl.rb#32
|
59
|
+
def secure_compare(a, b); end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
class OpenSSL::BN
|
64
|
+
include ::Comparable
|
65
|
+
|
66
|
+
# source://openssl//openssl/bn.rb#20
|
67
|
+
def pretty_print(q); end
|
68
|
+
end
|
69
|
+
|
70
|
+
OpenSSL::BN::CONSTTIME = T.let(T.unsafe(nil), Integer)
|
71
|
+
|
72
|
+
# OpenSSL IO buffering mix-in module.
|
73
|
+
#
|
74
|
+
# This module allows an OpenSSL::SSL::SSLSocket to behave like an IO.
|
75
|
+
#
|
76
|
+
# You typically won't use this module directly, you can see it implemented in
|
77
|
+
# OpenSSL::SSL::SSLSocket.
|
78
|
+
module OpenSSL::Buffering
|
79
|
+
include ::Enumerable
|
80
|
+
|
81
|
+
# Creates an instance of OpenSSL's buffering IO module.
|
82
|
+
#
|
83
|
+
# source://openssl//openssl/buffering.rb#63
|
84
|
+
def initialize(*_arg0); end
|
85
|
+
|
86
|
+
# Writes _s_ to the stream. _s_ will be converted to a String using
|
87
|
+
# +.to_s+ method.
|
88
|
+
#
|
89
|
+
# source://openssl//openssl/buffering.rb#422
|
90
|
+
def <<(s); end
|
91
|
+
|
92
|
+
# Closes the SSLSocket and flushes any unwritten data.
|
93
|
+
#
|
94
|
+
# source://openssl//openssl/buffering.rb#483
|
95
|
+
def close; end
|
96
|
+
|
97
|
+
# Executes the block for every line in the stream where lines are separated
|
98
|
+
# by _eol_.
|
99
|
+
#
|
100
|
+
# See also #gets
|
101
|
+
#
|
102
|
+
# source://openssl//openssl/buffering.rb#259
|
103
|
+
def each(eol = T.unsafe(nil)); end
|
104
|
+
|
105
|
+
# Calls the given block once for each byte in the stream.
|
106
|
+
#
|
107
|
+
# source://openssl//openssl/buffering.rb#300
|
108
|
+
def each_byte; end
|
109
|
+
|
110
|
+
# Executes the block for every line in the stream where lines are separated
|
111
|
+
# by _eol_.
|
112
|
+
#
|
113
|
+
# See also #gets
|
114
|
+
#
|
115
|
+
# source://openssl//openssl/buffering.rb#259
|
116
|
+
def each_line(eol = T.unsafe(nil)); end
|
117
|
+
|
118
|
+
# Returns true if the stream is at file which means there is no more data to
|
119
|
+
# be read.
|
120
|
+
#
|
121
|
+
# @return [Boolean]
|
122
|
+
#
|
123
|
+
# source://openssl//openssl/buffering.rb#331
|
124
|
+
def eof; end
|
125
|
+
|
126
|
+
# Returns true if the stream is at file which means there is no more data to
|
127
|
+
# be read.
|
128
|
+
#
|
129
|
+
# @return [Boolean]
|
130
|
+
#
|
131
|
+
# source://openssl//openssl/buffering.rb#331
|
132
|
+
def eof?; end
|
133
|
+
|
134
|
+
# Flushes buffered data to the SSLSocket.
|
135
|
+
#
|
136
|
+
# source://openssl//openssl/buffering.rb#471
|
137
|
+
def flush; end
|
138
|
+
|
139
|
+
# call-seq:
|
140
|
+
# ssl.getbyte => 81
|
141
|
+
#
|
142
|
+
# Get the next 8bit byte from `ssl`. Returns `nil` on EOF
|
143
|
+
#
|
144
|
+
# source://openssl//openssl/buffering.rb#108
|
145
|
+
def getbyte; end
|
146
|
+
|
147
|
+
# Reads one character from the stream. Returns nil if called at end of
|
148
|
+
# file.
|
149
|
+
#
|
150
|
+
# source://openssl//openssl/buffering.rb#293
|
151
|
+
def getc; end
|
152
|
+
|
153
|
+
# Reads the next "line" from the stream. Lines are separated by _eol_. If
|
154
|
+
# _limit_ is provided the result will not be longer than the given number of
|
155
|
+
# bytes.
|
156
|
+
#
|
157
|
+
# _eol_ may be a String or Regexp.
|
158
|
+
#
|
159
|
+
# Unlike IO#gets the line read will not be assigned to +$_+.
|
160
|
+
#
|
161
|
+
# Unlike IO#gets the separator must be provided if a limit is provided.
|
162
|
+
#
|
163
|
+
# source://openssl//openssl/buffering.rb#235
|
164
|
+
def gets(eol = T.unsafe(nil), limit = T.unsafe(nil)); end
|
165
|
+
|
166
|
+
# Writes _args_ to the stream.
|
167
|
+
#
|
168
|
+
# See IO#print for full details.
|
169
|
+
#
|
170
|
+
# source://openssl//openssl/buffering.rb#450
|
171
|
+
def print(*args); end
|
172
|
+
|
173
|
+
# Formats and writes to the stream converting parameters under control of
|
174
|
+
# the format string.
|
175
|
+
#
|
176
|
+
# See Kernel#sprintf for format string details.
|
177
|
+
#
|
178
|
+
# source://openssl//openssl/buffering.rb#463
|
179
|
+
def printf(s, *args); end
|
180
|
+
|
181
|
+
# Writes _args_ to the stream along with a record separator.
|
182
|
+
#
|
183
|
+
# See IO#puts for full details.
|
184
|
+
#
|
185
|
+
# source://openssl//openssl/buffering.rb#432
|
186
|
+
def puts(*args); end
|
187
|
+
|
188
|
+
# Reads _size_ bytes from the stream. If _buf_ is provided it must
|
189
|
+
# reference a string which will receive the data.
|
190
|
+
#
|
191
|
+
# See IO#read for full details.
|
192
|
+
#
|
193
|
+
# source://openssl//openssl/buffering.rb#119
|
194
|
+
def read(size = T.unsafe(nil), buf = T.unsafe(nil)); end
|
195
|
+
|
196
|
+
# Reads at most _maxlen_ bytes in the non-blocking manner.
|
197
|
+
#
|
198
|
+
# When no data can be read without blocking it raises
|
199
|
+
# OpenSSL::SSL::SSLError extended by IO::WaitReadable or IO::WaitWritable.
|
200
|
+
#
|
201
|
+
# IO::WaitReadable means SSL needs to read internally so read_nonblock
|
202
|
+
# should be called again when the underlying IO is readable.
|
203
|
+
#
|
204
|
+
# IO::WaitWritable means SSL needs to write internally so read_nonblock
|
205
|
+
# should be called again after the underlying IO is writable.
|
206
|
+
#
|
207
|
+
# OpenSSL::Buffering#read_nonblock needs two rescue clause as follows:
|
208
|
+
#
|
209
|
+
# # emulates blocking read (readpartial).
|
210
|
+
# begin
|
211
|
+
# result = ssl.read_nonblock(maxlen)
|
212
|
+
# rescue IO::WaitReadable
|
213
|
+
# IO.select([io])
|
214
|
+
# retry
|
215
|
+
# rescue IO::WaitWritable
|
216
|
+
# IO.select(nil, [io])
|
217
|
+
# retry
|
218
|
+
# end
|
219
|
+
#
|
220
|
+
# Note that one reason that read_nonblock writes to the underlying IO is
|
221
|
+
# when the peer requests a new TLS/SSL handshake. See openssl the FAQ for
|
222
|
+
# more details. http://www.openssl.org/support/faq.html
|
223
|
+
#
|
224
|
+
# By specifying a keyword argument _exception_ to +false+, you can indicate
|
225
|
+
# that read_nonblock should not raise an IO::Wait*able exception, but
|
226
|
+
# return the symbol +:wait_writable+ or +:wait_readable+ instead. At EOF,
|
227
|
+
# it will return +nil+ instead of raising EOFError.
|
228
|
+
#
|
229
|
+
# source://openssl//openssl/buffering.rb#204
|
230
|
+
def read_nonblock(maxlen, buf = T.unsafe(nil), exception: T.unsafe(nil)); end
|
231
|
+
|
232
|
+
# Reads a one-character string from the stream. Raises an EOFError at end
|
233
|
+
# of file.
|
234
|
+
#
|
235
|
+
# @raise [EOFError]
|
236
|
+
#
|
237
|
+
# source://openssl//openssl/buffering.rb#310
|
238
|
+
def readchar; end
|
239
|
+
|
240
|
+
# Reads a line from the stream which is separated by _eol_.
|
241
|
+
#
|
242
|
+
# Raises EOFError if at end of file.
|
243
|
+
#
|
244
|
+
# @raise [EOFError]
|
245
|
+
#
|
246
|
+
# source://openssl//openssl/buffering.rb#284
|
247
|
+
def readline(eol = T.unsafe(nil)); end
|
248
|
+
|
249
|
+
# Reads lines from the stream which are separated by _eol_.
|
250
|
+
#
|
251
|
+
# See also #gets
|
252
|
+
#
|
253
|
+
# source://openssl//openssl/buffering.rb#271
|
254
|
+
def readlines(eol = T.unsafe(nil)); end
|
255
|
+
|
256
|
+
# Reads at most _maxlen_ bytes from the stream. If _buf_ is provided it
|
257
|
+
# must reference a string which will receive the data.
|
258
|
+
#
|
259
|
+
# See IO#readpartial for full details.
|
260
|
+
#
|
261
|
+
# source://openssl//openssl/buffering.rb#146
|
262
|
+
def readpartial(maxlen, buf = T.unsafe(nil)); end
|
263
|
+
|
264
|
+
# The "sync mode" of the SSLSocket.
|
265
|
+
#
|
266
|
+
# See IO#sync for full details.
|
267
|
+
#
|
268
|
+
# source://openssl//openssl/buffering.rb#53
|
269
|
+
def sync; end
|
270
|
+
|
271
|
+
# The "sync mode" of the SSLSocket.
|
272
|
+
#
|
273
|
+
# See IO#sync for full details.
|
274
|
+
#
|
275
|
+
# source://openssl//openssl/buffering.rb#53
|
276
|
+
def sync=(_arg0); end
|
277
|
+
|
278
|
+
# Pushes character _c_ back onto the stream such that a subsequent buffered
|
279
|
+
# character read will return it.
|
280
|
+
#
|
281
|
+
# Unlike IO#getc multiple bytes may be pushed back onto the stream.
|
282
|
+
#
|
283
|
+
# Has no effect on unbuffered reads (such as #sysread).
|
284
|
+
#
|
285
|
+
# source://openssl//openssl/buffering.rb#323
|
286
|
+
def ungetc(c); end
|
287
|
+
|
288
|
+
# Writes _s_ to the stream. If the argument is not a String it will be
|
289
|
+
# converted using +.to_s+ method. Returns the number of bytes written.
|
290
|
+
#
|
291
|
+
# source://openssl//openssl/buffering.rb#369
|
292
|
+
def write(*s); end
|
293
|
+
|
294
|
+
# Writes _s_ in the non-blocking manner.
|
295
|
+
#
|
296
|
+
# If there is buffered data, it is flushed first. This may block.
|
297
|
+
#
|
298
|
+
# write_nonblock returns number of bytes written to the SSL connection.
|
299
|
+
#
|
300
|
+
# When no data can be written without blocking it raises
|
301
|
+
# OpenSSL::SSL::SSLError extended by IO::WaitReadable or IO::WaitWritable.
|
302
|
+
#
|
303
|
+
# IO::WaitReadable means SSL needs to read internally so write_nonblock
|
304
|
+
# should be called again after the underlying IO is readable.
|
305
|
+
#
|
306
|
+
# IO::WaitWritable means SSL needs to write internally so write_nonblock
|
307
|
+
# should be called again after underlying IO is writable.
|
308
|
+
#
|
309
|
+
# So OpenSSL::Buffering#write_nonblock needs two rescue clause as follows.
|
310
|
+
#
|
311
|
+
# # emulates blocking write.
|
312
|
+
# begin
|
313
|
+
# result = ssl.write_nonblock(str)
|
314
|
+
# rescue IO::WaitReadable
|
315
|
+
# IO.select([io])
|
316
|
+
# retry
|
317
|
+
# rescue IO::WaitWritable
|
318
|
+
# IO.select(nil, [io])
|
319
|
+
# retry
|
320
|
+
# end
|
321
|
+
#
|
322
|
+
# Note that one reason that write_nonblock reads from the underlying IO
|
323
|
+
# is when the peer requests a new TLS/SSL handshake. See the openssl FAQ
|
324
|
+
# for more details. http://www.openssl.org/support/faq.html
|
325
|
+
#
|
326
|
+
# By specifying a keyword argument _exception_ to +false+, you can indicate
|
327
|
+
# that write_nonblock should not raise an IO::Wait*able exception, but
|
328
|
+
# return the symbol +:wait_writable+ or +:wait_readable+ instead.
|
329
|
+
#
|
330
|
+
# source://openssl//openssl/buffering.rb#413
|
331
|
+
def write_nonblock(s, exception: T.unsafe(nil)); end
|
332
|
+
|
333
|
+
private
|
334
|
+
|
335
|
+
# Consumes _size_ bytes from the buffer
|
336
|
+
#
|
337
|
+
# source://openssl//openssl/buffering.rb#91
|
338
|
+
def consume_rbuff(size = T.unsafe(nil)); end
|
339
|
+
|
340
|
+
# Writes _s_ to the buffer. When the buffer is full or #sync is true the
|
341
|
+
# buffer is flushed to the underlying socket.
|
342
|
+
#
|
343
|
+
# source://openssl//openssl/buffering.rb#346
|
344
|
+
def do_write(s); end
|
345
|
+
|
346
|
+
# Fills the buffer from the underlying SSLSocket
|
347
|
+
#
|
348
|
+
# source://openssl//openssl/buffering.rb#78
|
349
|
+
def fill_rbuff; end
|
350
|
+
end
|
351
|
+
|
352
|
+
# A buffer which will retain binary encoding.
|
353
|
+
class OpenSSL::Buffering::Buffer < ::String
|
354
|
+
# @return [Buffer] a new instance of Buffer
|
355
|
+
#
|
356
|
+
# source://openssl//openssl/buffering.rb#29
|
357
|
+
def initialize; end
|
358
|
+
|
359
|
+
# source://openssl//openssl/buffering.rb#35
|
360
|
+
def <<(string); end
|
361
|
+
|
362
|
+
# source://openssl//openssl/buffering.rb#35
|
363
|
+
def concat(string); end
|
364
|
+
end
|
365
|
+
|
366
|
+
# source://openssl//openssl/buffering.rb#27
|
367
|
+
OpenSSL::Buffering::Buffer::BINARY = T.let(T.unsafe(nil), Encoding)
|
368
|
+
|
369
|
+
class OpenSSL::Cipher
|
370
|
+
# call-seq:
|
371
|
+
# cipher.random_iv -> iv
|
372
|
+
#
|
373
|
+
# Generate a random IV with OpenSSL::Random.random_bytes and sets it to the
|
374
|
+
# cipher, and returns it.
|
375
|
+
#
|
376
|
+
# You must call #encrypt or #decrypt before calling this method.
|
377
|
+
#
|
378
|
+
# source://openssl//openssl/cipher.rb#55
|
379
|
+
def random_iv; end
|
380
|
+
|
381
|
+
# call-seq:
|
382
|
+
# cipher.random_key -> key
|
383
|
+
#
|
384
|
+
# Generate a random key with OpenSSL::Random.random_bytes and sets it to
|
385
|
+
# the cipher, and returns it.
|
386
|
+
#
|
387
|
+
# You must call #encrypt or #decrypt before calling this method.
|
388
|
+
#
|
389
|
+
# source://openssl//openssl/cipher.rb#43
|
390
|
+
def random_key; end
|
391
|
+
end
|
392
|
+
|
393
|
+
class OpenSSL::Cipher::AES < ::OpenSSL::Cipher
|
394
|
+
# source://openssl//openssl/cipher.rb#19
|
395
|
+
def initialize(*args); end
|
396
|
+
end
|
397
|
+
|
398
|
+
class OpenSSL::Cipher::AES128 < ::OpenSSL::Cipher
|
399
|
+
# source://openssl//openssl/cipher.rb#29
|
400
|
+
def initialize(mode = T.unsafe(nil)); end
|
401
|
+
end
|
402
|
+
|
403
|
+
class OpenSSL::Cipher::AES192 < ::OpenSSL::Cipher
|
404
|
+
# source://openssl//openssl/cipher.rb#29
|
405
|
+
def initialize(mode = T.unsafe(nil)); end
|
406
|
+
end
|
407
|
+
|
408
|
+
class OpenSSL::Cipher::AES256 < ::OpenSSL::Cipher
|
409
|
+
# source://openssl//openssl/cipher.rb#29
|
410
|
+
def initialize(mode = T.unsafe(nil)); end
|
411
|
+
end
|
412
|
+
|
413
|
+
class OpenSSL::Cipher::BF < ::OpenSSL::Cipher
|
414
|
+
# source://openssl//openssl/cipher.rb#19
|
415
|
+
def initialize(*args); end
|
416
|
+
end
|
417
|
+
|
418
|
+
class OpenSSL::Cipher::CAST5 < ::OpenSSL::Cipher
|
419
|
+
# source://openssl//openssl/cipher.rb#19
|
420
|
+
def initialize(*args); end
|
421
|
+
end
|
422
|
+
|
423
|
+
# Deprecated.
|
424
|
+
#
|
425
|
+
# This class is only provided for backwards compatibility.
|
426
|
+
# Use OpenSSL::Cipher.
|
427
|
+
class OpenSSL::Cipher::Cipher < ::OpenSSL::Cipher; end
|
428
|
+
|
429
|
+
class OpenSSL::Cipher::DES < ::OpenSSL::Cipher
|
430
|
+
# source://openssl//openssl/cipher.rb#19
|
431
|
+
def initialize(*args); end
|
432
|
+
end
|
433
|
+
|
434
|
+
class OpenSSL::Cipher::IDEA < ::OpenSSL::Cipher
|
435
|
+
# source://openssl//openssl/cipher.rb#19
|
436
|
+
def initialize(*args); end
|
437
|
+
end
|
438
|
+
|
439
|
+
class OpenSSL::Cipher::RC2 < ::OpenSSL::Cipher
|
440
|
+
# source://openssl//openssl/cipher.rb#19
|
441
|
+
def initialize(*args); end
|
442
|
+
end
|
443
|
+
|
444
|
+
class OpenSSL::Cipher::RC4 < ::OpenSSL::Cipher
|
445
|
+
# source://openssl//openssl/cipher.rb#19
|
446
|
+
def initialize(*args); end
|
447
|
+
end
|
448
|
+
|
449
|
+
class OpenSSL::Cipher::RC5 < ::OpenSSL::Cipher
|
450
|
+
# source://openssl//openssl/cipher.rb#19
|
451
|
+
def initialize(*args); end
|
452
|
+
end
|
453
|
+
|
454
|
+
class OpenSSL::Config
|
455
|
+
include ::Enumerable
|
456
|
+
end
|
457
|
+
|
458
|
+
class OpenSSL::Digest < ::Digest::Class
|
459
|
+
class << self
|
460
|
+
# Return the hash value computed with _name_ Digest. _name_ is either the
|
461
|
+
# long name or short name of a supported digest algorithm.
|
462
|
+
#
|
463
|
+
# === Examples
|
464
|
+
#
|
465
|
+
# OpenSSL::Digest.digest("SHA256", "abc")
|
466
|
+
#
|
467
|
+
# which is equivalent to:
|
468
|
+
#
|
469
|
+
# OpenSSL::Digest.digest('SHA256', "abc")
|
470
|
+
#
|
471
|
+
# source://openssl//openssl/digest.rb#29
|
472
|
+
def digest(name, data); end
|
473
|
+
end
|
474
|
+
end
|
475
|
+
|
476
|
+
# Deprecated.
|
477
|
+
#
|
478
|
+
# This class is only provided for backwards compatibility.
|
479
|
+
# Use OpenSSL::Digest instead.
|
480
|
+
class OpenSSL::Digest::Digest < ::OpenSSL::Digest; end
|
481
|
+
|
482
|
+
class OpenSSL::Digest::MD4 < ::OpenSSL::Digest
|
483
|
+
# source://openssl//openssl/digest.rb#35
|
484
|
+
def initialize(data = T.unsafe(nil)); end
|
485
|
+
|
486
|
+
class << self
|
487
|
+
# source://openssl//openssl/digest.rb#41
|
488
|
+
def digest(data); end
|
489
|
+
|
490
|
+
# source://openssl//openssl/digest.rb#42
|
491
|
+
def hexdigest(data); end
|
492
|
+
end
|
493
|
+
end
|
494
|
+
|
495
|
+
class OpenSSL::Digest::MD5 < ::OpenSSL::Digest
|
496
|
+
# source://openssl//openssl/digest.rb#35
|
497
|
+
def initialize(data = T.unsafe(nil)); end
|
498
|
+
|
499
|
+
class << self
|
500
|
+
# source://openssl//openssl/digest.rb#41
|
501
|
+
def digest(data); end
|
502
|
+
|
503
|
+
# source://openssl//openssl/digest.rb#42
|
504
|
+
def hexdigest(data); end
|
505
|
+
end
|
506
|
+
end
|
507
|
+
|
508
|
+
class OpenSSL::Digest::RIPEMD160 < ::OpenSSL::Digest
|
509
|
+
# source://openssl//openssl/digest.rb#35
|
510
|
+
def initialize(data = T.unsafe(nil)); end
|
511
|
+
|
512
|
+
class << self
|
513
|
+
# source://openssl//openssl/digest.rb#41
|
514
|
+
def digest(data); end
|
515
|
+
|
516
|
+
# source://openssl//openssl/digest.rb#42
|
517
|
+
def hexdigest(data); end
|
518
|
+
end
|
519
|
+
end
|
520
|
+
|
521
|
+
class OpenSSL::Digest::SHA1 < ::OpenSSL::Digest
|
522
|
+
# source://openssl//openssl/digest.rb#35
|
523
|
+
def initialize(data = T.unsafe(nil)); end
|
524
|
+
|
525
|
+
class << self
|
526
|
+
# source://openssl//openssl/digest.rb#41
|
527
|
+
def digest(data); end
|
528
|
+
|
529
|
+
# source://openssl//openssl/digest.rb#42
|
530
|
+
def hexdigest(data); end
|
531
|
+
end
|
532
|
+
end
|
533
|
+
|
534
|
+
class OpenSSL::Digest::SHA224 < ::OpenSSL::Digest
|
535
|
+
# source://openssl//openssl/digest.rb#35
|
536
|
+
def initialize(data = T.unsafe(nil)); end
|
537
|
+
|
538
|
+
class << self
|
539
|
+
# source://openssl//openssl/digest.rb#41
|
540
|
+
def digest(data); end
|
541
|
+
|
542
|
+
# source://openssl//openssl/digest.rb#42
|
543
|
+
def hexdigest(data); end
|
544
|
+
end
|
545
|
+
end
|
546
|
+
|
547
|
+
class OpenSSL::Digest::SHA256 < ::OpenSSL::Digest
|
548
|
+
# source://openssl//openssl/digest.rb#35
|
549
|
+
def initialize(data = T.unsafe(nil)); end
|
550
|
+
|
551
|
+
class << self
|
552
|
+
# source://openssl//openssl/digest.rb#41
|
553
|
+
def digest(data); end
|
554
|
+
|
555
|
+
# source://openssl//openssl/digest.rb#42
|
556
|
+
def hexdigest(data); end
|
557
|
+
end
|
558
|
+
end
|
559
|
+
|
560
|
+
class OpenSSL::Digest::SHA384 < ::OpenSSL::Digest
|
561
|
+
# source://openssl//openssl/digest.rb#35
|
562
|
+
def initialize(data = T.unsafe(nil)); end
|
563
|
+
|
564
|
+
class << self
|
565
|
+
# source://openssl//openssl/digest.rb#41
|
566
|
+
def digest(data); end
|
567
|
+
|
568
|
+
# source://openssl//openssl/digest.rb#42
|
569
|
+
def hexdigest(data); end
|
570
|
+
end
|
571
|
+
end
|
572
|
+
|
573
|
+
class OpenSSL::Digest::SHA512 < ::OpenSSL::Digest
|
574
|
+
# source://openssl//openssl/digest.rb#35
|
575
|
+
def initialize(data = T.unsafe(nil)); end
|
576
|
+
|
577
|
+
class << self
|
578
|
+
# source://openssl//openssl/digest.rb#41
|
579
|
+
def digest(data); end
|
580
|
+
|
581
|
+
# source://openssl//openssl/digest.rb#42
|
582
|
+
def hexdigest(data); end
|
583
|
+
end
|
584
|
+
end
|
585
|
+
|
586
|
+
class OpenSSL::HMAC
|
587
|
+
# Securely compare with another HMAC instance in constant time.
|
588
|
+
#
|
589
|
+
# source://openssl//openssl/hmac.rb#6
|
590
|
+
def ==(other); end
|
591
|
+
|
592
|
+
# :call-seq:
|
593
|
+
# hmac.base64digest -> string
|
594
|
+
#
|
595
|
+
# Returns the authentication code an a Base64-encoded string.
|
596
|
+
#
|
597
|
+
# source://openssl//openssl/hmac.rb#17
|
598
|
+
def base64digest; end
|
599
|
+
|
600
|
+
class << self
|
601
|
+
# :call-seq:
|
602
|
+
# HMAC.base64digest(digest, key, data) -> aString
|
603
|
+
#
|
604
|
+
# Returns the authentication code as a Base64-encoded string. The _digest_
|
605
|
+
# parameter specifies the digest algorithm to use. This may be a String
|
606
|
+
# representing the algorithm name or an instance of OpenSSL::Digest.
|
607
|
+
#
|
608
|
+
# === Example
|
609
|
+
# key = 'key'
|
610
|
+
# data = 'The quick brown fox jumps over the lazy dog'
|
611
|
+
#
|
612
|
+
# hmac = OpenSSL::HMAC.base64digest('SHA1', key, data)
|
613
|
+
# #=> "3nybhbi3iqa8ino29wqQcBydtNk="
|
614
|
+
#
|
615
|
+
# source://openssl//openssl/hmac.rb#73
|
616
|
+
def base64digest(digest, key, data); end
|
617
|
+
|
618
|
+
# :call-seq:
|
619
|
+
# HMAC.digest(digest, key, data) -> aString
|
620
|
+
#
|
621
|
+
# Returns the authentication code as a binary string. The _digest_ parameter
|
622
|
+
# specifies the digest algorithm to use. This may be a String representing
|
623
|
+
# the algorithm name or an instance of OpenSSL::Digest.
|
624
|
+
#
|
625
|
+
# === Example
|
626
|
+
# key = 'key'
|
627
|
+
# data = 'The quick brown fox jumps over the lazy dog'
|
628
|
+
#
|
629
|
+
# hmac = OpenSSL::HMAC.digest('SHA1', key, data)
|
630
|
+
# #=> "\xDE|\x9B\x85\xB8\xB7\x8A\xA6\xBC\x8Az6\xF7\n\x90p\x1C\x9D\xB4\xD9"
|
631
|
+
#
|
632
|
+
# source://openssl//openssl/hmac.rb#35
|
633
|
+
def digest(digest, key, data); end
|
634
|
+
|
635
|
+
# :call-seq:
|
636
|
+
# HMAC.hexdigest(digest, key, data) -> aString
|
637
|
+
#
|
638
|
+
# Returns the authentication code as a hex-encoded string. The _digest_
|
639
|
+
# parameter specifies the digest algorithm to use. This may be a String
|
640
|
+
# representing the algorithm name or an instance of OpenSSL::Digest.
|
641
|
+
#
|
642
|
+
# === Example
|
643
|
+
# key = 'key'
|
644
|
+
# data = 'The quick brown fox jumps over the lazy dog'
|
645
|
+
#
|
646
|
+
# hmac = OpenSSL::HMAC.hexdigest('SHA1', key, data)
|
647
|
+
# #=> "de7c9b85b8b78aa6bc8a7a36f70a90701c9db4d9"
|
648
|
+
#
|
649
|
+
# source://openssl//openssl/hmac.rb#54
|
650
|
+
def hexdigest(digest, key, data); end
|
651
|
+
end
|
652
|
+
end
|
653
|
+
|
654
|
+
module OpenSSL::Marshal
|
655
|
+
mixes_in_class_methods ::OpenSSL::Marshal::ClassMethods
|
656
|
+
|
657
|
+
# source://openssl//openssl/marshal.rb#26
|
658
|
+
def _dump(_level); end
|
659
|
+
|
660
|
+
class << self
|
661
|
+
# @private
|
662
|
+
#
|
663
|
+
# source://openssl//openssl/marshal.rb#16
|
664
|
+
def included(base); end
|
665
|
+
end
|
666
|
+
end
|
667
|
+
|
668
|
+
module OpenSSL::Marshal::ClassMethods
|
669
|
+
# source://openssl//openssl/marshal.rb#21
|
670
|
+
def _load(string); end
|
671
|
+
end
|
672
|
+
|
673
|
+
module OpenSSL::PKCS5
|
674
|
+
private
|
675
|
+
|
676
|
+
# OpenSSL::PKCS5.pbkdf2_hmac has been renamed to OpenSSL::KDF.pbkdf2_hmac.
|
677
|
+
# This method is provided for backwards compatibility.
|
678
|
+
#
|
679
|
+
# source://openssl//openssl/pkcs5.rb#13
|
680
|
+
def pbkdf2_hmac(pass, salt, iter, keylen, digest); end
|
681
|
+
|
682
|
+
# source://openssl//openssl/pkcs5.rb#18
|
683
|
+
def pbkdf2_hmac_sha1(pass, salt, iter, keylen); end
|
684
|
+
|
685
|
+
class << self
|
686
|
+
# OpenSSL::PKCS5.pbkdf2_hmac has been renamed to OpenSSL::KDF.pbkdf2_hmac.
|
687
|
+
# This method is provided for backwards compatibility.
|
688
|
+
#
|
689
|
+
# source://openssl//openssl/pkcs5.rb#13
|
690
|
+
def pbkdf2_hmac(pass, salt, iter, keylen, digest); end
|
691
|
+
|
692
|
+
# source://openssl//openssl/pkcs5.rb#18
|
693
|
+
def pbkdf2_hmac_sha1(pass, salt, iter, keylen); end
|
694
|
+
end
|
695
|
+
end
|
696
|
+
|
697
|
+
class OpenSSL::PKey::DH < ::OpenSSL::PKey::PKey
|
698
|
+
include ::OpenSSL::Marshal
|
699
|
+
extend ::OpenSSL::Marshal::ClassMethods
|
700
|
+
|
701
|
+
# :call-seq:
|
702
|
+
# dh.compute_key(pub_bn) -> string
|
703
|
+
#
|
704
|
+
# Returns a String containing a shared secret computed from the other
|
705
|
+
# party's public value.
|
706
|
+
#
|
707
|
+
# This method is provided for backwards compatibility, and calls #derive
|
708
|
+
# internally.
|
709
|
+
#
|
710
|
+
# === Parameters
|
711
|
+
# * _pub_bn_ is a OpenSSL::BN, *not* the DH instance returned by
|
712
|
+
# DH#public_key as that contains the DH parameters only.
|
713
|
+
#
|
714
|
+
# source://openssl//openssl/pkey.rb#49
|
715
|
+
def compute_key(pub_bn); end
|
716
|
+
|
717
|
+
# :call-seq:
|
718
|
+
# dh.generate_key! -> self
|
719
|
+
#
|
720
|
+
# Generates a private and public key unless a private key already exists.
|
721
|
+
# If this DH instance was generated from public \DH parameters (e.g. by
|
722
|
+
# encoding the result of DH#public_key), then this method needs to be
|
723
|
+
# called first in order to generate the per-session keys before performing
|
724
|
+
# the actual key exchange.
|
725
|
+
#
|
726
|
+
# <b>Deprecated in version 3.0</b>. This method is incompatible with
|
727
|
+
# OpenSSL 3.0.0 or later.
|
728
|
+
#
|
729
|
+
# See also OpenSSL::PKey.generate_key.
|
730
|
+
#
|
731
|
+
# Example:
|
732
|
+
# # DEPRECATED USAGE: This will not work on OpenSSL 3.0 or later
|
733
|
+
# dh0 = OpenSSL::PKey::DH.new(2048)
|
734
|
+
# dh = dh0.public_key # #public_key only copies the DH parameters (contrary to the name)
|
735
|
+
# dh.generate_key!
|
736
|
+
# puts dh.private? # => true
|
737
|
+
# puts dh0.pub_key == dh.pub_key #=> false
|
738
|
+
#
|
739
|
+
# # With OpenSSL::PKey.generate_key
|
740
|
+
# dh0 = OpenSSL::PKey::DH.new(2048)
|
741
|
+
# dh = OpenSSL::PKey.generate_key(dh0)
|
742
|
+
# puts dh0.pub_key == dh.pub_key #=> false
|
743
|
+
#
|
744
|
+
# source://openssl//openssl/pkey.rb#91
|
745
|
+
def generate_key!; end
|
746
|
+
|
747
|
+
# :call-seq:
|
748
|
+
# dh.public_key -> dhnew
|
749
|
+
#
|
750
|
+
# Returns a new DH instance that carries just the \DH parameters.
|
751
|
+
#
|
752
|
+
# Contrary to the method name, the returned DH object contains only
|
753
|
+
# parameters and not the public key.
|
754
|
+
#
|
755
|
+
# This method is provided for backwards compatibility. In most cases, there
|
756
|
+
# is no need to call this method.
|
757
|
+
#
|
758
|
+
# For the purpose of re-generating the key pair while keeping the
|
759
|
+
# parameters, check OpenSSL::PKey.generate_key.
|
760
|
+
#
|
761
|
+
# Example:
|
762
|
+
# # OpenSSL::PKey::DH.generate by default generates a random key pair
|
763
|
+
# dh1 = OpenSSL::PKey::DH.generate(2048)
|
764
|
+
# p dh1.priv_key #=> #<OpenSSL::BN 1288347...>
|
765
|
+
# dhcopy = dh1.public_key
|
766
|
+
# p dhcopy.priv_key #=> nil
|
767
|
+
#
|
768
|
+
# source://openssl//openssl/pkey.rb#33
|
769
|
+
def public_key; end
|
770
|
+
|
771
|
+
class << self
|
772
|
+
# :call-seq:
|
773
|
+
# DH.generate(size, generator = 2) -> dh
|
774
|
+
#
|
775
|
+
# Creates a new DH instance from scratch by generating random parameters
|
776
|
+
# and a key pair.
|
777
|
+
#
|
778
|
+
# See also OpenSSL::PKey.generate_parameters and
|
779
|
+
# OpenSSL::PKey.generate_key.
|
780
|
+
#
|
781
|
+
# +size+::
|
782
|
+
# The desired key size in bits.
|
783
|
+
# +generator+::
|
784
|
+
# The generator.
|
785
|
+
#
|
786
|
+
# source://openssl//openssl/pkey.rb#118
|
787
|
+
def generate(size, generator = T.unsafe(nil), &blk); end
|
788
|
+
|
789
|
+
# Handle DH.new(size, generator) form here; new(str) and new() forms
|
790
|
+
# are handled by #initialize
|
791
|
+
#
|
792
|
+
# source://openssl//openssl/pkey.rb#128
|
793
|
+
def new(*args, &blk); end
|
794
|
+
end
|
795
|
+
end
|
796
|
+
|
797
|
+
class OpenSSL::PKey::DSA < ::OpenSSL::PKey::PKey
|
798
|
+
include ::OpenSSL::Marshal
|
799
|
+
extend ::OpenSSL::Marshal::ClassMethods
|
800
|
+
|
801
|
+
# :call-seq:
|
802
|
+
# dsa.public_key -> dsanew
|
803
|
+
#
|
804
|
+
# Returns a new DSA instance that carries just the \DSA parameters and the
|
805
|
+
# public key.
|
806
|
+
#
|
807
|
+
# This method is provided for backwards compatibility. In most cases, there
|
808
|
+
# is no need to call this method.
|
809
|
+
#
|
810
|
+
# For the purpose of serializing the public key, to PEM or DER encoding of
|
811
|
+
# X.509 SubjectPublicKeyInfo format, check PKey#public_to_pem and
|
812
|
+
# PKey#public_to_der.
|
813
|
+
#
|
814
|
+
# source://openssl//openssl/pkey.rb#153
|
815
|
+
def public_key; end
|
816
|
+
|
817
|
+
# :call-seq:
|
818
|
+
# dsa.syssign(string) -> string
|
819
|
+
#
|
820
|
+
# Computes and returns the \DSA signature of +string+, where +string+ is
|
821
|
+
# expected to be an already-computed message digest of the original input
|
822
|
+
# data. The signature is issued using the private key of this DSA instance.
|
823
|
+
#
|
824
|
+
# <b>Deprecated in version 3.0</b>.
|
825
|
+
# Consider using PKey::PKey#sign_raw and PKey::PKey#verify_raw instead.
|
826
|
+
#
|
827
|
+
# +string+::
|
828
|
+
# A message digest of the original input data to be signed.
|
829
|
+
#
|
830
|
+
# Example:
|
831
|
+
# dsa = OpenSSL::PKey::DSA.new(2048)
|
832
|
+
# doc = "Sign me"
|
833
|
+
# digest = OpenSSL::Digest.digest('SHA1', doc)
|
834
|
+
#
|
835
|
+
# # With legacy #syssign and #sysverify:
|
836
|
+
# sig = dsa.syssign(digest)
|
837
|
+
# p dsa.sysverify(digest, sig) #=> true
|
838
|
+
#
|
839
|
+
# # With #sign_raw and #verify_raw:
|
840
|
+
# sig = dsa.sign_raw(nil, digest)
|
841
|
+
# p dsa.verify_raw(nil, sig, digest) #=> true
|
842
|
+
#
|
843
|
+
# source://openssl//openssl/pkey.rb#220
|
844
|
+
def syssign(string); end
|
845
|
+
|
846
|
+
# :call-seq:
|
847
|
+
# dsa.sysverify(digest, sig) -> true | false
|
848
|
+
#
|
849
|
+
# Verifies whether the signature is valid given the message digest input.
|
850
|
+
# It does so by validating +sig+ using the public key of this DSA instance.
|
851
|
+
#
|
852
|
+
# <b>Deprecated in version 3.0</b>.
|
853
|
+
# Consider using PKey::PKey#sign_raw and PKey::PKey#verify_raw instead.
|
854
|
+
#
|
855
|
+
# +digest+::
|
856
|
+
# A message digest of the original input data to be signed.
|
857
|
+
# +sig+::
|
858
|
+
# A \DSA signature value.
|
859
|
+
#
|
860
|
+
# source://openssl//openssl/pkey.rb#243
|
861
|
+
def sysverify(digest, sig); end
|
862
|
+
|
863
|
+
class << self
|
864
|
+
# :call-seq:
|
865
|
+
# DSA.generate(size) -> dsa
|
866
|
+
#
|
867
|
+
# Creates a new DSA instance by generating a private/public key pair
|
868
|
+
# from scratch.
|
869
|
+
#
|
870
|
+
# See also OpenSSL::PKey.generate_parameters and
|
871
|
+
# OpenSSL::PKey.generate_key.
|
872
|
+
#
|
873
|
+
# +size+::
|
874
|
+
# The desired key size in bits.
|
875
|
+
#
|
876
|
+
# source://openssl//openssl/pkey.rb#169
|
877
|
+
def generate(size, &blk); end
|
878
|
+
|
879
|
+
# Handle DSA.new(size) form here; new(str) and new() forms
|
880
|
+
# are handled by #initialize
|
881
|
+
#
|
882
|
+
# source://openssl//openssl/pkey.rb#186
|
883
|
+
def new(*args, &blk); end
|
884
|
+
end
|
885
|
+
end
|
886
|
+
|
887
|
+
class OpenSSL::PKey::EC < ::OpenSSL::PKey::PKey
|
888
|
+
include ::OpenSSL::Marshal
|
889
|
+
extend ::OpenSSL::Marshal::ClassMethods
|
890
|
+
|
891
|
+
# :call-seq:
|
892
|
+
# ec.dh_compute_key(pubkey) -> string
|
893
|
+
#
|
894
|
+
# Derives a shared secret by ECDH. _pubkey_ must be an instance of
|
895
|
+
# OpenSSL::PKey::EC::Point and must belong to the same group.
|
896
|
+
#
|
897
|
+
# This method is provided for backwards compatibility, and calls #derive
|
898
|
+
# internally.
|
899
|
+
#
|
900
|
+
# source://openssl//openssl/pkey.rb#284
|
901
|
+
def dh_compute_key(pubkey); end
|
902
|
+
|
903
|
+
# :call-seq:
|
904
|
+
# key.dsa_sign_asn1(data) -> String
|
905
|
+
#
|
906
|
+
# <b>Deprecated in version 3.0</b>.
|
907
|
+
# Consider using PKey::PKey#sign_raw and PKey::PKey#verify_raw instead.
|
908
|
+
#
|
909
|
+
# source://openssl//openssl/pkey.rb#259
|
910
|
+
def dsa_sign_asn1(data); end
|
911
|
+
|
912
|
+
# :call-seq:
|
913
|
+
# key.dsa_verify_asn1(data, sig) -> true | false
|
914
|
+
#
|
915
|
+
# <b>Deprecated in version 3.0</b>.
|
916
|
+
# Consider using PKey::PKey#sign_raw and PKey::PKey#verify_raw instead.
|
917
|
+
#
|
918
|
+
# source://openssl//openssl/pkey.rb#270
|
919
|
+
def dsa_verify_asn1(data, sig); end
|
920
|
+
end
|
921
|
+
|
922
|
+
OpenSSL::PKey::EC::EXPLICIT_CURVE = T.let(T.unsafe(nil), Integer)
|
923
|
+
|
924
|
+
class OpenSSL::PKey::EC::Point
|
925
|
+
# :call-seq:
|
926
|
+
# point.to_bn([conversion_form]) -> OpenSSL::BN
|
927
|
+
#
|
928
|
+
# Returns the octet string representation of the EC point as an instance of
|
929
|
+
# OpenSSL::BN.
|
930
|
+
#
|
931
|
+
# If _conversion_form_ is not given, the _point_conversion_form_ attribute
|
932
|
+
# set to the group is used.
|
933
|
+
#
|
934
|
+
# See #to_octet_string for more information.
|
935
|
+
#
|
936
|
+
# source://openssl//openssl/pkey.rb#307
|
937
|
+
def to_bn(conversion_form = T.unsafe(nil)); end
|
938
|
+
end
|
939
|
+
|
940
|
+
class OpenSSL::PKey::RSA < ::OpenSSL::PKey::PKey
|
941
|
+
include ::OpenSSL::Marshal
|
942
|
+
extend ::OpenSSL::Marshal::ClassMethods
|
943
|
+
|
944
|
+
# :call-seq:
|
945
|
+
# rsa.private_decrypt(string) -> String
|
946
|
+
# rsa.private_decrypt(string, padding) -> String
|
947
|
+
#
|
948
|
+
# Decrypt +string+, which has been encrypted with the public key, with the
|
949
|
+
# private key. +padding+ defaults to PKCS1_PADDING.
|
950
|
+
#
|
951
|
+
# <b>Deprecated in version 3.0</b>.
|
952
|
+
# Consider using PKey::PKey#encrypt and PKey::PKey#decrypt instead.
|
953
|
+
#
|
954
|
+
# source://openssl//openssl/pkey.rb#435
|
955
|
+
def private_decrypt(data, padding = T.unsafe(nil)); end
|
956
|
+
|
957
|
+
# :call-seq:
|
958
|
+
# rsa.private_encrypt(string) -> String
|
959
|
+
# rsa.private_encrypt(string, padding) -> String
|
960
|
+
#
|
961
|
+
# Encrypt +string+ with the private key. +padding+ defaults to
|
962
|
+
# PKCS1_PADDING. The encrypted string output can be decrypted using
|
963
|
+
# #public_decrypt.
|
964
|
+
#
|
965
|
+
# <b>Deprecated in version 3.0</b>.
|
966
|
+
# Consider using PKey::PKey#sign_raw and PKey::PKey#verify_raw, and
|
967
|
+
# PKey::PKey#verify_recover instead.
|
968
|
+
#
|
969
|
+
# source://openssl//openssl/pkey.rb#372
|
970
|
+
def private_encrypt(string, padding = T.unsafe(nil)); end
|
971
|
+
|
972
|
+
# :call-seq:
|
973
|
+
# rsa.public_decrypt(string) -> String
|
974
|
+
# rsa.public_decrypt(string, padding) -> String
|
975
|
+
#
|
976
|
+
# Decrypt +string+, which has been encrypted with the private key, with the
|
977
|
+
# public key. +padding+ defaults to PKCS1_PADDING.
|
978
|
+
#
|
979
|
+
# <b>Deprecated in version 3.0</b>.
|
980
|
+
# Consider using PKey::PKey#sign_raw and PKey::PKey#verify_raw, and
|
981
|
+
# PKey::PKey#verify_recover instead.
|
982
|
+
#
|
983
|
+
# source://openssl//openssl/pkey.rb#394
|
984
|
+
def public_decrypt(string, padding = T.unsafe(nil)); end
|
985
|
+
|
986
|
+
# :call-seq:
|
987
|
+
# rsa.public_encrypt(string) -> String
|
988
|
+
# rsa.public_encrypt(string, padding) -> String
|
989
|
+
#
|
990
|
+
# Encrypt +string+ with the public key. +padding+ defaults to
|
991
|
+
# PKCS1_PADDING. The encrypted string output can be decrypted using
|
992
|
+
# #private_decrypt.
|
993
|
+
#
|
994
|
+
# <b>Deprecated in version 3.0</b>.
|
995
|
+
# Consider using PKey::PKey#encrypt and PKey::PKey#decrypt instead.
|
996
|
+
#
|
997
|
+
# source://openssl//openssl/pkey.rb#415
|
998
|
+
def public_encrypt(data, padding = T.unsafe(nil)); end
|
999
|
+
|
1000
|
+
# :call-seq:
|
1001
|
+
# rsa.public_key -> rsanew
|
1002
|
+
#
|
1003
|
+
# Returns a new RSA instance that carries just the public key components.
|
1004
|
+
#
|
1005
|
+
# This method is provided for backwards compatibility. In most cases, there
|
1006
|
+
# is no need to call this method.
|
1007
|
+
#
|
1008
|
+
# For the purpose of serializing the public key, to PEM or DER encoding of
|
1009
|
+
# X.509 SubjectPublicKeyInfo format, check PKey#public_to_pem and
|
1010
|
+
# PKey#public_to_der.
|
1011
|
+
#
|
1012
|
+
# source://openssl//openssl/pkey.rb#327
|
1013
|
+
def public_key; end
|
1014
|
+
|
1015
|
+
private
|
1016
|
+
|
1017
|
+
# source://openssl//openssl/pkey.rb#452
|
1018
|
+
def translate_padding_mode(num); end
|
1019
|
+
|
1020
|
+
class << self
|
1021
|
+
# :call-seq:
|
1022
|
+
# RSA.generate(size, exponent = 65537) -> RSA
|
1023
|
+
#
|
1024
|
+
# Generates an \RSA keypair.
|
1025
|
+
#
|
1026
|
+
# See also OpenSSL::PKey.generate_key.
|
1027
|
+
#
|
1028
|
+
# +size+::
|
1029
|
+
# The desired key size in bits.
|
1030
|
+
# +exponent+::
|
1031
|
+
# An odd Integer, normally 3, 17, or 65537.
|
1032
|
+
#
|
1033
|
+
# source://openssl//openssl/pkey.rb#343
|
1034
|
+
def generate(size, exp = T.unsafe(nil), &blk); end
|
1035
|
+
|
1036
|
+
# Handle RSA.new(size, exponent) form here; new(str) and new() forms
|
1037
|
+
# are handled by #initialize
|
1038
|
+
#
|
1039
|
+
# source://openssl//openssl/pkey.rb#352
|
1040
|
+
def new(*args, &blk); end
|
1041
|
+
end
|
1042
|
+
end
|
1043
|
+
|
1044
|
+
module OpenSSL::SSL
|
1045
|
+
private
|
1046
|
+
|
1047
|
+
# source://openssl//openssl/ssl.rb#273
|
1048
|
+
def verify_certificate_identity(cert, hostname); end
|
1049
|
+
|
1050
|
+
# source://openssl//openssl/ssl.rb#306
|
1051
|
+
def verify_hostname(hostname, san); end
|
1052
|
+
|
1053
|
+
# source://openssl//openssl/ssl.rb#339
|
1054
|
+
def verify_wildcard(domain_component, san_component); end
|
1055
|
+
|
1056
|
+
class << self
|
1057
|
+
# source://openssl//openssl/ssl.rb#273
|
1058
|
+
def verify_certificate_identity(cert, hostname); end
|
1059
|
+
|
1060
|
+
# source://openssl//openssl/ssl.rb#306
|
1061
|
+
def verify_hostname(hostname, san); end
|
1062
|
+
|
1063
|
+
# source://openssl//openssl/ssl.rb#339
|
1064
|
+
def verify_wildcard(domain_component, san_component); end
|
1065
|
+
end
|
1066
|
+
end
|
1067
|
+
|
1068
|
+
OpenSSL::SSL::OP_ALLOW_CLIENT_RENEGOTIATION = T.let(T.unsafe(nil), Integer)
|
1069
|
+
OpenSSL::SSL::OP_ALLOW_NO_DHE_KEX = T.let(T.unsafe(nil), Integer)
|
1070
|
+
OpenSSL::SSL::OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION = T.let(T.unsafe(nil), Integer)
|
1071
|
+
OpenSSL::SSL::OP_CLEANSE_PLAINTEXT = T.let(T.unsafe(nil), Integer)
|
1072
|
+
OpenSSL::SSL::OP_CRYPTOPRO_TLSEXT_BUG = T.let(T.unsafe(nil), Integer)
|
1073
|
+
OpenSSL::SSL::OP_DISABLE_TLSEXT_CA_NAMES = T.let(T.unsafe(nil), Integer)
|
1074
|
+
OpenSSL::SSL::OP_ENABLE_KTLS = T.let(T.unsafe(nil), Integer)
|
1075
|
+
OpenSSL::SSL::OP_ENABLE_MIDDLEBOX_COMPAT = T.let(T.unsafe(nil), Integer)
|
1076
|
+
OpenSSL::SSL::OP_IGNORE_UNEXPECTED_EOF = T.let(T.unsafe(nil), Integer)
|
1077
|
+
OpenSSL::SSL::OP_LEGACY_SERVER_CONNECT = T.let(T.unsafe(nil), Integer)
|
1078
|
+
OpenSSL::SSL::OP_NO_ANTI_REPLAY = T.let(T.unsafe(nil), Integer)
|
1079
|
+
OpenSSL::SSL::OP_NO_ENCRYPT_THEN_MAC = T.let(T.unsafe(nil), Integer)
|
1080
|
+
OpenSSL::SSL::OP_NO_RENEGOTIATION = T.let(T.unsafe(nil), Integer)
|
1081
|
+
OpenSSL::SSL::OP_NO_TLSv1_3 = T.let(T.unsafe(nil), Integer)
|
1082
|
+
OpenSSL::SSL::OP_PRIORITIZE_CHACHA = T.let(T.unsafe(nil), Integer)
|
1083
|
+
OpenSSL::SSL::OP_SAFARI_ECDHE_ECDSA_BUG = T.let(T.unsafe(nil), Integer)
|
1084
|
+
OpenSSL::SSL::OP_TLSEXT_PADDING = T.let(T.unsafe(nil), Integer)
|
1085
|
+
OpenSSL::SSL::SSL2_VERSION = T.let(T.unsafe(nil), Integer)
|
1086
|
+
OpenSSL::SSL::SSL3_VERSION = T.let(T.unsafe(nil), Integer)
|
1087
|
+
|
1088
|
+
class OpenSSL::SSL::SSLContext
|
1089
|
+
# call-seq:
|
1090
|
+
# SSLContext.new -> ctx
|
1091
|
+
# SSLContext.new(:TLSv1) -> ctx
|
1092
|
+
# SSLContext.new("SSLv23") -> ctx
|
1093
|
+
#
|
1094
|
+
# Creates a new SSL context.
|
1095
|
+
#
|
1096
|
+
# If an argument is given, #ssl_version= is called with the value. Note
|
1097
|
+
# that this form is deprecated. New applications should use #min_version=
|
1098
|
+
# and #max_version= as necessary.
|
1099
|
+
#
|
1100
|
+
# @return [SSLContext] a new instance of SSLContext
|
1101
|
+
#
|
1102
|
+
# source://openssl//openssl/ssl.rb#124
|
1103
|
+
def initialize(version = T.unsafe(nil)); end
|
1104
|
+
|
1105
|
+
# call-seq:
|
1106
|
+
# ctx.max_version = OpenSSL::SSL::TLS1_2_VERSION
|
1107
|
+
# ctx.max_version = :TLS1_2
|
1108
|
+
# ctx.max_version = nil
|
1109
|
+
#
|
1110
|
+
# Sets the upper bound of the supported SSL/TLS protocol version. See
|
1111
|
+
# #min_version= for the possible values.
|
1112
|
+
#
|
1113
|
+
# source://openssl//openssl/ssl.rb#187
|
1114
|
+
def max_version=(version); end
|
1115
|
+
|
1116
|
+
# call-seq:
|
1117
|
+
# ctx.min_version = OpenSSL::SSL::TLS1_2_VERSION
|
1118
|
+
# ctx.min_version = :TLS1_2
|
1119
|
+
# ctx.min_version = nil
|
1120
|
+
#
|
1121
|
+
# Sets the lower bound on the supported SSL/TLS protocol version. The
|
1122
|
+
# version may be specified by an integer constant named
|
1123
|
+
# OpenSSL::SSL::*_VERSION, a Symbol, or +nil+ which means "any version".
|
1124
|
+
#
|
1125
|
+
# Be careful that you don't overwrite OpenSSL::SSL::OP_NO_{SSL,TLS}v*
|
1126
|
+
# options by #options= once you have called #min_version= or
|
1127
|
+
# #max_version=.
|
1128
|
+
#
|
1129
|
+
# === Example
|
1130
|
+
# ctx = OpenSSL::SSL::SSLContext.new
|
1131
|
+
# ctx.min_version = OpenSSL::SSL::TLS1_1_VERSION
|
1132
|
+
# ctx.max_version = OpenSSL::SSL::TLS1_2_VERSION
|
1133
|
+
#
|
1134
|
+
# sock = OpenSSL::SSL::SSLSocket.new(tcp_sock, ctx)
|
1135
|
+
# sock.connect # Initiates a connection using either TLS 1.1 or TLS 1.2
|
1136
|
+
#
|
1137
|
+
# source://openssl//openssl/ssl.rb#175
|
1138
|
+
def min_version=(version); end
|
1139
|
+
|
1140
|
+
# A callback invoked at connect time to distinguish between multiple
|
1141
|
+
# server names.
|
1142
|
+
#
|
1143
|
+
# The callback is invoked with an SSLSocket and a server name. The
|
1144
|
+
# callback must return an SSLContext for the server name or nil.
|
1145
|
+
#
|
1146
|
+
# source://openssl//openssl/ssl.rb#112
|
1147
|
+
def servername_cb; end
|
1148
|
+
|
1149
|
+
# A callback invoked at connect time to distinguish between multiple
|
1150
|
+
# server names.
|
1151
|
+
#
|
1152
|
+
# The callback is invoked with an SSLSocket and a server name. The
|
1153
|
+
# callback must return an SSLContext for the server name or nil.
|
1154
|
+
#
|
1155
|
+
# source://openssl//openssl/ssl.rb#112
|
1156
|
+
def servername_cb=(_arg0); end
|
1157
|
+
|
1158
|
+
# call-seq:
|
1159
|
+
# ctx.set_params(params = {}) -> params
|
1160
|
+
#
|
1161
|
+
# Sets saner defaults optimized for the use with HTTP-like protocols.
|
1162
|
+
#
|
1163
|
+
# If a Hash _params_ is given, the parameters are overridden with it.
|
1164
|
+
# The keys in _params_ must be assignment methods on SSLContext.
|
1165
|
+
#
|
1166
|
+
# If the verify_mode is not VERIFY_NONE and ca_file, ca_path and
|
1167
|
+
# cert_store are not set then the system default certificate store is
|
1168
|
+
# used.
|
1169
|
+
#
|
1170
|
+
# source://openssl//openssl/ssl.rb#143
|
1171
|
+
def set_params(params = T.unsafe(nil)); end
|
1172
|
+
|
1173
|
+
# call-seq:
|
1174
|
+
# ctx.ssl_version = :TLSv1
|
1175
|
+
# ctx.ssl_version = "SSLv23"
|
1176
|
+
#
|
1177
|
+
# Sets the SSL/TLS protocol version for the context. This forces
|
1178
|
+
# connections to use only the specified protocol version. This is
|
1179
|
+
# deprecated and only provided for backwards compatibility. Use
|
1180
|
+
# #min_version= and #max_version= instead.
|
1181
|
+
#
|
1182
|
+
# === History
|
1183
|
+
# As the name hints, this used to call the SSL_CTX_set_ssl_version()
|
1184
|
+
# function which sets the SSL method used for connections created from
|
1185
|
+
# the context. As of Ruby/OpenSSL 2.1, this accessor method is
|
1186
|
+
# implemented to call #min_version= and #max_version= instead.
|
1187
|
+
#
|
1188
|
+
# source://openssl//openssl/ssl.rb#206
|
1189
|
+
def ssl_version=(meth); end
|
1190
|
+
|
1191
|
+
# A callback invoked when DH parameters are required for ephemeral DH key
|
1192
|
+
# exchange.
|
1193
|
+
#
|
1194
|
+
# The callback is invoked with the SSLSocket, a
|
1195
|
+
# flag indicating the use of an export cipher and the keylength
|
1196
|
+
# required.
|
1197
|
+
#
|
1198
|
+
# The callback must return an OpenSSL::PKey::DH instance of the correct
|
1199
|
+
# key length.
|
1200
|
+
#
|
1201
|
+
# <b>Deprecated in version 3.0.</b> Use #tmp_dh= instead.
|
1202
|
+
#
|
1203
|
+
# source://openssl//openssl/ssl.rb#105
|
1204
|
+
def tmp_dh_callback; end
|
1205
|
+
|
1206
|
+
# A callback invoked when DH parameters are required for ephemeral DH key
|
1207
|
+
# exchange.
|
1208
|
+
#
|
1209
|
+
# The callback is invoked with the SSLSocket, a
|
1210
|
+
# flag indicating the use of an export cipher and the keylength
|
1211
|
+
# required.
|
1212
|
+
#
|
1213
|
+
# The callback must return an OpenSSL::PKey::DH instance of the correct
|
1214
|
+
# key length.
|
1215
|
+
#
|
1216
|
+
# <b>Deprecated in version 3.0.</b> Use #tmp_dh= instead.
|
1217
|
+
#
|
1218
|
+
# source://openssl//openssl/ssl.rb#105
|
1219
|
+
def tmp_dh_callback=(_arg0); end
|
1220
|
+
end
|
1221
|
+
|
1222
|
+
# source://openssl//openssl/ssl.rb#34
|
1223
|
+
OpenSSL::SSL::SSLContext::DEFAULT_2048 = T.let(T.unsafe(nil), OpenSSL::PKey::DH)
|
1224
|
+
|
1225
|
+
# source://openssl//openssl/ssl.rb#46
|
1226
|
+
OpenSSL::SSL::SSLContext::DEFAULT_TMP_DH_CALLBACK = T.let(T.unsafe(nil), Proc)
|
1227
|
+
|
1228
|
+
# The list of available SSL/TLS methods. This constant is only provided
|
1229
|
+
# for backwards compatibility.
|
1230
|
+
#
|
1231
|
+
# source://openssl//openssl/ssl.rb#232
|
1232
|
+
OpenSSL::SSL::SSLContext::METHODS = T.let(T.unsafe(nil), Array)
|
1233
|
+
|
1234
|
+
# source://openssl//openssl/ssl.rb#220
|
1235
|
+
OpenSSL::SSL::SSLContext::METHODS_MAP = T.let(T.unsafe(nil), Hash)
|
1236
|
+
|
1237
|
+
class OpenSSL::SSL::SSLErrorWaitReadable < ::OpenSSL::SSL::SSLError
|
1238
|
+
include ::IO::WaitReadable
|
1239
|
+
end
|
1240
|
+
|
1241
|
+
class OpenSSL::SSL::SSLErrorWaitWritable < ::OpenSSL::SSL::SSLError
|
1242
|
+
include ::IO::WaitWritable
|
1243
|
+
end
|
1244
|
+
|
1245
|
+
# SSLServer represents a TCP/IP server socket with Secure Sockets Layer.
|
1246
|
+
class OpenSSL::SSL::SSLServer
|
1247
|
+
include ::OpenSSL::SSL::SocketForwarder
|
1248
|
+
|
1249
|
+
# Creates a new instance of SSLServer.
|
1250
|
+
# * _srv_ is an instance of TCPServer.
|
1251
|
+
# * _ctx_ is an instance of OpenSSL::SSL::SSLContext.
|
1252
|
+
#
|
1253
|
+
# @return [SSLServer] a new instance of SSLServer
|
1254
|
+
#
|
1255
|
+
# source://openssl//openssl/ssl.rb#488
|
1256
|
+
def initialize(svr, ctx); end
|
1257
|
+
|
1258
|
+
# Works similar to TCPServer#accept.
|
1259
|
+
#
|
1260
|
+
# source://openssl//openssl/ssl.rb#516
|
1261
|
+
def accept; end
|
1262
|
+
|
1263
|
+
# See IO#close for details.
|
1264
|
+
#
|
1265
|
+
# source://openssl//openssl/ssl.rb#537
|
1266
|
+
def close; end
|
1267
|
+
|
1268
|
+
# See TCPServer#listen for details.
|
1269
|
+
#
|
1270
|
+
# source://openssl//openssl/ssl.rb#506
|
1271
|
+
def listen(backlog = T.unsafe(nil)); end
|
1272
|
+
|
1273
|
+
# See BasicSocket#shutdown for details.
|
1274
|
+
#
|
1275
|
+
# source://openssl//openssl/ssl.rb#511
|
1276
|
+
def shutdown(how = T.unsafe(nil)); end
|
1277
|
+
|
1278
|
+
# When true then #accept works exactly the same as TCPServer#accept
|
1279
|
+
#
|
1280
|
+
# source://openssl//openssl/ssl.rb#483
|
1281
|
+
def start_immediately; end
|
1282
|
+
|
1283
|
+
# When true then #accept works exactly the same as TCPServer#accept
|
1284
|
+
#
|
1285
|
+
# source://openssl//openssl/ssl.rb#483
|
1286
|
+
def start_immediately=(_arg0); end
|
1287
|
+
|
1288
|
+
# Returns the TCPServer passed to the SSLServer when initialized.
|
1289
|
+
#
|
1290
|
+
# source://openssl//openssl/ssl.rb#501
|
1291
|
+
def to_io; end
|
1292
|
+
end
|
1293
|
+
|
1294
|
+
class OpenSSL::SSL::SSLSocket
|
1295
|
+
include ::Enumerable
|
1296
|
+
include ::OpenSSL::Buffering
|
1297
|
+
include ::OpenSSL::SSL::SocketForwarder
|
1298
|
+
|
1299
|
+
# The SSLContext object used in this connection.
|
1300
|
+
#
|
1301
|
+
# source://openssl//openssl/ssl.rb#368
|
1302
|
+
def context; end
|
1303
|
+
|
1304
|
+
# Returns the value of attribute hostname.
|
1305
|
+
#
|
1306
|
+
# source://openssl//openssl/ssl.rb#361
|
1307
|
+
def hostname; end
|
1308
|
+
|
1309
|
+
# The underlying IO object.
|
1310
|
+
#
|
1311
|
+
# source://openssl//openssl/ssl.rb#364
|
1312
|
+
def io; end
|
1313
|
+
|
1314
|
+
# call-seq:
|
1315
|
+
# ssl.post_connection_check(hostname) -> true
|
1316
|
+
#
|
1317
|
+
# Perform hostname verification following RFC 6125.
|
1318
|
+
#
|
1319
|
+
# This method MUST be called after calling #connect to ensure that the
|
1320
|
+
# hostname of a remote peer has been verified.
|
1321
|
+
#
|
1322
|
+
# source://openssl//openssl/ssl.rb#394
|
1323
|
+
def post_connection_check(hostname); end
|
1324
|
+
|
1325
|
+
# call-seq:
|
1326
|
+
# ssl.session -> aSession
|
1327
|
+
#
|
1328
|
+
# Returns the SSLSession object currently used, or nil if the session is
|
1329
|
+
# not established.
|
1330
|
+
#
|
1331
|
+
# source://openssl//openssl/ssl.rb#415
|
1332
|
+
def session; end
|
1333
|
+
|
1334
|
+
# Whether to close the underlying socket as well, when the SSL/TLS
|
1335
|
+
# connection is shut down. This defaults to +false+.
|
1336
|
+
#
|
1337
|
+
# source://openssl//openssl/ssl.rb#372
|
1338
|
+
def sync_close; end
|
1339
|
+
|
1340
|
+
# Whether to close the underlying socket as well, when the SSL/TLS
|
1341
|
+
# connection is shut down. This defaults to +false+.
|
1342
|
+
#
|
1343
|
+
# source://openssl//openssl/ssl.rb#372
|
1344
|
+
def sync_close=(_arg0); end
|
1345
|
+
|
1346
|
+
# call-seq:
|
1347
|
+
# ssl.sysclose => nil
|
1348
|
+
#
|
1349
|
+
# Sends "close notify" to the peer and tries to shut down the SSL
|
1350
|
+
# connection gracefully.
|
1351
|
+
#
|
1352
|
+
# If sync_close is set to +true+, the underlying IO is also closed.
|
1353
|
+
#
|
1354
|
+
# source://openssl//openssl/ssl.rb#381
|
1355
|
+
def sysclose; end
|
1356
|
+
|
1357
|
+
# The underlying IO object.
|
1358
|
+
#
|
1359
|
+
# source://openssl//openssl/ssl.rb#364
|
1360
|
+
def to_io; end
|
1361
|
+
|
1362
|
+
private
|
1363
|
+
|
1364
|
+
# source://openssl//openssl/ssl.rb#429
|
1365
|
+
def client_cert_cb; end
|
1366
|
+
|
1367
|
+
# source://openssl//openssl/ssl.rb#441
|
1368
|
+
def session_get_cb; end
|
1369
|
+
|
1370
|
+
# source://openssl//openssl/ssl.rb#437
|
1371
|
+
def session_new_cb; end
|
1372
|
+
|
1373
|
+
# source://openssl//openssl/ssl.rb#433
|
1374
|
+
def tmp_dh_callback; end
|
1375
|
+
|
1376
|
+
# @return [Boolean]
|
1377
|
+
#
|
1378
|
+
# source://openssl//openssl/ssl.rb#423
|
1379
|
+
def using_anon_cipher?; end
|
1380
|
+
|
1381
|
+
class << self
|
1382
|
+
# call-seq:
|
1383
|
+
# open(remote_host, remote_port, local_host=nil, local_port=nil, context: nil)
|
1384
|
+
#
|
1385
|
+
# Creates a new instance of SSLSocket.
|
1386
|
+
# _remote\_host_ and _remote\_port_ are used to open TCPSocket.
|
1387
|
+
# If _local\_host_ and _local\_port_ are specified,
|
1388
|
+
# then those parameters are used on the local end to establish the connection.
|
1389
|
+
# If _context_ is provided,
|
1390
|
+
# the SSL Sockets initial params will be taken from the context.
|
1391
|
+
#
|
1392
|
+
# === Examples
|
1393
|
+
#
|
1394
|
+
# sock = OpenSSL::SSL::SSLSocket.open('localhost', 443)
|
1395
|
+
# sock.connect # Initiates a connection to localhost:443
|
1396
|
+
#
|
1397
|
+
# with SSLContext:
|
1398
|
+
#
|
1399
|
+
# ctx = OpenSSL::SSL::SSLContext.new
|
1400
|
+
# sock = OpenSSL::SSL::SSLSocket.open('localhost', 443, context: ctx)
|
1401
|
+
# sock.connect # Initiates a connection to localhost:443 with SSLContext
|
1402
|
+
#
|
1403
|
+
# source://openssl//openssl/ssl.rb#467
|
1404
|
+
def open(remote_host, remote_port, local_host = T.unsafe(nil), local_port = T.unsafe(nil), context: T.unsafe(nil)); end
|
1405
|
+
end
|
1406
|
+
end
|
1407
|
+
|
1408
|
+
module OpenSSL::SSL::SocketForwarder
|
1409
|
+
# source://openssl//openssl/ssl.rb#244
|
1410
|
+
def addr; end
|
1411
|
+
|
1412
|
+
# @return [Boolean]
|
1413
|
+
#
|
1414
|
+
# source://openssl//openssl/ssl.rb#264
|
1415
|
+
def closed?; end
|
1416
|
+
|
1417
|
+
# source://openssl//openssl/ssl.rb#268
|
1418
|
+
def do_not_reverse_lookup=(flag); end
|
1419
|
+
|
1420
|
+
# source://openssl//openssl/ssl.rb#260
|
1421
|
+
def fcntl(*args); end
|
1422
|
+
|
1423
|
+
# The file descriptor for the socket.
|
1424
|
+
#
|
1425
|
+
# source://openssl//openssl/ssl.rb#240
|
1426
|
+
def fileno; end
|
1427
|
+
|
1428
|
+
# source://openssl//openssl/ssl.rb#256
|
1429
|
+
def getsockopt(level, optname); end
|
1430
|
+
|
1431
|
+
# source://openssl//openssl/ssl.rb#248
|
1432
|
+
def peeraddr; end
|
1433
|
+
|
1434
|
+
# source://openssl//openssl/ssl.rb#252
|
1435
|
+
def setsockopt(level, optname, optval); end
|
1436
|
+
end
|
1437
|
+
|
1438
|
+
OpenSSL::SSL::TLS1_1_VERSION = T.let(T.unsafe(nil), Integer)
|
1439
|
+
OpenSSL::SSL::TLS1_2_VERSION = T.let(T.unsafe(nil), Integer)
|
1440
|
+
OpenSSL::SSL::TLS1_3_VERSION = T.let(T.unsafe(nil), Integer)
|
1441
|
+
OpenSSL::SSL::TLS1_VERSION = T.let(T.unsafe(nil), Integer)
|
1442
|
+
module OpenSSL::Timestamp; end
|
1443
|
+
|
1444
|
+
class OpenSSL::Timestamp::Factory
|
1445
|
+
def additional_certs; end
|
1446
|
+
def additional_certs=(_arg0); end
|
1447
|
+
def allowed_digests; end
|
1448
|
+
def allowed_digests=(_arg0); end
|
1449
|
+
def create_timestamp(_arg0, _arg1, _arg2); end
|
1450
|
+
def default_policy_id; end
|
1451
|
+
def default_policy_id=(_arg0); end
|
1452
|
+
def gen_time; end
|
1453
|
+
def gen_time=(_arg0); end
|
1454
|
+
def serial_number; end
|
1455
|
+
def serial_number=(_arg0); end
|
1456
|
+
end
|
1457
|
+
|
1458
|
+
class OpenSSL::Timestamp::Request
|
1459
|
+
def initialize(*_arg0); end
|
1460
|
+
|
1461
|
+
def algorithm; end
|
1462
|
+
def algorithm=(_arg0); end
|
1463
|
+
def cert_requested=(_arg0); end
|
1464
|
+
def cert_requested?; end
|
1465
|
+
def message_imprint; end
|
1466
|
+
def message_imprint=(_arg0); end
|
1467
|
+
def nonce; end
|
1468
|
+
def nonce=(_arg0); end
|
1469
|
+
def policy_id; end
|
1470
|
+
def policy_id=(_arg0); end
|
1471
|
+
def to_der; end
|
1472
|
+
def version; end
|
1473
|
+
def version=(_arg0); end
|
1474
|
+
end
|
1475
|
+
|
1476
|
+
class OpenSSL::Timestamp::Response
|
1477
|
+
def initialize(_arg0); end
|
1478
|
+
|
1479
|
+
def failure_info; end
|
1480
|
+
def status; end
|
1481
|
+
def status_text; end
|
1482
|
+
def to_der; end
|
1483
|
+
def token; end
|
1484
|
+
def token_info; end
|
1485
|
+
def tsa_certificate; end
|
1486
|
+
def verify(*_arg0); end
|
1487
|
+
end
|
1488
|
+
|
1489
|
+
OpenSSL::Timestamp::Response::GRANTED = T.let(T.unsafe(nil), Integer)
|
1490
|
+
OpenSSL::Timestamp::Response::GRANTED_WITH_MODS = T.let(T.unsafe(nil), Integer)
|
1491
|
+
OpenSSL::Timestamp::Response::REJECTION = T.let(T.unsafe(nil), Integer)
|
1492
|
+
OpenSSL::Timestamp::Response::REVOCATION_NOTIFICATION = T.let(T.unsafe(nil), Integer)
|
1493
|
+
OpenSSL::Timestamp::Response::REVOCATION_WARNING = T.let(T.unsafe(nil), Integer)
|
1494
|
+
OpenSSL::Timestamp::Response::WAITING = T.let(T.unsafe(nil), Integer)
|
1495
|
+
class OpenSSL::Timestamp::TimestampError < ::OpenSSL::OpenSSLError; end
|
1496
|
+
|
1497
|
+
class OpenSSL::Timestamp::TokenInfo
|
1498
|
+
def initialize(_arg0); end
|
1499
|
+
|
1500
|
+
def algorithm; end
|
1501
|
+
def gen_time; end
|
1502
|
+
def message_imprint; end
|
1503
|
+
def nonce; end
|
1504
|
+
def ordering; end
|
1505
|
+
def policy_id; end
|
1506
|
+
def serial_number; end
|
1507
|
+
def to_der; end
|
1508
|
+
def version; end
|
1509
|
+
end
|
1510
|
+
|
1511
|
+
class OpenSSL::X509::Attribute
|
1512
|
+
include ::OpenSSL::Marshal
|
1513
|
+
extend ::OpenSSL::Marshal::ClassMethods
|
1514
|
+
|
1515
|
+
# source://openssl//openssl/x509.rb#330
|
1516
|
+
def ==(other); end
|
1517
|
+
end
|
1518
|
+
|
1519
|
+
class OpenSSL::X509::CRL
|
1520
|
+
include ::OpenSSL::Marshal
|
1521
|
+
include ::OpenSSL::X509::Extension::Helpers
|
1522
|
+
include ::OpenSSL::X509::Extension::AuthorityKeyIdentifier
|
1523
|
+
extend ::OpenSSL::Marshal::ClassMethods
|
1524
|
+
|
1525
|
+
# source://openssl//openssl/x509.rb#369
|
1526
|
+
def ==(other); end
|
1527
|
+
end
|
1528
|
+
|
1529
|
+
class OpenSSL::X509::Certificate
|
1530
|
+
include ::OpenSSL::Marshal
|
1531
|
+
include ::OpenSSL::X509::Extension::Helpers
|
1532
|
+
include ::OpenSSL::X509::Extension::SubjectKeyIdentifier
|
1533
|
+
include ::OpenSSL::X509::Extension::AuthorityKeyIdentifier
|
1534
|
+
include ::OpenSSL::X509::Extension::CRLDistributionPoints
|
1535
|
+
include ::OpenSSL::X509::Extension::AuthorityInfoAccess
|
1536
|
+
extend ::OpenSSL::Marshal::ClassMethods
|
1537
|
+
|
1538
|
+
# source://openssl//openssl/x509.rb#349
|
1539
|
+
def pretty_print(q); end
|
1540
|
+
|
1541
|
+
class << self
|
1542
|
+
# source://openssl//openssl/x509.rb#360
|
1543
|
+
def load_file(path); end
|
1544
|
+
end
|
1545
|
+
end
|
1546
|
+
|
1547
|
+
class OpenSSL::X509::Extension
|
1548
|
+
include ::OpenSSL::Marshal
|
1549
|
+
extend ::OpenSSL::Marshal::ClassMethods
|
1550
|
+
|
1551
|
+
# source://openssl//openssl/x509.rb#48
|
1552
|
+
def ==(other); end
|
1553
|
+
|
1554
|
+
# source://openssl//openssl/x509.rb#64
|
1555
|
+
def to_a; end
|
1556
|
+
|
1557
|
+
# {"oid"=>sn|ln, "value"=>value, "critical"=>true|false}
|
1558
|
+
#
|
1559
|
+
# source://openssl//openssl/x509.rb#60
|
1560
|
+
def to_h; end
|
1561
|
+
|
1562
|
+
# "oid = critical, value"
|
1563
|
+
#
|
1564
|
+
# source://openssl//openssl/x509.rb#53
|
1565
|
+
def to_s; end
|
1566
|
+
end
|
1567
|
+
|
1568
|
+
module OpenSSL::X509::Extension::AuthorityInfoAccess
|
1569
|
+
include ::OpenSSL::X509::Extension::Helpers
|
1570
|
+
|
1571
|
+
# Get the information and services for the issuer from the certificate's
|
1572
|
+
# authority information access extension exteension, as described in RFC5280
|
1573
|
+
# Section 4.2.2.1.
|
1574
|
+
#
|
1575
|
+
# Returns an array of strings or nil or raises ASN1::ASN1Error.
|
1576
|
+
#
|
1577
|
+
# source://openssl//openssl/x509.rb#162
|
1578
|
+
def ca_issuer_uris; end
|
1579
|
+
|
1580
|
+
# Get the URIs for OCSP from the certificate's authority information access
|
1581
|
+
# extension exteension, as described in RFC5280 Section 4.2.2.1.
|
1582
|
+
#
|
1583
|
+
# Returns an array of strings or nil or raises ASN1::ASN1Error.
|
1584
|
+
#
|
1585
|
+
# source://openssl//openssl/x509.rb#177
|
1586
|
+
def ocsp_uris; end
|
1587
|
+
|
1588
|
+
private
|
1589
|
+
|
1590
|
+
# source://openssl//openssl/x509.rb#190
|
1591
|
+
def parse_aia_asn1; end
|
1592
|
+
end
|
1593
|
+
|
1594
|
+
module OpenSSL::X509::Extension::AuthorityKeyIdentifier
|
1595
|
+
include ::OpenSSL::X509::Extension::Helpers
|
1596
|
+
|
1597
|
+
# Get the issuing certificate's key identifier from the
|
1598
|
+
# authorityKeyIdentifier extension, as described in RFC5280
|
1599
|
+
# Section 4.2.1.1
|
1600
|
+
#
|
1601
|
+
# Returns the binary String keyIdentifier or nil or raises
|
1602
|
+
# ASN1::ASN1Error.
|
1603
|
+
#
|
1604
|
+
# source://openssl//openssl/x509.rb#104
|
1605
|
+
def authority_key_identifier; end
|
1606
|
+
end
|
1607
|
+
|
1608
|
+
module OpenSSL::X509::Extension::CRLDistributionPoints
|
1609
|
+
include ::OpenSSL::X509::Extension::Helpers
|
1610
|
+
|
1611
|
+
# Get the distributionPoint fullName URI from the certificate's CRL
|
1612
|
+
# distribution points extension, as described in RFC5280 Section
|
1613
|
+
# 4.2.1.13
|
1614
|
+
#
|
1615
|
+
# Returns an array of strings or nil or raises ASN1::ASN1Error.
|
1616
|
+
#
|
1617
|
+
# source://openssl//openssl/x509.rb#129
|
1618
|
+
def crl_uris; end
|
1619
|
+
end
|
1620
|
+
|
1621
|
+
module OpenSSL::X509::Extension::Helpers
|
1622
|
+
# source://openssl//openssl/x509.rb#69
|
1623
|
+
def find_extension(oid); end
|
1624
|
+
end
|
1625
|
+
|
1626
|
+
module OpenSSL::X509::Extension::SubjectKeyIdentifier
|
1627
|
+
include ::OpenSSL::X509::Extension::Helpers
|
1628
|
+
|
1629
|
+
# Get the subject's key identifier from the subjectKeyIdentifier
|
1630
|
+
# exteension, as described in RFC5280 Section 4.2.1.2.
|
1631
|
+
#
|
1632
|
+
# Returns the binary String key identifier or nil or raises
|
1633
|
+
# ASN1::ASN1Error.
|
1634
|
+
#
|
1635
|
+
# source://openssl//openssl/x509.rb#82
|
1636
|
+
def subject_key_identifier; end
|
1637
|
+
end
|
1638
|
+
|
1639
|
+
class OpenSSL::X509::Name
|
1640
|
+
include ::Comparable
|
1641
|
+
include ::OpenSSL::Marshal
|
1642
|
+
extend ::OpenSSL::Marshal::ClassMethods
|
1643
|
+
|
1644
|
+
# source://openssl//openssl/x509.rb#319
|
1645
|
+
def pretty_print(q); end
|
1646
|
+
|
1647
|
+
class << self
|
1648
|
+
# Parses the string representation of a distinguished name. Two
|
1649
|
+
# different forms are supported:
|
1650
|
+
#
|
1651
|
+
# - \OpenSSL format (<tt>X509_NAME_oneline()</tt>) used by
|
1652
|
+
# <tt>#to_s</tt>. For example: <tt>/DC=com/DC=example/CN=nobody</tt>
|
1653
|
+
# - \OpenSSL format (<tt>X509_NAME_print()</tt>)
|
1654
|
+
# used by <tt>#to_s(OpenSSL::X509::Name::COMPAT)</tt>. For example:
|
1655
|
+
# <tt>DC=com, DC=example, CN=nobody</tt>
|
1656
|
+
#
|
1657
|
+
# Neither of them is standardized and has quirks and inconsistencies
|
1658
|
+
# in handling of escaped characters or multi-valued RDNs.
|
1659
|
+
#
|
1660
|
+
# Use of this method is discouraged in new applications. See
|
1661
|
+
# Name.parse_rfc2253 and #to_utf8 for the alternative.
|
1662
|
+
#
|
1663
|
+
# source://openssl//openssl/x509.rb#305
|
1664
|
+
def parse(str, template = T.unsafe(nil)); end
|
1665
|
+
|
1666
|
+
# Parses the string representation of a distinguished name. Two
|
1667
|
+
# different forms are supported:
|
1668
|
+
#
|
1669
|
+
# - \OpenSSL format (<tt>X509_NAME_oneline()</tt>) used by
|
1670
|
+
# <tt>#to_s</tt>. For example: <tt>/DC=com/DC=example/CN=nobody</tt>
|
1671
|
+
# - \OpenSSL format (<tt>X509_NAME_print()</tt>)
|
1672
|
+
# used by <tt>#to_s(OpenSSL::X509::Name::COMPAT)</tt>. For example:
|
1673
|
+
# <tt>DC=com, DC=example, CN=nobody</tt>
|
1674
|
+
#
|
1675
|
+
# Neither of them is standardized and has quirks and inconsistencies
|
1676
|
+
# in handling of escaped characters or multi-valued RDNs.
|
1677
|
+
#
|
1678
|
+
# Use of this method is discouraged in new applications. See
|
1679
|
+
# Name.parse_rfc2253 and #to_utf8 for the alternative.
|
1680
|
+
#
|
1681
|
+
# source://openssl//openssl/x509.rb#305
|
1682
|
+
def parse_openssl(str, template = T.unsafe(nil)); end
|
1683
|
+
|
1684
|
+
# Parses the UTF-8 string representation of a distinguished name,
|
1685
|
+
# according to RFC 2253.
|
1686
|
+
#
|
1687
|
+
# See also #to_utf8 for the opposite operation.
|
1688
|
+
#
|
1689
|
+
# source://openssl//openssl/x509.rb#286
|
1690
|
+
def parse_rfc2253(str, template = T.unsafe(nil)); end
|
1691
|
+
end
|
1692
|
+
end
|
1693
|
+
|
1694
|
+
module OpenSSL::X509::Name::RFC2253DN
|
1695
|
+
private
|
1696
|
+
|
1697
|
+
# source://openssl//openssl/x509.rb#237
|
1698
|
+
def expand_hexstring(str); end
|
1699
|
+
|
1700
|
+
# source://openssl//openssl/x509.rb#225
|
1701
|
+
def expand_pair(str); end
|
1702
|
+
|
1703
|
+
# source://openssl//openssl/x509.rb#244
|
1704
|
+
def expand_value(str1, str2, str3); end
|
1705
|
+
|
1706
|
+
# source://openssl//openssl/x509.rb#251
|
1707
|
+
def scan(dn); end
|
1708
|
+
|
1709
|
+
class << self
|
1710
|
+
# source://openssl//openssl/x509.rb#237
|
1711
|
+
def expand_hexstring(str); end
|
1712
|
+
|
1713
|
+
# source://openssl//openssl/x509.rb#225
|
1714
|
+
def expand_pair(str); end
|
1715
|
+
|
1716
|
+
# source://openssl//openssl/x509.rb#244
|
1717
|
+
def expand_value(str1, str2, str3); end
|
1718
|
+
|
1719
|
+
# source://openssl//openssl/x509.rb#251
|
1720
|
+
def scan(dn); end
|
1721
|
+
end
|
1722
|
+
end
|
1723
|
+
|
1724
|
+
class OpenSSL::X509::Request
|
1725
|
+
include ::OpenSSL::Marshal
|
1726
|
+
extend ::OpenSSL::Marshal::ClassMethods
|
1727
|
+
|
1728
|
+
# source://openssl//openssl/x509.rb#385
|
1729
|
+
def ==(other); end
|
1730
|
+
end
|
1731
|
+
|
1732
|
+
class OpenSSL::X509::Revoked
|
1733
|
+
# source://openssl//openssl/x509.rb#376
|
1734
|
+
def ==(other); end
|
1735
|
+
end
|