rbs 3.6.1 → 3.9.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (268) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/comments.yml +2 -2
  3. data/.github/workflows/dependabot.yml +1 -1
  4. data/.github/workflows/ruby.yml +34 -10
  5. data/.github/workflows/windows.yml +20 -3
  6. data/.gitignore +1 -0
  7. data/.rubocop.yml +26 -1
  8. data/CHANGELOG.md +241 -0
  9. data/Rakefile +54 -4
  10. data/config.yml +317 -0
  11. data/core/array.rbs +1756 -1591
  12. data/core/basic_object.rbs +38 -35
  13. data/core/comparable.rbs +1 -1
  14. data/core/complex.rbs +166 -94
  15. data/core/data.rbs +2 -2
  16. data/core/dir.rbs +2 -18
  17. data/core/encoding.rbs +12 -32
  18. data/core/enumerable.rbs +270 -266
  19. data/core/enumerator.rbs +14 -4
  20. data/core/env.rbs +1 -1
  21. data/core/errno.rbs +33 -16
  22. data/core/errors.rbs +6 -2
  23. data/core/exception.rbs +342 -167
  24. data/core/fiber.rbs +3 -2
  25. data/core/file.rbs +26 -75
  26. data/core/float.rbs +125 -72
  27. data/core/gc.rbs +158 -42
  28. data/core/hash.rbs +122 -143
  29. data/core/integer.rbs +79 -50
  30. data/core/io/buffer.rbs +49 -43
  31. data/core/io.rbs +108 -151
  32. data/core/kernel.rbs +341 -209
  33. data/core/match_data.rbs +76 -2
  34. data/core/math.rbs +0 -36
  35. data/core/method.rbs +2 -2
  36. data/core/module.rbs +32 -27
  37. data/core/nil_class.rbs +2 -2
  38. data/core/numeric.rbs +101 -104
  39. data/core/object.rbs +1 -5
  40. data/core/object_space/weak_key_map.rbs +3 -4
  41. data/core/object_space.rbs +3 -3
  42. data/core/proc.rbs +82 -14
  43. data/core/process.rbs +110 -58
  44. data/core/ractor.rbs +57 -4
  45. data/core/range.rbs +114 -87
  46. data/core/rational.rbs +0 -2
  47. data/core/rbs/unnamed/argf.rbs +237 -36
  48. data/core/rbs/unnamed/env_class.rbs +35 -53
  49. data/core/rbs/unnamed/random.rbs +1 -2
  50. data/core/regexp.rbs +10 -56
  51. data/core/ruby_vm.rbs +88 -9
  52. data/core/rubygems/config_file.rbs +3 -0
  53. data/core/rubygems/errors.rbs +3 -6
  54. data/core/rubygems/platform.rbs +0 -9
  55. data/core/rubygems/rubygems.rbs +3 -6
  56. data/core/rubygems/version.rbs +8 -8
  57. data/core/set.rbs +4 -16
  58. data/core/string.rbs +271 -264
  59. data/core/struct.rbs +6 -18
  60. data/core/symbol.rbs +14 -21
  61. data/core/thread.rbs +32 -35
  62. data/core/time.rbs +131 -50
  63. data/core/trace_point.rbs +124 -113
  64. data/core/true_class.rbs +0 -1
  65. data/core/unbound_method.rbs +1 -1
  66. data/core/warning.rbs +9 -2
  67. data/docs/architecture.md +1 -1
  68. data/docs/syntax.md +17 -10
  69. data/ext/rbs_extension/extconf.rb +11 -0
  70. data/ext/rbs_extension/location.c +61 -29
  71. data/ext/rbs_extension/location.h +4 -3
  72. data/ext/rbs_extension/main.c +23 -1
  73. data/ext/rbs_extension/parser.c +506 -517
  74. data/ext/rbs_extension/parserstate.c +109 -30
  75. data/ext/rbs_extension/parserstate.h +6 -4
  76. data/ext/rbs_extension/rbs_extension.h +1 -10
  77. data/{ext/rbs_extension → include/rbs}/constants.h +21 -19
  78. data/include/rbs/ruby_objs.h +72 -0
  79. data/include/rbs/util/rbs_constant_pool.h +219 -0
  80. data/include/rbs.h +7 -0
  81. data/lib/rbs/annotate/annotations.rb +3 -3
  82. data/lib/rbs/annotate/rdoc_source.rb +2 -2
  83. data/lib/rbs/ast/declarations.rb +9 -4
  84. data/lib/rbs/ast/directives.rb +10 -0
  85. data/lib/rbs/ast/members.rb +2 -0
  86. data/lib/rbs/ast/type_param.rb +2 -12
  87. data/lib/rbs/cli/diff.rb +3 -3
  88. data/lib/rbs/cli/validate.rb +2 -1
  89. data/lib/rbs/cli.rb +16 -16
  90. data/lib/rbs/collection/config/lockfile_generator.rb +58 -8
  91. data/lib/rbs/collection/config.rb +5 -3
  92. data/lib/rbs/collection/sources/rubygems.rb +1 -1
  93. data/lib/rbs/collection.rb +1 -0
  94. data/lib/rbs/definition.rb +51 -34
  95. data/lib/rbs/definition_builder/ancestor_builder.rb +5 -3
  96. data/lib/rbs/definition_builder.rb +83 -24
  97. data/lib/rbs/environment.rb +33 -18
  98. data/lib/rbs/environment_loader.rb +6 -1
  99. data/lib/rbs/errors.rb +24 -0
  100. data/lib/rbs/locator.rb +2 -0
  101. data/lib/rbs/method_type.rb +2 -0
  102. data/lib/rbs/namespace.rb +1 -0
  103. data/lib/rbs/parser_aux.rb +40 -3
  104. data/lib/rbs/prototype/rb.rb +20 -12
  105. data/lib/rbs/prototype/rbi.rb +11 -6
  106. data/lib/rbs/prototype/runtime/value_object_generator.rb +7 -5
  107. data/lib/rbs/prototype/runtime.rb +7 -5
  108. data/lib/rbs/subtractor.rb +3 -3
  109. data/lib/rbs/test/hook.rb +47 -42
  110. data/lib/rbs/test/type_check.rb +7 -5
  111. data/lib/rbs/type_name.rb +14 -9
  112. data/lib/rbs/types.rb +63 -14
  113. data/lib/rbs/unit_test/spy.rb +4 -2
  114. data/lib/rbs/unit_test/type_assertions.rb +19 -13
  115. data/lib/rbs/unit_test/with_aliases.rb +3 -1
  116. data/lib/rbs/validator.rb +7 -1
  117. data/lib/rbs/version.rb +1 -1
  118. data/lib/rbs/writer.rb +10 -5
  119. data/lib/rbs.rb +1 -0
  120. data/lib/rdoc_plugin/parser.rb +2 -2
  121. data/rbs.gemspec +6 -2
  122. data/sig/ancestor_graph.rbs +5 -5
  123. data/sig/annotate/rdoc_source.rbs +2 -0
  124. data/sig/cli.rbs +2 -0
  125. data/sig/collection/config/lockfile_generator.rbs +9 -1
  126. data/sig/declarations.rbs +10 -3
  127. data/sig/definition.rbs +80 -12
  128. data/sig/definition_builder.rbs +18 -4
  129. data/sig/directives.rbs +17 -1
  130. data/sig/environment.rbs +3 -1
  131. data/sig/errors.rbs +19 -0
  132. data/sig/namespace.rbs +2 -3
  133. data/sig/parser.rbs +5 -1
  134. data/sig/prototype/rb.rbs +1 -1
  135. data/sig/resolver/constant_resolver.rbs +2 -2
  136. data/sig/resolver/context.rbs +1 -1
  137. data/sig/subtractor.rbs +1 -1
  138. data/sig/test/type_check.rbs +2 -2
  139. data/sig/type_alias_dependency.rbs +2 -2
  140. data/sig/type_alias_regularity.rbs +6 -6
  141. data/sig/type_param.rbs +4 -4
  142. data/sig/typename.rbs +8 -5
  143. data/sig/types.rbs +1 -1
  144. data/sig/unit_test/spy.rbs +2 -0
  145. data/sig/unit_test/type_assertions.rbs +2 -0
  146. data/sig/use_map.rbs +1 -1
  147. data/sig/validator.rbs +6 -2
  148. data/sig/vendorer.rbs +1 -1
  149. data/sig/writer.rbs +1 -1
  150. data/{ext/rbs_extension → src}/constants.c +35 -36
  151. data/src/ruby_objs.c +799 -0
  152. data/src/util/rbs_constant_pool.c +342 -0
  153. data/stdlib/base64/0/base64.rbs +0 -9
  154. data/stdlib/benchmark/0/benchmark.rbs +11 -2
  155. data/stdlib/bigdecimal/0/big_decimal.rbs +26 -182
  156. data/stdlib/cgi/0/core.rbs +60 -3
  157. data/stdlib/cgi/0/manifest.yaml +1 -0
  158. data/stdlib/coverage/0/coverage.rbs +0 -3
  159. data/stdlib/csv/0/csv.rbs +18 -58
  160. data/stdlib/csv/0/manifest.yaml +1 -0
  161. data/stdlib/date/0/date.rbs +27 -42
  162. data/stdlib/did_you_mean/0/did_you_mean.rbs +1 -6
  163. data/stdlib/digest/0/digest.rbs +25 -2
  164. data/stdlib/erb/0/erb.rbs +0 -1
  165. data/stdlib/etc/0/etc.rbs +51 -34
  166. data/stdlib/fileutils/0/fileutils.rbs +3 -44
  167. data/stdlib/io-console/0/io-console.rbs +69 -15
  168. data/stdlib/ipaddr/0/ipaddr.rbs +16 -4
  169. data/stdlib/json/0/json.rbs +107 -120
  170. data/stdlib/logger/0/log_device.rbs +1 -1
  171. data/stdlib/logger/0/logger.rbs +3 -18
  172. data/stdlib/minitest/0/kernel.rbs +2 -2
  173. data/stdlib/minitest/0/minitest/abstract_reporter.rbs +4 -1
  174. data/stdlib/minitest/0/minitest/assertion.rbs +1 -0
  175. data/stdlib/minitest/0/minitest/assertions.rbs +58 -13
  176. data/stdlib/minitest/0/minitest/backtrace_filter.rbs +7 -0
  177. data/stdlib/minitest/0/minitest/bench_spec.rbs +8 -8
  178. data/stdlib/minitest/0/minitest/benchmark.rbs +17 -16
  179. data/stdlib/minitest/0/minitest/compress.rbs +13 -0
  180. data/stdlib/minitest/0/minitest/error_on_warning.rbs +3 -0
  181. data/stdlib/minitest/0/minitest/mock.rbs +9 -5
  182. data/stdlib/minitest/0/minitest/parallel/executor.rbs +4 -0
  183. data/stdlib/minitest/0/minitest/parallel/test/class_methods.rbs +0 -1
  184. data/stdlib/minitest/0/minitest/pride_io.rbs +8 -0
  185. data/stdlib/minitest/0/minitest/pride_lol.rbs +2 -0
  186. data/stdlib/minitest/0/minitest/progress_reporter.rbs +1 -1
  187. data/stdlib/minitest/0/minitest/reportable.rbs +2 -0
  188. data/stdlib/minitest/0/minitest/runnable.rbs +33 -1
  189. data/stdlib/minitest/0/minitest/spec/dsl/instance_methods.rbs +1 -1
  190. data/stdlib/minitest/0/minitest/spec/dsl.rbs +10 -6
  191. data/stdlib/minitest/0/minitest/spec.rbs +1 -1
  192. data/stdlib/minitest/0/minitest/statistics_reporter.rbs +5 -0
  193. data/stdlib/minitest/0/minitest/summary_reporter.rbs +0 -7
  194. data/stdlib/minitest/0/minitest/test/lifecycle_hooks.rbs +1 -1
  195. data/stdlib/minitest/0/minitest/test.rbs +7 -14
  196. data/stdlib/minitest/0/minitest/unexpected_error.rbs +2 -0
  197. data/stdlib/minitest/0/minitest/unexpected_warning.rbs +6 -0
  198. data/stdlib/minitest/0/minitest/unit.rbs +1 -2
  199. data/stdlib/minitest/0/minitest.rbs +41 -892
  200. data/stdlib/monitor/0/monitor.rbs +13 -4
  201. data/stdlib/net-http/0/net-http.rbs +42 -109
  202. data/stdlib/nkf/0/nkf.rbs +30 -0
  203. data/stdlib/objspace/0/objspace.rbs +1 -2
  204. data/stdlib/observable/0/observable.rbs +1 -1
  205. data/stdlib/open-uri/0/manifest.yaml +1 -0
  206. data/stdlib/open-uri/0/open-uri.rbs +52 -0
  207. data/stdlib/open3/0/open3.rbs +0 -8
  208. data/stdlib/openssl/0/manifest.yaml +1 -0
  209. data/stdlib/openssl/0/openssl.rbs +235 -143
  210. data/stdlib/optparse/0/optparse.rbs +58 -18
  211. data/stdlib/pathname/0/pathname.rbs +2 -8
  212. data/stdlib/pp/0/pp.rbs +3 -1
  213. data/stdlib/prettyprint/0/prettyprint.rbs +0 -4
  214. data/stdlib/pstore/0/pstore.rbs +0 -6
  215. data/stdlib/psych/0/core_ext.rbs +12 -0
  216. data/stdlib/psych/0/psych.rbs +15 -4
  217. data/stdlib/pty/0/pty.rbs +46 -4
  218. data/stdlib/rdoc/0/code_object.rbs +0 -4
  219. data/stdlib/rdoc/0/markup.rbs +10 -12
  220. data/stdlib/rdoc/0/rdoc.rbs +13 -8
  221. data/stdlib/resolv/0/resolv.rbs +21 -12
  222. data/stdlib/ripper/0/ripper.rbs +0 -2
  223. data/stdlib/securerandom/0/securerandom.rbs +7 -2
  224. data/stdlib/shellwords/0/shellwords.rbs +11 -12
  225. data/stdlib/singleton/0/singleton.rbs +0 -1
  226. data/stdlib/socket/0/addrinfo.rbs +1 -2
  227. data/stdlib/socket/0/basic_socket.rbs +0 -5
  228. data/stdlib/socket/0/socket.rbs +32 -27
  229. data/stdlib/socket/0/tcp_server.rbs +0 -3
  230. data/stdlib/socket/0/tcp_socket.rbs +36 -3
  231. data/stdlib/socket/0/udp_socket.rbs +0 -1
  232. data/stdlib/socket/0/unix_server.rbs +0 -3
  233. data/stdlib/socket/0/unix_socket.rbs +4 -2
  234. data/{core/string_io.rbs → stdlib/stringio/0/stringio.rbs} +1 -1
  235. data/stdlib/strscan/0/string_scanner.rbs +1265 -422
  236. data/stdlib/tempfile/0/tempfile.rbs +135 -28
  237. data/stdlib/time/0/time.rbs +48 -35
  238. data/stdlib/timeout/0/timeout.rbs +11 -8
  239. data/stdlib/tmpdir/0/tmpdir.rbs +10 -3
  240. data/stdlib/tsort/0/tsort.rbs +0 -4
  241. data/stdlib/uri/0/common.rbs +28 -30
  242. data/stdlib/uri/0/ftp.rbs +1 -1
  243. data/stdlib/uri/0/generic.rbs +22 -18
  244. data/stdlib/uri/0/http.rbs +2 -2
  245. data/stdlib/uri/0/rfc2396_parser.rbs +3 -0
  246. data/stdlib/zlib/0/buf_error.rbs +1 -70
  247. data/stdlib/zlib/0/data_error.rbs +1 -70
  248. data/stdlib/zlib/0/deflate.rbs +8 -72
  249. data/stdlib/zlib/0/error.rbs +1 -70
  250. data/stdlib/zlib/0/gzip_file/crc_error.rbs +2 -105
  251. data/stdlib/zlib/0/gzip_file/error.rbs +2 -105
  252. data/stdlib/zlib/0/gzip_file/length_error.rbs +2 -105
  253. data/stdlib/zlib/0/gzip_file/no_footer.rbs +2 -105
  254. data/stdlib/zlib/0/gzip_file.rbs +1 -71
  255. data/stdlib/zlib/0/gzip_reader.rbs +3 -74
  256. data/stdlib/zlib/0/gzip_writer.rbs +1 -70
  257. data/stdlib/zlib/0/inflate.rbs +4 -71
  258. data/stdlib/zlib/0/mem_error.rbs +1 -70
  259. data/stdlib/zlib/0/need_dict.rbs +1 -70
  260. data/stdlib/zlib/0/stream_end.rbs +1 -70
  261. data/stdlib/zlib/0/stream_error.rbs +1 -70
  262. data/stdlib/zlib/0/version_error.rbs +1 -70
  263. data/stdlib/zlib/0/zlib.rbs +0 -2
  264. data/stdlib/zlib/0/zstream.rbs +4 -72
  265. metadata +17 -13
  266. data/ext/rbs_extension/ruby_objs.c +0 -602
  267. data/ext/rbs_extension/ruby_objs.h +0 -51
  268. data/stdlib/minitest/0/manifest.yaml +0 -2
@@ -549,8 +549,10 @@ module OpenSSL
549
549
  #
550
550
  # OpenSSL 3
551
551
  # : `0xMNN00PP0 (major minor 00 patch 0)`
552
+ #
552
553
  # OpenSSL before 3
553
554
  # : `0xMNNFFPPS (major minor fix patch status)`
555
+ #
554
556
  # LibreSSL
555
557
  # : `0x20000000 (fixed value)`
556
558
  #
@@ -627,7 +629,6 @@ module OpenSSL
627
629
  # * `:APPLICATION`
628
630
  # * `:PRIVATE`
629
631
  #
630
- #
631
632
  # ## Tag constants
632
633
  #
633
634
  # There is a constant defined for each universal tag:
@@ -655,7 +656,6 @@ module OpenSSL
655
656
  # * OpenSSL::ASN1::UNIVERSALSTRING (28)
656
657
  # * OpenSSL::ASN1::BMPSTRING (30)
657
658
  #
658
- #
659
659
  # ## UNIVERSAL_TAG_NAME constant
660
660
  #
661
661
  # An Array that stores the name of a given tag number. These names are the same
@@ -775,7 +775,6 @@ module OpenSSL
775
775
  # * tag_class: Current tag class (Symbol)
776
776
  # * tag: The current tag number (Integer)
777
777
  #
778
- #
779
778
  # ## Example
780
779
  # der = File.binread('asn1data.der')
781
780
  # OpenSSL::ASN1.traverse(der) do | depth, offset, header_len, length, constructed, tag_class, tag|
@@ -871,7 +870,6 @@ module OpenSSL
871
870
  # * *tag* equal to 1
872
871
  # * *tag_class* equal to `:CONTEXT_SPECIFIC`
873
872
  # * *value* equal to a String that carries the raw encoding of the INTEGER.
874
- #
875
873
  # This implies that a subsequent decoding step is required to completely decode
876
874
  # implicitly tagged values.
877
875
  #
@@ -884,7 +882,6 @@ module OpenSSL
884
882
  # OpenSSL::ASN1::Integer, i.e. the inner element is the non-tagged primitive
885
883
  # value, and the tagging is represented in the outer ASN1Data
886
884
  #
887
- #
888
885
  # ## Example - Decoding an implicitly tagged INTEGER
889
886
  # int = OpenSSL::ASN1::Integer.new(1, 0, :IMPLICIT) # implicit 0-tagged
890
887
  # seq = OpenSSL::ASN1::Sequence.new( [int] )
@@ -934,7 +931,7 @@ module OpenSSL
934
931
  # puts int2.value # => 1
935
932
  #
936
933
  class ASN1Data
937
- # <!-- rdoc-file=ext/openssl/ossl_asn1.c -->
934
+ # <!-- rdoc-file=ext/openssl/lib/openssl/asn1.rb -->
938
935
  # Never `nil`. A boolean value indicating whether the encoding uses indefinite
939
936
  # length (in the case of parsing) or whether an indefinite length form shall be
940
937
  # used (in the encoding case). In DER, every value uses definite length form.
@@ -951,7 +948,7 @@ module OpenSSL
951
948
  #
952
949
  def indefinite_length: () -> bool
953
950
 
954
- # <!-- rdoc-file=ext/openssl/ossl_asn1.c -->
951
+ # <!-- rdoc-file=ext/openssl/lib/openssl/asn1.rb -->
955
952
  # Never `nil`. A boolean value indicating whether the encoding uses indefinite
956
953
  # length (in the case of parsing) or whether an indefinite length form shall be
957
954
  # used (in the encoding case). In DER, every value uses definite length form.
@@ -968,7 +965,7 @@ module OpenSSL
968
965
  #
969
966
  def indefinite_length=: [U] (boolish) -> U
970
967
 
971
- # <!-- rdoc-file=ext/openssl/ossl_asn1.c -->
968
+ # <!-- rdoc-file=ext/openssl/lib/openssl/asn1.rb -->
972
969
  # Never `nil`. A boolean value indicating whether the encoding uses indefinite
973
970
  # length (in the case of parsing) or whether an indefinite length form shall be
974
971
  # used (in the encoding case). In DER, every value uses definite length form.
@@ -985,7 +982,7 @@ module OpenSSL
985
982
  #
986
983
  alias infinite_length indefinite_length
987
984
 
988
- # <!-- rdoc-file=ext/openssl/ossl_asn1.c -->
985
+ # <!-- rdoc-file=ext/openssl/lib/openssl/asn1.rb -->
989
986
  # Never `nil`. A boolean value indicating whether the encoding uses indefinite
990
987
  # length (in the case of parsing) or whether an indefinite length form shall be
991
988
  # used (in the encoding case). In DER, every value uses definite length form.
@@ -1002,24 +999,24 @@ module OpenSSL
1002
999
  #
1003
1000
  alias infinite_length= indefinite_length=
1004
1001
 
1005
- # <!-- rdoc-file=ext/openssl/ossl_asn1.c -->
1002
+ # <!-- rdoc-file=ext/openssl/lib/openssl/asn1.rb -->
1006
1003
  # An Integer representing the tag number of this ASN1Data. Never `nil`.
1007
1004
  #
1008
1005
  def tag: () -> bn
1009
1006
 
1010
- # <!-- rdoc-file=ext/openssl/ossl_asn1.c -->
1007
+ # <!-- rdoc-file=ext/openssl/lib/openssl/asn1.rb -->
1011
1008
  # An Integer representing the tag number of this ASN1Data. Never `nil`.
1012
1009
  #
1013
1010
  def tag=: (::Integer) -> ::Integer
1014
1011
  | (BN) -> BN
1015
1012
 
1016
- # <!-- rdoc-file=ext/openssl/ossl_asn1.c -->
1013
+ # <!-- rdoc-file=ext/openssl/lib/openssl/asn1.rb -->
1017
1014
  # A Symbol representing the tag class of this ASN1Data. Never `nil`. See
1018
1015
  # ASN1Data for possible values.
1019
1016
  #
1020
1017
  def tag_class: () -> tag_class
1021
1018
 
1022
- # <!-- rdoc-file=ext/openssl/ossl_asn1.c -->
1019
+ # <!-- rdoc-file=ext/openssl/lib/openssl/asn1.rb -->
1023
1020
  # A Symbol representing the tag class of this ASN1Data. Never `nil`. See
1024
1021
  # ASN1Data for possible values.
1025
1022
  #
@@ -1036,13 +1033,13 @@ module OpenSSL
1036
1033
  #
1037
1034
  def to_der: () -> String
1038
1035
 
1039
- # <!-- rdoc-file=ext/openssl/ossl_asn1.c -->
1036
+ # <!-- rdoc-file=ext/openssl/lib/openssl/asn1.rb -->
1040
1037
  # Carries the value of a ASN.1 type. Please confer Constructive and Primitive
1041
1038
  # for the mappings between ASN.1 data types and Ruby classes.
1042
1039
  #
1043
1040
  def value: () -> untyped
1044
1041
 
1045
- # <!-- rdoc-file=ext/openssl/ossl_asn1.c -->
1042
+ # <!-- rdoc-file=ext/openssl/lib/openssl/asn1.rb -->
1046
1043
  # Carries the value of a ASN.1 type. Please confer Constructive and Primitive
1047
1044
  # for the mappings between ASN.1 data types and Ruby classes.
1048
1045
  #
@@ -1051,7 +1048,7 @@ module OpenSSL
1051
1048
  private
1052
1049
 
1053
1050
  # <!--
1054
- # rdoc-file=ext/openssl/ossl_asn1.c
1051
+ # rdoc-file=ext/openssl/lib/openssl/asn1.rb
1055
1052
  # - OpenSSL::ASN1::ASN1Data.new(value, tag, tag_class) => ASN1Data
1056
1053
  # -->
1057
1054
  # *value*: Please have a look at Constructive and Primitive to see how Ruby
@@ -1106,7 +1103,6 @@ module OpenSSL
1106
1103
  # encodings are represented by one of the two sub-classes of Constructive:
1107
1104
  # * OpenSSL::ASN1::Set
1108
1105
  # * OpenSSL::ASN1::Sequence
1109
- #
1110
1106
  # Please note that tagged sequences and sets are still parsed as instances of
1111
1107
  # ASN1Data. Find further details on tagged values there.
1112
1108
  #
@@ -1124,7 +1120,7 @@ module OpenSSL
1124
1120
  include Enumerable[ASN1Data]
1125
1121
 
1126
1122
  # <!--
1127
- # rdoc-file=ext/openssl/ossl_asn1.c
1123
+ # rdoc-file=ext/openssl/lib/openssl/asn1.rb
1128
1124
  # - asn1_ary.each { |asn1| block } => asn1_ary
1129
1125
  # -->
1130
1126
  # Calls the given block once for each element in self, passing that element as
@@ -1190,6 +1186,11 @@ module OpenSSL
1190
1186
 
1191
1187
  private
1192
1188
 
1189
+ # <!--
1190
+ # rdoc-file=ext/openssl/lib/openssl/asn1.rb
1191
+ # - new()
1192
+ # -->
1193
+ #
1193
1194
  def initialize: () -> void
1194
1195
  end
1195
1196
 
@@ -1271,7 +1272,7 @@ module OpenSSL
1271
1272
  # rdoc-file=ext/openssl/ossl_asn1.c
1272
1273
  # - oid == other_oid => true or false
1273
1274
  # -->
1274
- # Returns `true` if *other_oid* is the same as *oid*
1275
+ # Returns `true` if *other_oid* is the same as *oid*.
1275
1276
  #
1276
1277
  def ==: (ObjectId other) -> bool
1277
1278
 
@@ -1348,7 +1349,6 @@ module OpenSSL
1348
1349
  # * OpenSSL::ASN1::UniversalString <=> *value* is a String
1349
1350
  # * OpenSSL::ASN1::BMPString <=> *value* is a String
1350
1351
  #
1351
- #
1352
1352
  # ## OpenSSL::ASN1::BitString
1353
1353
  #
1354
1354
  # ### Additional attributes
@@ -1369,7 +1369,6 @@ module OpenSSL
1369
1369
  # * *short_name*: alias for *sn*.
1370
1370
  # * *long_name*: alias for *ln*.
1371
1371
  #
1372
- #
1373
1372
  # ## Examples
1374
1373
  # With the Exception of OpenSSL::ASN1::EndOfContent, each Primitive class
1375
1374
  # constructor takes at least one parameter, the *value*.
@@ -1528,49 +1527,49 @@ module OpenSSL
1528
1527
  # - bn % bn2 => aBN
1529
1528
  # -->
1530
1529
  #
1531
- def %: (int) -> instance
1530
+ def %: (bn) -> self
1532
1531
 
1533
1532
  # <!--
1534
1533
  # rdoc-file=ext/openssl/ossl_bn.c
1535
1534
  # - bn * bn2 => aBN
1536
1535
  # -->
1537
1536
  #
1538
- def *: (int) -> instance
1537
+ def *: (bn) -> self
1539
1538
 
1540
1539
  # <!--
1541
1540
  # rdoc-file=ext/openssl/ossl_bn.c
1542
1541
  # - bn ** bn2 => aBN
1543
1542
  # -->
1544
1543
  #
1545
- def **: (int) -> instance
1544
+ def **: (bn) -> self
1546
1545
 
1547
1546
  # <!--
1548
1547
  # rdoc-file=ext/openssl/ossl_bn.c
1549
1548
  # - bn + bn2 => aBN
1550
1549
  # -->
1551
1550
  #
1552
- def +: (int) -> instance
1551
+ def +: (bn) -> self
1553
1552
 
1554
1553
  # <!--
1555
1554
  # rdoc-file=ext/openssl/ossl_bn.c
1556
1555
  # - +bn -> aBN
1557
1556
  # -->
1558
1557
  #
1559
- def +@: () -> instance
1558
+ def +@: () -> self
1560
1559
 
1561
1560
  # <!--
1562
1561
  # rdoc-file=ext/openssl/ossl_bn.c
1563
1562
  # - bn - bn2 => aBN
1564
1563
  # -->
1565
1564
  #
1566
- def -: (int) -> instance
1565
+ def -: (bn) -> self
1567
1566
 
1568
1567
  # <!--
1569
1568
  # rdoc-file=ext/openssl/ossl_bn.c
1570
1569
  # - -bn -> aBN
1571
1570
  # -->
1572
1571
  #
1573
- def -@: () -> instance
1572
+ def -@: () -> self
1574
1573
 
1575
1574
  # <!--
1576
1575
  # rdoc-file=ext/openssl/ossl_bn.c
@@ -1578,14 +1577,14 @@ module OpenSSL
1578
1577
  # -->
1579
1578
  # Division of OpenSSL::BN instances
1580
1579
  #
1581
- def /: (int) -> [ instance, instance ]
1580
+ def /: (bn) -> [ self, self ]
1582
1581
 
1583
1582
  # <!--
1584
1583
  # rdoc-file=ext/openssl/ossl_bn.c
1585
1584
  # - bn << bits -> aBN
1586
1585
  # -->
1587
1586
  #
1588
- def <<: (int) -> instance
1587
+ def <<: (int) -> self
1589
1588
 
1590
1589
  # <!--
1591
1590
  # rdoc-file=ext/openssl/ossl_bn.c
@@ -1636,7 +1635,7 @@ module OpenSSL
1636
1635
  # - bn.cmp(bn2) => integer
1637
1636
  # -->
1638
1637
  #
1639
- def cmp: (Integer) -> Integer
1638
+ def cmp: (bn) -> Integer
1640
1639
 
1641
1640
  # <!--
1642
1641
  # rdoc-file=ext/openssl/ossl_bn.c
@@ -1651,7 +1650,7 @@ module OpenSSL
1651
1650
  # - copy(p1)
1652
1651
  # -->
1653
1652
  #
1654
- def copy: (int) -> instance
1653
+ def copy: (bn) -> self
1655
1654
 
1656
1655
  # <!--
1657
1656
  # rdoc-file=ext/openssl/ossl_bn.c
@@ -1667,7 +1666,7 @@ module OpenSSL
1667
1666
  # - bn.gcd(bn2) => aBN
1668
1667
  # -->
1669
1668
  #
1670
- def gcd: (int) -> instance
1669
+ def gcd: (bn) -> self
1671
1670
 
1672
1671
  # <!--
1673
1672
  # rdoc-file=ext/openssl/ossl_bn.c
@@ -1693,42 +1692,42 @@ module OpenSSL
1693
1692
  # - bn.mod_add(bn1, bn2) -> aBN
1694
1693
  # -->
1695
1694
  #
1696
- def mod_add: (int, int) -> instance
1695
+ def mod_add: (bn, bn) -> self
1697
1696
 
1698
1697
  # <!--
1699
1698
  # rdoc-file=ext/openssl/ossl_bn.c
1700
1699
  # - bn.mod_exp(bn1, bn2) -> aBN
1701
1700
  # -->
1702
1701
  #
1703
- def mod_exp: (int, int) -> instance
1702
+ def mod_exp: (bn, bn) -> self
1704
1703
 
1705
1704
  # <!--
1706
1705
  # rdoc-file=ext/openssl/ossl_bn.c
1707
1706
  # - bn.mod_inverse(bn2) => aBN
1708
1707
  # -->
1709
1708
  #
1710
- def mod_inverse: (int) -> instance
1709
+ def mod_inverse: (bn) -> self
1711
1710
 
1712
1711
  # <!--
1713
1712
  # rdoc-file=ext/openssl/ossl_bn.c
1714
1713
  # - bn.mod_mul(bn1, bn2) -> aBN
1715
1714
  # -->
1716
1715
  #
1717
- def mod_mul: (int, int) -> instance
1716
+ def mod_mul: (bn, bn) -> self
1718
1717
 
1719
1718
  # <!--
1720
1719
  # rdoc-file=ext/openssl/ossl_bn.c
1721
1720
  # - bn.mod_sqr(bn2) => aBN
1722
1721
  # -->
1723
1722
  #
1724
- def mod_sqr: (int) -> instance
1723
+ def mod_sqr: (bn) -> self
1725
1724
 
1726
1725
  # <!--
1727
1726
  # rdoc-file=ext/openssl/ossl_bn.c
1728
1727
  # - bn.mod_sub(bn1, bn2) -> aBN
1729
1728
  # -->
1730
1729
  #
1731
- def mod_sub: (int, int) -> instance
1730
+ def mod_sub: (bn, bn) -> self
1732
1731
 
1733
1732
  # <!--
1734
1733
  # rdoc-file=ext/openssl/ossl_bn.c
@@ -1816,7 +1815,7 @@ module OpenSSL
1816
1815
  # - bn.sqr => aBN
1817
1816
  # -->
1818
1817
  #
1819
- def sqr: () -> instance
1818
+ def sqr: () -> self
1820
1819
 
1821
1820
  # <!--
1822
1821
  # rdoc-file=ext/openssl/ossl_bn.c
@@ -1854,7 +1853,7 @@ module OpenSSL
1854
1853
  # bignum is ignored.
1855
1854
  # * `10` - Decimal number representation, with a leading '-' for a
1856
1855
  # negative bignum.
1857
- # * `16` - Hexadeciaml number representation, with a leading '-' for a
1856
+ # * `16` - Hexadecimal number representation, with a leading '-' for a
1858
1857
  # negative bignum.
1859
1858
  #
1860
1859
  def to_s: () -> String
@@ -1869,7 +1868,7 @@ module OpenSSL
1869
1868
  # - bn.ucmp(bn2) => integer
1870
1869
  # -->
1871
1870
  #
1872
- def ucmp: (int bn2) -> ::Integer
1871
+ def ucmp: (bn bn2) -> ::Integer
1873
1872
 
1874
1873
  # <!--
1875
1874
  # rdoc-file=ext/openssl/ossl_bn.c
@@ -1896,6 +1895,7 @@ module OpenSSL
1896
1895
  #
1897
1896
  # `string`
1898
1897
  # : The string to be parsed.
1898
+ #
1899
1899
  # `base`
1900
1900
  # : The format. Must be one of the following:
1901
1901
  # * `0` - MPI format. See the man page BN_mpi2bn(3) for details.
@@ -1903,11 +1903,11 @@ module OpenSSL
1903
1903
  # number.
1904
1904
  # * `10` - Decimal number representation, with a leading '-' for a
1905
1905
  # negative number.
1906
- # * `16` - Hexadeciaml number representation, with a leading '-' for a
1906
+ # * `16` - Hexadecimal number representation, with a leading '-' for a
1907
1907
  # negative number.
1908
1908
  #
1909
- def initialize: (instance) -> void
1910
- | (int) -> void
1909
+ def initialize: (self) -> void
1910
+ | (Integer) -> void
1911
1911
  | (string) -> void
1912
1912
  | (string, 0 | 2 | 10 | 16) -> void
1913
1913
 
@@ -1916,7 +1916,7 @@ module OpenSSL
1916
1916
  # - initialize_copy(p1)
1917
1917
  # -->
1918
1918
  #
1919
- def initialize_copy: (instance other) -> instance
1919
+ def initialize_copy: (self other) -> self
1920
1920
  end
1921
1921
 
1922
1922
  # <!-- rdoc-file=ext/openssl/ossl_bn.c -->
@@ -2013,7 +2013,7 @@ module OpenSSL
2013
2013
 
2014
2014
  # <!--
2015
2015
  # rdoc-file=ext/openssl/lib/openssl/buffering.rb
2016
- # - gets(eol=$/, limit=nil)
2016
+ # - gets(eol=$/, limit=nil, chomp: false)
2017
2017
  # -->
2018
2018
  # Reads the next "line" from the stream. Lines are separated by *eol*. If
2019
2019
  # *limit* is provided the result will not be longer than the given number of
@@ -2025,7 +2025,7 @@ module OpenSSL
2025
2025
  #
2026
2026
  # Unlike IO#gets the separator must be provided if a limit is provided.
2027
2027
  #
2028
- def gets: (?String | Regexp eol, ?Integer limit) -> String?
2028
+ def gets: (?String | Regexp eol, ?Integer limit, ?chomp: boolish) -> String?
2029
2029
 
2030
2030
  # <!--
2031
2031
  # rdoc-file=ext/openssl/lib/openssl/buffering.rb
@@ -2564,7 +2564,6 @@ module OpenSSL
2564
2564
  #
2565
2565
  # #key=, #iv=, #random_key, #random_iv, #pkcs5_keyivgen
2566
2566
  # :
2567
- #
2568
2567
  # Internally calls EVP_CipherInit_ex(ctx, NULL, NULL, NULL, NULL, 0).
2569
2568
  #
2570
2569
  def decrypt: () -> self
@@ -2580,7 +2579,6 @@ module OpenSSL
2580
2579
  #
2581
2580
  # #key=, #iv=, #random_key, #random_iv, #pkcs5_keyivgen
2582
2581
  # :
2583
- #
2584
2582
  # Internally calls EVP_CipherInit_ex(ctx, NULL, NULL, NULL, NULL, 1).
2585
2583
  #
2586
2584
  def encrypt: () -> self
@@ -2673,8 +2671,8 @@ module OpenSSL
2673
2671
  # rdoc-file=ext/openssl/ossl_cipher.c
2674
2672
  # - cipher.name -> string
2675
2673
  # -->
2676
- # Returns the name of the cipher which may differ slightly from the original
2677
- # name provided.
2674
+ # Returns the short name of the cipher which may differ slightly from the
2675
+ # original name provided.
2678
2676
  #
2679
2677
  def name: () -> String
2680
2678
 
@@ -2709,7 +2707,6 @@ module OpenSSL
2709
2707
  # * *iterations* is an integer with a default of 2048.
2710
2708
  # * *digest* is a Digest object that defaults to 'MD5'
2711
2709
  #
2712
- #
2713
2710
  # A minimum of 1000 iterations is recommended.
2714
2711
  #
2715
2712
  def pkcs5_keyivgen: (String pass, ?String salt, ?Integer iterations, ?String digest) -> void
@@ -3028,19 +3025,16 @@ module OpenSSL
3028
3025
  # -->
3029
3026
  # Gets the parsable form of the current configuration.
3030
3027
  #
3031
- # Given the following configuration being created:
3028
+ # Given the following configuration file being loaded:
3032
3029
  #
3033
- # config = OpenSSL::Config.new
3034
- # #=> #<OpenSSL::Config sections=[]>
3035
- # config['default'] = {"foo"=>"bar","baz"=>"buz"}
3036
- # #=> {"foo"=>"bar", "baz"=>"buz"}
3030
+ # config = OpenSSL::Config.load('baz.cnf')
3031
+ # #=> #<OpenSSL::Config sections=["default"]>
3037
3032
  # puts config.to_s
3038
3033
  # #=> [ default ]
3039
3034
  # # foo=bar
3040
3035
  # # baz=buz
3041
3036
  #
3042
- # You can parse get the serialized configuration using #to_s and then parse it
3043
- # later:
3037
+ # You can get the serialized configuration using #to_s and then parse it later:
3044
3038
  #
3045
3039
  # serialized_config = config.to_s
3046
3040
  # # much later...
@@ -3075,7 +3069,7 @@ module OpenSSL
3075
3069
  # - initialize_copy(p1)
3076
3070
  # -->
3077
3071
  #
3078
- def initialize_copy: (instance other) -> void
3072
+ def initialize_copy: (self other) -> void
3079
3073
 
3080
3074
  # <!-- rdoc-file=ext/openssl/ossl_config.c -->
3081
3075
  # The default system configuration file for OpenSSL.
@@ -3125,7 +3119,6 @@ module OpenSSL
3125
3119
  # * SHA3-224, SHA3-256, SHA3-384 and SHA3-512
3126
3120
  # * BLAKE2s256 and BLAKE2b512
3127
3121
  #
3128
- #
3129
3122
  # Each of these algorithms can be instantiated using the name:
3130
3123
  #
3131
3124
  # digest = OpenSSL::Digest.new('SHA256')
@@ -3164,7 +3157,7 @@ module OpenSSL
3164
3157
  # sha256.reset
3165
3158
  # digest2 = sha256.digest(data2)
3166
3159
  #
3167
- class Digest
3160
+ class Digest < ::Digest::Class
3168
3161
  # <!--
3169
3162
  # rdoc-file=ext/openssl/lib/openssl/digest.rb
3170
3163
  # - digest(name, data)
@@ -3226,7 +3219,8 @@ module OpenSSL
3226
3219
  # rdoc-file=ext/openssl/ossl_digest.c
3227
3220
  # - digest.name -> string
3228
3221
  # -->
3229
- # Returns the sn of this Digest algorithm.
3222
+ # Returns the short name of this Digest algorithm which may differ slightly from
3223
+ # the original name provided.
3230
3224
  #
3231
3225
  # ### Example
3232
3226
  # digest = OpenSSL::Digest.new('SHA512')
@@ -3273,7 +3267,8 @@ module OpenSSL
3273
3267
  # - Digest.new(string [, data]) -> Digest
3274
3268
  # -->
3275
3269
  # Creates a Digest instance based on *string*, which is either the ln (long
3276
- # name) or sn (short name) of a supported digest algorithm.
3270
+ # name) or sn (short name) of a supported digest algorithm. A list of supported
3271
+ # algorithms can be obtained by calling OpenSSL::Digest.digests.
3277
3272
  #
3278
3273
  # If *data* (a String) is given, it is used as the initial input to the Digest
3279
3274
  # instance, i.e.
@@ -3292,7 +3287,7 @@ module OpenSSL
3292
3287
  # - initialize_copy(p1)
3293
3288
  # -->
3294
3289
  #
3295
- def initialize_copy: (instance) -> void
3290
+ def initialize_copy: (self) -> void
3296
3291
 
3297
3292
  class Digest < OpenSSL::Digest
3298
3293
  end
@@ -3562,6 +3557,7 @@ module OpenSSL
3562
3557
  #
3563
3558
  # All flags
3564
3559
  # : 0xFFFF
3560
+ #
3565
3561
  # No flags
3566
3562
  # : 0x0000
3567
3563
  #
@@ -3665,6 +3661,23 @@ module OpenSSL
3665
3661
  #
3666
3662
  def self.hexdigest: (String | Digest algo, String key, String data) -> String
3667
3663
 
3664
+ # <!--
3665
+ # rdoc-file=ext/openssl/lib/openssl/hmac.rb
3666
+ # - HMAC.base64digest(digest, key, data) -> aString
3667
+ # -->
3668
+ # Returns the authentication code as a Base64-encoded string. The *digest*
3669
+ # parameter specifies the digest algorithm to use. This may be a String
3670
+ # representing the algorithm name or an instance of OpenSSL::Digest.
3671
+ #
3672
+ # ### Example
3673
+ # key = 'key'
3674
+ # data = 'The quick brown fox jumps over the lazy dog'
3675
+ #
3676
+ # hmac = OpenSSL::HMAC.base64digest('SHA1', key, data)
3677
+ # #=> "3nybhbi3iqa8ino29wqQcBydtNk="
3678
+ #
3679
+ def self.base64digest: (String | Digest algo, String key, String data) -> String
3680
+
3668
3681
  # <!-- rdoc-file=ext/openssl/ossl_hmac.c -->
3669
3682
  # Returns *hmac* updated with the message to be authenticated. Can be called
3670
3683
  # repeatedly with chunks of the message.
@@ -3687,7 +3700,7 @@ module OpenSSL
3687
3700
  # -->
3688
3701
  # Securely compare with another HMAC instance in constant time.
3689
3702
  #
3690
- def ==: (instance other) -> bool
3703
+ def ==: (self other) -> bool
3691
3704
 
3692
3705
  # <!--
3693
3706
  # rdoc-file=ext/openssl/ossl_hmac.c
@@ -3712,6 +3725,14 @@ module OpenSSL
3712
3725
  #
3713
3726
  def hexdigest: () -> String
3714
3727
 
3728
+ # <!--
3729
+ # rdoc-file=ext/openssl/lib/openssl/hmac.rb
3730
+ # - hmac.base64digest -> string
3731
+ # -->
3732
+ # Returns the authentication code an a Base64-encoded string.
3733
+ #
3734
+ def base64digest: () -> String
3735
+
3715
3736
  # <!-- rdoc-file=ext/openssl/lib/openssl/hmac.rb -->
3716
3737
  # Returns the authentication code as a hex-encoded string. The *digest*
3717
3738
  # parameter specifies the digest algorithm to use. This may be a String
@@ -3814,7 +3835,7 @@ module OpenSSL
3814
3835
  # - initialize_copy(p1)
3815
3836
  # -->
3816
3837
  #
3817
- def initialize_copy: (instance) -> void
3838
+ def initialize_copy: (self) -> void
3818
3839
  end
3819
3840
 
3820
3841
  # <!-- rdoc-file=ext/openssl/ossl_hmac.c -->
@@ -3863,7 +3884,6 @@ module OpenSSL
3863
3884
  # * scrypt
3864
3885
  # * HKDF
3865
3886
  #
3866
- #
3867
3887
  # ## Examples
3868
3888
  # ### Generating a 128 bit key for a Cipher (e.g. AES)
3869
3889
  # pass = "secret"
@@ -3898,26 +3918,30 @@ module OpenSSL
3898
3918
  # - KDF.hkdf(ikm, salt:, info:, length:, hash:) -> String
3899
3919
  # -->
3900
3920
  # HMAC-based Extract-and-Expand Key Derivation Function (HKDF) as specified in
3901
- # [RFC 5869](https://tools.ietf.org/html/rfc5869).
3921
+ # [RFC 5869](https://www.rfc-editor.org/rfc/rfc5869).
3902
3922
  #
3903
3923
  # New in OpenSSL 1.1.0.
3904
3924
  #
3905
3925
  # ### Parameters
3906
3926
  # *ikm*
3907
3927
  # : The input keying material.
3928
+ #
3908
3929
  # *salt*
3909
3930
  # : The salt.
3931
+ #
3910
3932
  # *info*
3911
3933
  # : The context and application specific information.
3934
+ #
3912
3935
  # *length*
3913
3936
  # : The output length in octets. Must be <= `255 * HashLen`, where HashLen is
3914
3937
  # the length of the hash function output in octets.
3938
+ #
3915
3939
  # *hash*
3916
3940
  # : The hash function.
3917
3941
  #
3918
3942
  #
3919
3943
  # ### Example
3920
- # # The values from https://datatracker.ietf.org/doc/html/rfc5869#appendix-A.1
3944
+ # # The values from https://www.rfc-editor.org/rfc/rfc5869#appendix-A.1
3921
3945
  # ikm = ["0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b"].pack("H*")
3922
3946
  # salt = ["000102030405060708090a0b0c"].pack("H*")
3923
3947
  # info = ["f0f1f2f3f4f5f6f7f8f9"].pack("H*")
@@ -3935,22 +3959,26 @@ module OpenSSL
3935
3959
  # *length* bytes.
3936
3960
  #
3937
3961
  # For more information about PBKDF2, see RFC 2898 Section 5.2
3938
- # (https://tools.ietf.org/html/rfc2898#section-5.2).
3962
+ # (https://www.rfc-editor.org/rfc/rfc2898#section-5.2).
3939
3963
  #
3940
3964
  # ### Parameters
3941
3965
  # pass
3942
3966
  # : The password.
3967
+ #
3943
3968
  # salt
3944
3969
  # : The salt. Salts prevent attacks based on dictionaries of common passwords
3945
3970
  # and attacks based on rainbow tables. It is a public value that can be
3946
3971
  # safely stored along with the password (e.g. if the derived value is used
3947
3972
  # for password storage).
3973
+ #
3948
3974
  # iterations
3949
3975
  # : The iteration count. This provides the ability to tune the algorithm. It
3950
3976
  # is better to use the highest count possible for the maximum resistance to
3951
3977
  # brute-force attacks.
3978
+ #
3952
3979
  # length
3953
3980
  # : The desired length of the derived key in octets.
3981
+ #
3954
3982
  # hash
3955
3983
  # : The hash algorithm used with HMAC for the PRF. May be a String
3956
3984
  # representing the algorithm name, or an instance of OpenSSL::Digest.
@@ -3969,22 +3997,27 @@ module OpenSSL
3969
3997
  # attacks using custom hardwares than alternative KDFs such as PBKDF2 or bcrypt.
3970
3998
  #
3971
3999
  # The keyword arguments *N*, *r* and *p* can be used to tune scrypt. RFC 7914
3972
- # (published on 2016-08, https://tools.ietf.org/html/rfc7914#section-2) states
3973
- # that using values r=8 and p=1 appears to yield good results.
4000
+ # (published on 2016-08, https://www.rfc-editor.org/rfc/rfc7914#section-2)
4001
+ # states that using values r=8 and p=1 appears to yield good results.
3974
4002
  #
3975
- # See RFC 7914 (https://tools.ietf.org/html/rfc7914) for more information.
4003
+ # See RFC 7914 (https://www.rfc-editor.org/rfc/rfc7914) for more information.
3976
4004
  #
3977
4005
  # ### Parameters
3978
4006
  # pass
3979
4007
  # : Passphrase.
4008
+ #
3980
4009
  # salt
3981
4010
  # : Salt.
4011
+ #
3982
4012
  # N
3983
4013
  # : CPU/memory cost parameter. This must be a power of 2.
4014
+ #
3984
4015
  # r
3985
4016
  # : Block size parameter.
4017
+ #
3986
4018
  # p
3987
4019
  # : Parallelization parameter.
4020
+ #
3988
4021
  # length
3989
4022
  # : Length in octets of the derived key.
3990
4023
  #
@@ -4040,8 +4073,8 @@ module OpenSSL
4040
4073
  # <!-- rdoc-file=ext/openssl/ossl_ns_spki.c -->
4041
4074
  # OpenSSL::Netscape is a namespace for SPKI (Simple Public Key Infrastructure)
4042
4075
  # which implements Signed Public Key and Challenge. See [RFC
4043
- # 2692](http://tools.ietf.org/html/rfc2692) and [RFC
4044
- # 2693](http://tools.ietf.org/html/rfc2692) for details.
4076
+ # 2692](https://www.rfc-editor.org/rfc/rfc2692) and [RFC
4077
+ # 2693](https://www.rfc-editor.org/rfc/rfc2692) for details.
4045
4078
  #
4046
4079
  module Netscape
4047
4080
  # <!-- rdoc-file=ext/openssl/ossl_ns_spki.c -->
@@ -4097,7 +4130,6 @@ module OpenSSL
4097
4130
  # ### Parameters
4098
4131
  # * *str* - the challenge string to be set for this instance
4099
4132
  #
4100
- #
4101
4133
  # Sets the challenge to be associated with the SPKI. May be used by the server,
4102
4134
  # e.g. to prevent replay.
4103
4135
  #
@@ -4118,7 +4150,6 @@ module OpenSSL
4118
4150
  # ### Parameters
4119
4151
  # * *pub* - the public key to be set for this instance
4120
4152
  #
4121
- #
4122
4153
  # Sets the public key to be associated with the SPKI, an instance of
4123
4154
  # OpenSSL::PKey. This should be the public key corresponding to the private key
4124
4155
  # used for signing the SPKI.
@@ -4133,12 +4164,11 @@ module OpenSSL
4133
4164
  # * *key* - the private key to be used for signing this instance
4134
4165
  # * *digest* - the digest to be used for signing this instance
4135
4166
  #
4136
- #
4137
4167
  # To sign an SPKI, the private key corresponding to the public key set for this
4138
4168
  # instance should be used, in addition to a digest algorithm in the form of an
4139
4169
  # OpenSSL::Digest. The private key should be an instance of OpenSSL::PKey.
4140
4170
  #
4141
- def sign: (PKey::PKey key, Digest digest) -> instance
4171
+ def sign: (PKey::PKey key, Digest digest) -> self
4142
4172
 
4143
4173
  # <!--
4144
4174
  # rdoc-file=ext/openssl/ossl_ns_spki.c
@@ -4176,7 +4206,6 @@ module OpenSSL
4176
4206
  # ### Parameters
4177
4207
  # * *key* - the public key to be used for verifying the SPKI signature
4178
4208
  #
4179
- #
4180
4209
  # Returns `true` if the signature is valid, `false` otherwise. To verify an
4181
4210
  # SPKI, the public key contained within the SPKI should be used.
4182
4211
  #
@@ -4493,7 +4522,6 @@ module OpenSSL
4493
4522
  # * OpenSSL::OCSP::V_CERTSTATUS_REVOKED
4494
4523
  # * OpenSSL::OCSP::V_CERTSTATUS_UNKNOWN
4495
4524
  #
4496
- #
4497
4525
  # *reason* and *revocation_time* can be given only when *status* is
4498
4526
  # OpenSSL::OCSP::V_CERTSTATUS_REVOKED. *reason* describes the reason for the
4499
4527
  # revocation, and must be one of OpenSSL::OCSP::REVOKED_STATUS_* constants.
@@ -4548,8 +4576,10 @@ module OpenSSL
4548
4576
  # *flags* can include:
4549
4577
  # OpenSSL::OCSP::NOCERTS
4550
4578
  # : don't include certificates
4579
+ #
4551
4580
  # OpenSSL::OCSP::NOTIME
4552
4581
  # : don't set producedAt
4582
+ #
4553
4583
  # OpenSSL::OCSP::RESPID_KEY
4554
4584
  # : use signer's public key hash as responderID
4555
4585
  #
@@ -4602,7 +4632,7 @@ module OpenSSL
4602
4632
  # - initialize_copy(p1)
4603
4633
  # -->
4604
4634
  #
4605
- def initialize_copy: (instance) -> void
4635
+ def initialize_copy: (self) -> void
4606
4636
  end
4607
4637
 
4608
4638
  # <!-- rdoc-file=ext/openssl/ossl_ocsp.c -->
@@ -4617,7 +4647,7 @@ module OpenSSL
4617
4647
  # Compares this certificate id with *other* and returns `true` if they are the
4618
4648
  # same.
4619
4649
  #
4620
- def cmp: (instance other) -> bool
4650
+ def cmp: (self other) -> bool
4621
4651
 
4622
4652
  # <!--
4623
4653
  # rdoc-file=ext/openssl/ossl_ocsp.c
@@ -4626,7 +4656,7 @@ module OpenSSL
4626
4656
  # Compares this certificate id's issuer with *other* and returns `true` if they
4627
4657
  # are the same.
4628
4658
  #
4629
- def cmp_issuer: (instance other) -> bool
4659
+ def cmp_issuer: (self other) -> bool
4630
4660
 
4631
4661
  # <!--
4632
4662
  # rdoc-file=ext/openssl/ossl_ocsp.c
@@ -4696,7 +4726,7 @@ module OpenSSL
4696
4726
  # - initialize_copy(p1)
4697
4727
  # -->
4698
4728
  #
4699
- def initialize_copy: (instance) -> void
4729
+ def initialize_copy: (self) -> void
4700
4730
  end
4701
4731
 
4702
4732
  # <!-- rdoc-file=ext/openssl/ossl_ocsp.c -->
@@ -4749,12 +4779,16 @@ module OpenSSL
4749
4779
  #
4750
4780
  # -1
4751
4781
  # : nonce in request only.
4782
+ #
4752
4783
  # 0
4753
4784
  # : nonces both present and not equal.
4785
+ #
4754
4786
  # 1
4755
4787
  # : nonces present and equal.
4788
+ #
4756
4789
  # 2
4757
4790
  # : nonces both absent.
4791
+ #
4758
4792
  # 3
4759
4793
  # : nonce present in response only.
4760
4794
  #
@@ -4830,7 +4864,7 @@ module OpenSSL
4830
4864
  # - initialize_copy(p1)
4831
4865
  # -->
4832
4866
  #
4833
- def initialize_copy: (instance) -> void
4867
+ def initialize_copy: (self) -> void
4834
4868
  end
4835
4869
 
4836
4870
  # <!-- rdoc-file=ext/openssl/ossl_ocsp.c -->
@@ -4895,7 +4929,7 @@ module OpenSSL
4895
4929
  # - initialize_copy(p1)
4896
4930
  # -->
4897
4931
  #
4898
- def initialize_copy: (instance) -> void
4932
+ def initialize_copy: (self) -> void
4899
4933
  end
4900
4934
 
4901
4935
  # <!-- rdoc-file=ext/openssl/ossl_ocsp.c -->
@@ -4914,7 +4948,6 @@ module OpenSSL
4914
4948
  # * V_CERTSTATUS_REVOKED
4915
4949
  # * V_CERTSTATUS_UNKNOWN
4916
4950
  #
4917
- #
4918
4951
  # When the status is V_CERTSTATUS_REVOKED, the time at which the certificate was
4919
4952
  # revoked can be retrieved by #revocation_time.
4920
4953
  #
@@ -5004,7 +5037,7 @@ module OpenSSL
5004
5037
  # - initialize_copy(p1)
5005
5038
  # -->
5006
5039
  #
5007
- def initialize_copy: (instance) -> void
5040
+ def initialize_copy: (self) -> void
5008
5041
  end
5009
5042
  end
5010
5043
 
@@ -5031,7 +5064,6 @@ module OpenSSL
5031
5064
  # * The public_key portion of the certificate must contain a valid public
5032
5065
  # key.
5033
5066
  # * The not_before and not_after fields must be filled in.
5034
- #
5035
5067
  # * *ca* - An optional array of X509::Certificate's.
5036
5068
  # * *key_pbe* - string
5037
5069
  # * *cert_pbe* - string
@@ -5039,7 +5071,6 @@ module OpenSSL
5039
5071
  # * *mac_iter* - integer
5040
5072
  # * *keytype* - An integer representing an MSIE specific extension.
5041
5073
  #
5042
- #
5043
5074
  # Any optional arguments may be supplied as `nil` to preserve the OpenSSL
5044
5075
  # defaults.
5045
5076
  #
@@ -5079,7 +5110,7 @@ module OpenSSL
5079
5110
  # - initialize_copy(p1)
5080
5111
  # -->
5081
5112
  #
5082
- def initialize_copy: (instance) -> void
5113
+ def initialize_copy: (self) -> void
5083
5114
 
5084
5115
  class PKCS12Error < OpenSSL::OpenSSLError
5085
5116
  end
@@ -5112,8 +5143,13 @@ module OpenSSL
5112
5143
  class PKCS7
5113
5144
  # <!--
5114
5145
  # rdoc-file=ext/openssl/ossl_pkcs7.c
5115
- # - PKCS7.encrypt(certs, data, [, cipher [, flags]]) => pkcs7
5146
+ # - PKCS7.encrypt(certs, data, cipher, flags = 0) => pkcs7
5116
5147
  # -->
5148
+ # Creates a PKCS #7 enveloped-data structure.
5149
+ #
5150
+ # Before version 3.3.0, `cipher` was optional and defaulted to `"RC2-40-CBC"`.
5151
+ #
5152
+ # See also the man page PKCS7_encrypt(3).
5117
5153
  #
5118
5154
  def self.encrypt: (X509::Certificate certs, String data, ?Cipher cipher, ?Integer flags) -> instance
5119
5155
 
@@ -5321,7 +5357,7 @@ module OpenSSL
5321
5357
  # - initialize_copy(p1)
5322
5358
  # -->
5323
5359
  #
5324
- def initialize_copy: (instance) -> untyped
5360
+ def initialize_copy: (self) -> untyped
5325
5361
 
5326
5362
  BINARY: Integer
5327
5363
 
@@ -5441,7 +5477,6 @@ module OpenSSL
5441
5477
  # * RSA (OpenSSL::PKey::RSA)
5442
5478
  # * DSA (OpenSSL::PKey::DSA)
5443
5479
  # * Elliptic Curve Cryptography (OpenSSL::PKey::EC)
5444
- #
5445
5480
  # Each of these implementations is in fact a sub-class of the abstract PKey
5446
5481
  # class which offers the interface for supporting digital signatures in the form
5447
5482
  # of PKey#sign and PKey#verify.
@@ -5484,11 +5519,14 @@ module OpenSSL
5484
5519
  # ### Accessor methods for the Diffie-Hellman parameters
5485
5520
  # DH#p
5486
5521
  # : The prime (an OpenSSL::BN) of the Diffie-Hellman parameters.
5522
+ #
5487
5523
  # DH#g
5488
5524
  # : The generator (an OpenSSL::BN) g of the Diffie-Hellman parameters.
5525
+ #
5489
5526
  # DH#pub_key
5490
5527
  # : The per-session public key (an OpenSSL::BN) matching the private key. This
5491
5528
  # needs to be passed to DH#compute_key.
5529
+ #
5492
5530
  # DH#priv_key
5493
5531
  # : The per-session private key, an OpenSSL::BN.
5494
5532
  #
@@ -5525,6 +5563,7 @@ module OpenSSL
5525
5563
  #
5526
5564
  # `size`
5527
5565
  # : The desired key size in bits.
5566
+ #
5528
5567
  # `generator`
5529
5568
  # : The generator.
5530
5569
  #
@@ -5609,7 +5648,7 @@ module OpenSSL
5609
5648
  # Stores all parameters of key to the hash INSECURE: PRIVATE INFORMATIONS CAN
5610
5649
  # LEAK OUT!!! Don't use :-)) (I's up to you)
5611
5650
  #
5612
- def params: () -> Hash[String, BN]
5651
+ def params: () -> Hash[String, BN?]
5613
5652
 
5614
5653
  # <!--
5615
5654
  # rdoc-file=ext/openssl/ossl_pkey_dh.c
@@ -5667,7 +5706,7 @@ module OpenSSL
5667
5706
  # dhcopy = dh1.public_key
5668
5707
  # p dhcopy.priv_key #=> nil
5669
5708
  #
5670
- def public_key: () -> instance
5709
+ def public_key: () -> self
5671
5710
 
5672
5711
  def q: () -> BN
5673
5712
 
@@ -5768,8 +5807,10 @@ module OpenSSL
5768
5807
  #
5769
5808
  # `string`
5770
5809
  # : A String that contains the DER or PEM encoded key.
5810
+ #
5771
5811
  # `size`
5772
5812
  # : See DH.generate.
5813
+ #
5773
5814
  # `generator`
5774
5815
  # : See DH.generate.
5775
5816
  #
@@ -5796,7 +5837,7 @@ module OpenSSL
5796
5837
  # - initialize_copy(p1)
5797
5838
  # -->
5798
5839
  #
5799
- def initialize_copy: (instance) -> void
5840
+ def initialize_copy: (self) -> void
5800
5841
  end
5801
5842
 
5802
5843
  # <!-- rdoc-file=ext/openssl/ossl_pkey_dh.c -->
@@ -5852,6 +5893,7 @@ module OpenSSL
5852
5893
  # X.509 SubjectPublicKeyInfo regardless of whether it is a public key or a
5853
5894
  # private key.
5854
5895
  #
5896
+ #
5855
5897
  # When the key contains private components, and no parameters are given
5856
5898
  # : Serializes it into a traditional OpenSSL DSAPrivateKey.
5857
5899
  #
@@ -5861,6 +5903,7 @@ module OpenSSL
5861
5903
  # [...]
5862
5904
  # -----END DSA PRIVATE KEY-----
5863
5905
  #
5906
+ #
5864
5907
  # When the key contains private components, and *cipher* and *password* are given
5865
5908
  # : Serializes it into a traditional OpenSSL DSAPrivateKey and encrypts it in
5866
5909
  # OpenSSL's traditional PEM encryption format. *cipher* must be a cipher
@@ -5899,7 +5942,7 @@ module OpenSSL
5899
5942
  # Stores all parameters of key to the hash INSECURE: PRIVATE INFORMATIONS CAN
5900
5943
  # LEAK OUT!!! Don't use :-)) (I's up to you)
5901
5944
  #
5902
- def params: () -> Hash[String, BN]
5945
+ def params: () -> Hash[String, BN?]
5903
5946
 
5904
5947
  def priv_key: () -> BN
5905
5948
 
@@ -5936,7 +5979,7 @@ module OpenSSL
5936
5979
  # For the purpose of serializing the public key, to PEM or DER encoding of X.509
5937
5980
  # SubjectPublicKeyInfo format, check PKey#public_to_pem and PKey#public_to_der.
5938
5981
  #
5939
- def public_key: () -> instance
5982
+ def public_key: () -> self
5940
5983
 
5941
5984
  def q: () -> BN
5942
5985
 
@@ -5998,6 +6041,7 @@ module OpenSSL
5998
6041
  #
5999
6042
  # `digest`
6000
6043
  # : A message digest of the original input data to be signed.
6044
+ #
6001
6045
  # `sig`
6002
6046
  # : A DSA signature value.
6003
6047
  #
@@ -6035,6 +6079,7 @@ module OpenSSL
6035
6079
  # X.509 SubjectPublicKeyInfo regardless of whether it is a public key or a
6036
6080
  # private key.
6037
6081
  #
6082
+ #
6038
6083
  # When the key contains private components, and no parameters are given
6039
6084
  # : Serializes it into a traditional OpenSSL DSAPrivateKey.
6040
6085
  #
@@ -6044,6 +6089,7 @@ module OpenSSL
6044
6089
  # [...]
6045
6090
  # -----END DSA PRIVATE KEY-----
6046
6091
  #
6092
+ #
6047
6093
  # When the key contains private components, and *cipher* and *password* are given
6048
6094
  # : Serializes it into a traditional OpenSSL DSAPrivateKey and encrypts it in
6049
6095
  # OpenSSL's traditional PEM encryption format. *cipher* must be a cipher
@@ -6087,6 +6133,7 @@ module OpenSSL
6087
6133
  # X.509 SubjectPublicKeyInfo regardless of whether it is a public key or a
6088
6134
  # private key.
6089
6135
  #
6136
+ #
6090
6137
  # When the key contains private components, and no parameters are given
6091
6138
  # : Serializes it into a traditional OpenSSL DSAPrivateKey.
6092
6139
  #
@@ -6096,6 +6143,7 @@ module OpenSSL
6096
6143
  # [...]
6097
6144
  # -----END DSA PRIVATE KEY-----
6098
6145
  #
6146
+ #
6099
6147
  # When the key contains private components, and *cipher* and *password* are given
6100
6148
  # : Serializes it into a traditional OpenSSL DSAPrivateKey and encrypts it in
6101
6149
  # OpenSSL's traditional PEM encryption format. *cipher* must be a cipher
@@ -6152,8 +6200,10 @@ module OpenSSL
6152
6200
  #
6153
6201
  # `string`
6154
6202
  # : A String that contains a DER or PEM encoded key.
6203
+ #
6155
6204
  # `pass`
6156
6205
  # : A String that contains an optional password.
6206
+ #
6157
6207
  # `size`
6158
6208
  # : See DSA.generate.
6159
6209
  #
@@ -6176,7 +6226,7 @@ module OpenSSL
6176
6226
  # - initialize_copy(p1)
6177
6227
  # -->
6178
6228
  #
6179
- def initialize_copy: (instance) -> void
6229
+ def initialize_copy: (self) -> void
6180
6230
  end
6181
6231
 
6182
6232
  # <!-- rdoc-file=ext/openssl/ossl_pkey_dsa.c -->
@@ -6286,6 +6336,7 @@ module OpenSSL
6286
6336
  # X.509 SubjectPublicKeyInfo regardless of whether it is a public key or a
6287
6337
  # private key.
6288
6338
  #
6339
+ #
6289
6340
  # When the key contains private components, and no parameters are given
6290
6341
  # : Serializes it into a SEC 1/RFC 5915 ECPrivateKey.
6291
6342
  #
@@ -6295,6 +6346,7 @@ module OpenSSL
6295
6346
  # [...]
6296
6347
  # -----END EC PRIVATE KEY-----
6297
6348
  #
6349
+ #
6298
6350
  # When the key contains private components, and *cipher* and *password* are given
6299
6351
  # : Serializes it into a SEC 1/RFC 5915 ECPrivateKey and encrypts it in
6300
6352
  # OpenSSL's traditional PEM encryption format. *cipher* must be a cipher
@@ -6463,6 +6515,7 @@ module OpenSSL
6463
6515
  # X.509 SubjectPublicKeyInfo regardless of whether it is a public key or a
6464
6516
  # private key.
6465
6517
  #
6518
+ #
6466
6519
  # When the key contains private components, and no parameters are given
6467
6520
  # : Serializes it into a SEC 1/RFC 5915 ECPrivateKey.
6468
6521
  #
@@ -6472,6 +6525,7 @@ module OpenSSL
6472
6525
  # [...]
6473
6526
  # -----END EC PRIVATE KEY-----
6474
6527
  #
6528
+ #
6475
6529
  # When the key contains private components, and *cipher* and *password* are given
6476
6530
  # : Serializes it into a SEC 1/RFC 5915 ECPrivateKey and encrypts it in
6477
6531
  # OpenSSL's traditional PEM encryption format. *cipher* must be a cipher
@@ -6520,7 +6574,7 @@ module OpenSSL
6520
6574
  # Creates a new EC object from given arguments.
6521
6575
  #
6522
6576
  def initialize: () -> void
6523
- | (instance ec_key) -> void
6577
+ | (self ec_key) -> void
6524
6578
  | (Group group) -> void
6525
6579
  | (String pem_or_der_or_curve, ?String pass) -> void
6526
6580
 
@@ -6529,7 +6583,7 @@ module OpenSSL
6529
6583
  # - initialize_copy(p1)
6530
6584
  # -->
6531
6585
  #
6532
- def initialize_copy: (instance) -> void
6586
+ def initialize_copy: (self) -> void
6533
6587
 
6534
6588
  EXPLICIT_CURVE: Integer
6535
6589
 
@@ -6568,7 +6622,6 @@ module OpenSSL
6568
6622
  # * EC::NAMED_CURVE
6569
6623
  # * EC::EXPLICIT_CURVE
6570
6624
  #
6571
- #
6572
6625
  # See the OpenSSL documentation for EC_GROUP_set_asn1_flag().
6573
6626
  #
6574
6627
  def asn1_flag=: (Integer) -> Integer
@@ -6609,7 +6662,7 @@ module OpenSSL
6609
6662
  # Returns `true` if the two groups use the same curve and have the same
6610
6663
  # parameters, `false` otherwise.
6611
6664
  #
6612
- def eql?: (instance other) -> bool
6665
+ def eql?: (self other) -> bool
6613
6666
 
6614
6667
  # <!--
6615
6668
  # rdoc-file=ext/openssl/ossl_pkey_ec.c
@@ -6652,8 +6705,10 @@ module OpenSSL
6652
6705
  # `:compressed`
6653
6706
  # : Encoded as z||x, where z is an octet indicating which solution of the
6654
6707
  # equation y is. z will be 0x02 or 0x03.
6708
+ #
6655
6709
  # `:uncompressed`
6656
6710
  # : Encoded as z||x||y, where z is an octet 0x04.
6711
+ #
6657
6712
  # `:hybrid`
6658
6713
  # : Encodes as z||x||y, where z is an octet indicating which solution of the
6659
6714
  # equation y is. z will be 0x06 or 0x07.
@@ -6728,7 +6783,7 @@ module OpenSSL
6728
6783
  # If the first argument is :GFp or :GF2m, creates a new curve with given
6729
6784
  # parameters.
6730
6785
  #
6731
- def initialize: (instance group) -> void
6786
+ def initialize: (self group) -> void
6732
6787
  | (String pem_or_der_encoded) -> void
6733
6788
  | (ec_method ec_method) -> void
6734
6789
  | (:GFp | :GF2m ec_method, Integer bignum_p, Integer bignum_a, Integer bignum_b) -> void
@@ -6738,7 +6793,7 @@ module OpenSSL
6738
6793
  # - initialize_copy(p1)
6739
6794
  # -->
6740
6795
  #
6741
- def initialize_copy: (instance) -> void
6796
+ def initialize_copy: (self) -> void
6742
6797
 
6743
6798
  class Error < OpenSSL::OpenSSLError
6744
6799
  end
@@ -6758,7 +6813,7 @@ module OpenSSL
6758
6813
  # -->
6759
6814
  # Performs elliptic curve point addition.
6760
6815
  #
6761
- def add: (instance point) -> instance
6816
+ def add: (self point) -> self
6762
6817
 
6763
6818
  # <!--
6764
6819
  # rdoc-file=ext/openssl/ossl_pkey_ec.c
@@ -6766,7 +6821,7 @@ module OpenSSL
6766
6821
  # - point1 == point2 => true | false
6767
6822
  # -->
6768
6823
  #
6769
- def eql?: (instance other) -> bool
6824
+ def eql?: (self other) -> bool
6770
6825
 
6771
6826
  def group: () -> Group
6772
6827
 
@@ -6808,8 +6863,8 @@ module OpenSSL
6808
6863
  # of OpenSSL::BN. *points* must be an array of OpenSSL::PKey::EC::Point. Please
6809
6864
  # note that `points[0]` is not multiplied by `bns[0]`, but `bns[1]`.
6810
6865
  #
6811
- def mul: (bn bn1, ?bn bn2) -> instance
6812
- | (Array[bn] bns, Array[instance], ?bn bn2) -> instance
6866
+ def mul: (bn bn1, ?bn bn2) -> self
6867
+ | (Array[bn] bns, Array[self], ?bn bn2) -> self
6813
6868
 
6814
6869
  # <!--
6815
6870
  # rdoc-file=ext/openssl/ossl_pkey_ec.c
@@ -6867,7 +6922,7 @@ module OpenSSL
6867
6922
  # *encoded_point* is the octet string representation of the point. This must be
6868
6923
  # either a String or an OpenSSL::BN.
6869
6924
  #
6870
- def initialize: (instance point) -> void
6925
+ def initialize: (self point) -> void
6871
6926
  | (Group group, ?String | BN encoded_point) -> void
6872
6927
 
6873
6928
  # <!--
@@ -6875,7 +6930,7 @@ module OpenSSL
6875
6930
  # - initialize_copy(p1)
6876
6931
  # -->
6877
6932
  #
6878
- def initialize_copy: (instance) -> void
6933
+ def initialize_copy: (self) -> void
6879
6934
 
6880
6935
  class Error < OpenSSL::OpenSSLError
6881
6936
  end
@@ -6983,8 +7038,10 @@ module OpenSSL
6983
7038
  # the PKey type requires no digest algorithm. For backwards compatibility,
6984
7039
  # this can be an instance of OpenSSL::Digest. Its state will not affect the
6985
7040
  # signature.
7041
+ #
6986
7042
  # `data`
6987
7043
  # : A String. The data to be hashed and signed.
7044
+ #
6988
7045
  # `options`
6989
7046
  # : A Hash that contains algorithm specific control operations to OpenSSL. See
6990
7047
  # OpenSSL's man page EVP_PKEY_CTX_ctrl_str(3) for details. `options`
@@ -7019,10 +7076,13 @@ module OpenSSL
7019
7076
  #
7020
7077
  # `digest`
7021
7078
  # : See #sign.
7079
+ #
7022
7080
  # `signature`
7023
7081
  # : A String containing the signature to be verified.
7082
+ #
7024
7083
  # `data`
7025
7084
  # : See #sign.
7085
+ #
7026
7086
  # `options`
7027
7087
  # : See #sign. `options` parameter was added in version 3.0.
7028
7088
  #
@@ -7069,6 +7129,7 @@ module OpenSSL
7069
7129
  #
7070
7130
  # `size`
7071
7131
  # : The desired key size in bits.
7132
+ #
7072
7133
  # `exponent`
7073
7134
  # : An odd Integer, normally 3, 17, or 65537.
7074
7135
  #
@@ -7104,6 +7165,7 @@ module OpenSSL
7104
7165
  # X.509 SubjectPublicKeyInfo regardless of whether the key is a public key
7105
7166
  # or a private key.
7106
7167
  #
7168
+ #
7107
7169
  # When the key contains private components, and no parameters are given
7108
7170
  # : Serializes it into a PKCS #1 RSAPrivateKey.
7109
7171
  #
@@ -7113,6 +7175,7 @@ module OpenSSL
7113
7175
  # [...]
7114
7176
  # -----END RSA PRIVATE KEY-----
7115
7177
  #
7178
+ #
7116
7179
  # When the key contains private components, and *cipher* and *password* are given
7117
7180
  # : Serializes it into a PKCS #1 RSAPrivateKey and encrypts it in OpenSSL's
7118
7181
  # traditional PEM encryption format. *cipher* must be a cipher name
@@ -7157,7 +7220,7 @@ module OpenSSL
7157
7220
  #
7158
7221
  # Don't use :-)) (It's up to you)
7159
7222
  #
7160
- def params: () -> Hash[String, BN]
7223
+ def params: () -> Hash[String, BN?]
7161
7224
 
7162
7225
  # <!--
7163
7226
  # rdoc-file=ext/openssl/ossl_pkey_rsa.c
@@ -7244,7 +7307,7 @@ module OpenSSL
7244
7307
  # For the purpose of serializing the public key, to PEM or DER encoding of X.509
7245
7308
  # SubjectPublicKeyInfo format, check PKey#public_to_pem and PKey#public_to_der.
7246
7309
  #
7247
- def public_key: () -> instance
7310
+ def public_key: () -> self
7248
7311
 
7249
7312
  def q: () -> BN?
7250
7313
 
@@ -7287,13 +7350,16 @@ module OpenSSL
7287
7350
  # ### Parameters
7288
7351
  # *digest*
7289
7352
  # : A String containing the message digest algorithm name.
7353
+ #
7290
7354
  # *data*
7291
7355
  # : A String. The data to be signed.
7356
+ #
7292
7357
  # *salt_length*
7293
7358
  # : The length in octets of the salt. Two special values are reserved:
7294
7359
  # `:digest` means the digest length, and `:max` means the maximum possible
7295
7360
  # length for the combination of the private key and the selected message
7296
7361
  # digest algorithm.
7362
+ #
7297
7363
  # *mgf1_hash*
7298
7364
  # : The hash algorithm used in MGF1 (the currently supported mask generation
7299
7365
  # function (MGF)).
@@ -7341,6 +7407,7 @@ module OpenSSL
7341
7407
  # X.509 SubjectPublicKeyInfo regardless of whether the key is a public key
7342
7408
  # or a private key.
7343
7409
  #
7410
+ #
7344
7411
  # When the key contains private components, and no parameters are given
7345
7412
  # : Serializes it into a PKCS #1 RSAPrivateKey.
7346
7413
  #
@@ -7350,6 +7417,7 @@ module OpenSSL
7350
7417
  # [...]
7351
7418
  # -----END RSA PRIVATE KEY-----
7352
7419
  #
7420
+ #
7353
7421
  # When the key contains private components, and *cipher* and *password* are given
7354
7422
  # : Serializes it into a PKCS #1 RSAPrivateKey and encrypts it in OpenSSL's
7355
7423
  # traditional PEM encryption format. *cipher* must be a cipher name
@@ -7393,6 +7461,7 @@ module OpenSSL
7393
7461
  # X.509 SubjectPublicKeyInfo regardless of whether the key is a public key
7394
7462
  # or a private key.
7395
7463
  #
7464
+ #
7396
7465
  # When the key contains private components, and no parameters are given
7397
7466
  # : Serializes it into a PKCS #1 RSAPrivateKey.
7398
7467
  #
@@ -7402,6 +7471,7 @@ module OpenSSL
7402
7471
  # [...]
7403
7472
  # -----END RSA PRIVATE KEY-----
7404
7473
  #
7474
+ #
7405
7475
  # When the key contains private components, and *cipher* and *password* are given
7406
7476
  # : Serializes it into a PKCS #1 RSAPrivateKey and encrypts it in OpenSSL's
7407
7477
  # traditional PEM encryption format. *cipher* must be a cipher name
@@ -7454,12 +7524,15 @@ module OpenSSL
7454
7524
  # ### Parameters
7455
7525
  # *digest*
7456
7526
  # : A String containing the message digest algorithm name.
7527
+ #
7457
7528
  # *data*
7458
7529
  # : A String. The data to be signed.
7530
+ #
7459
7531
  # *salt_length*
7460
7532
  # : The length in octets of the salt. Two special values are reserved:
7461
7533
  # `:digest` means the digest length, and `:auto` means automatically
7462
7534
  # determining the length based on the signature.
7535
+ #
7463
7536
  # *mgf1_hash*
7464
7537
  # : The hash algorithm used in MGF1.
7465
7538
  #
@@ -7502,7 +7575,7 @@ module OpenSSL
7502
7575
  # - initialize_copy(p1)
7503
7576
  # -->
7504
7577
  #
7505
- def initialize_copy: (instance) -> void
7578
+ def initialize_copy: (self) -> void
7506
7579
 
7507
7580
  NO_PADDING: Integer
7508
7581
 
@@ -7809,8 +7882,10 @@ module OpenSSL
7809
7882
  # ### Parameters
7810
7883
  # *certificate*
7811
7884
  # : A certificate. An instance of OpenSSL::X509::Certificate.
7885
+ #
7812
7886
  # *pkey*
7813
7887
  # : The private key for *certificate*. An instance of OpenSSL::PKey::PKey.
7888
+ #
7814
7889
  # *extra_certs*
7815
7890
  # : Optional. An array of OpenSSL::X509::Certificate. When sending a
7816
7891
  # certificate chain, the certificates specified by this are sent following
@@ -8169,7 +8244,7 @@ module OpenSSL
8169
8244
 
8170
8245
  # <!--
8171
8246
  # rdoc-file=ext/openssl/ossl_ssl.c
8172
- # - options()
8247
+ # - ctx.options -> integer
8173
8248
  # -->
8174
8249
  # Gets various OpenSSL options.
8175
8250
  #
@@ -8177,9 +8252,16 @@ module OpenSSL
8177
8252
 
8178
8253
  # <!--
8179
8254
  # rdoc-file=ext/openssl/ossl_ssl.c
8180
- # - options=(p1)
8255
+ # - ctx.options = integer
8181
8256
  # -->
8182
- # Sets various OpenSSL options.
8257
+ # Sets various OpenSSL options. The options are a bit field and can be combined
8258
+ # with the bitwise OR operator (`|`). Available options are defined as constants
8259
+ # in OpenSSL::SSL that begin with `OP_`.
8260
+ #
8261
+ # For backwards compatibility, passing `nil` has the same effect as passing
8262
+ # OpenSSL::SSL::OP_ALL.
8263
+ #
8264
+ # See also man page SSL_CTX_set_options(3).
8183
8265
  #
8184
8266
  def options=: (Integer ssl_options) -> Integer
8185
8267
 
@@ -8324,26 +8406,37 @@ module OpenSSL
8324
8406
  #
8325
8407
  # :accept
8326
8408
  # : Number of started SSL/TLS handshakes in server mode
8409
+ #
8327
8410
  # :accept_good
8328
8411
  # : Number of established SSL/TLS sessions in server mode
8412
+ #
8329
8413
  # :accept_renegotiate
8330
8414
  # : Number of start renegotiations in server mode
8415
+ #
8331
8416
  # :cache_full
8332
8417
  # : Number of sessions that were removed due to cache overflow
8418
+ #
8333
8419
  # :cache_hits
8334
8420
  # : Number of successfully reused connections
8421
+ #
8335
8422
  # :cache_misses
8336
8423
  # : Number of sessions proposed by clients that were not found in the cache
8424
+ #
8337
8425
  # :cache_num
8338
8426
  # : Number of sessions in the internal session cache
8427
+ #
8339
8428
  # :cb_hits
8340
8429
  # : Number of sessions retrieved from the external cache in server mode
8430
+ #
8341
8431
  # :connect
8342
8432
  # : Number of started SSL/TLS handshakes in client mode
8433
+ #
8343
8434
  # :connect_good
8344
8435
  # : Number of established SSL/TLS sessions in client mode
8436
+ #
8345
8437
  # :connect_renegotiate
8346
8438
  # : Number of start renegotiations in client mode
8439
+ #
8347
8440
  # :timeouts
8348
8441
  # : Number of sessions proposed by clients that were found in the cache but
8349
8442
  # had expired due to timeouts
@@ -9186,7 +9279,7 @@ module OpenSSL
9186
9279
  # -->
9187
9280
  # Returns `true` if the two Session is the same, `false` if not.
9188
9281
  #
9189
- def ==: (instance other) -> bool
9282
+ def ==: (self other) -> bool
9190
9283
 
9191
9284
  # <!--
9192
9285
  # rdoc-file=ext/openssl/ossl_ssl_session.c
@@ -9271,7 +9364,7 @@ module OpenSSL
9271
9364
  # - initialize_copy(p1)
9272
9365
  # -->
9273
9366
  #
9274
- def initialize_copy: (instance) -> void
9367
+ def initialize_copy: (self) -> void
9275
9368
 
9276
9369
  class SessionError < OpenSSL::OpenSSLError
9277
9370
  end
@@ -9496,13 +9589,11 @@ module OpenSSL
9496
9589
  # * Request#algorithm
9497
9590
  # * Request#message_imprint
9498
9591
  #
9499
- #
9500
9592
  # Mandatory parameters that need to be set in the Factory:
9501
9593
  # * Factory#serial_number
9502
9594
  # * Factory#gen_time
9503
9595
  # * Factory#allowed_digests
9504
9596
  #
9505
- #
9506
9597
  # In addition one of either Request#policy_id or Factory#default_policy_id must
9507
9598
  # be set.
9508
9599
  #
@@ -9776,7 +9867,7 @@ module OpenSSL
9776
9867
  # it is not conformant to the Request, or if validation of the timestamp
9777
9868
  # certificate chain fails.
9778
9869
  #
9779
- def verify: (Request request, X509::Store store, ?X509::Certificate intermediate_cert) -> instance
9870
+ def verify: (Request request, X509::Store store, ?X509::Certificate intermediate_cert) -> self
9780
9871
 
9781
9872
  private
9782
9873
 
@@ -10210,7 +10301,7 @@ module OpenSSL
10210
10301
  # - ==(other)
10211
10302
  # -->
10212
10303
  #
10213
- def ==: (instance other) -> bool
10304
+ def ==: (self other) -> bool
10214
10305
 
10215
10306
  # <!--
10216
10307
  # rdoc-file=ext/openssl/ossl_x509attr.c
@@ -10262,7 +10353,7 @@ module OpenSSL
10262
10353
  # - initialize_copy(p1)
10263
10354
  # -->
10264
10355
  #
10265
- def initialize_copy: (instance) -> void
10356
+ def initialize_copy: (self) -> void
10266
10357
  end
10267
10358
 
10268
10359
  class AttributeError < OpenSSL::OpenSSLError
@@ -10280,7 +10371,7 @@ module OpenSSL
10280
10371
  # - ==(other)
10281
10372
  # -->
10282
10373
  #
10283
- def ==: (instance other) -> bool
10374
+ def ==: (self other) -> bool
10284
10375
 
10285
10376
  # <!--
10286
10377
  # rdoc-file=ext/openssl/ossl_x509crl.c
@@ -10445,7 +10536,7 @@ module OpenSSL
10445
10536
  # - initialize_copy(p1)
10446
10537
  # -->
10447
10538
  #
10448
- def initialize_copy: (instance) -> void
10539
+ def initialize_copy: (self) -> void
10449
10540
  end
10450
10541
 
10451
10542
  class CRLError < OpenSSL::OpenSSLError
@@ -10558,7 +10649,7 @@ module OpenSSL
10558
10649
  # Compares the two certificates. Note that this takes into account all fields,
10559
10650
  # not just the issuer name and the serial number.
10560
10651
  #
10561
- def ==: (instance other) -> bool
10652
+ def ==: (self other) -> bool
10562
10653
 
10563
10654
  # <!--
10564
10655
  # rdoc-file=ext/openssl/ossl_x509cert.c
@@ -10768,7 +10859,7 @@ module OpenSSL
10768
10859
  # - initialize_copy(p1)
10769
10860
  # -->
10770
10861
  #
10771
- def initialize_copy: (instance) -> void
10862
+ def initialize_copy: (self) -> void
10772
10863
  end
10773
10864
 
10774
10865
  class CertificateError < OpenSSL::OpenSSLError
@@ -10784,7 +10875,7 @@ module OpenSSL
10784
10875
  # - ==(other)
10785
10876
  # -->
10786
10877
  #
10787
- def ==: (instance other) -> bool
10878
+ def ==: (self other) -> bool
10788
10879
 
10789
10880
  # <!--
10790
10881
  # rdoc-file=ext/openssl/ossl_x509ext.c
@@ -10885,7 +10976,7 @@ module OpenSSL
10885
10976
  # - initialize_copy(p1)
10886
10977
  # -->
10887
10978
  #
10888
- def initialize_copy: (instance) -> void
10979
+ def initialize_copy: (self) -> void
10889
10980
 
10890
10981
  module AuthorityInfoAccess
10891
10982
  include OpenSSL::X509::Extension::Helpers
@@ -10946,7 +11037,7 @@ module OpenSSL
10946
11037
  # - crl_uris()
10947
11038
  # -->
10948
11039
  # Get the distributionPoint fullName URI from the certificate's CRL distribution
10949
- # points extension, as described in RFC5280 Section 4.2.1.13
11040
+ # points extension, as described in RFC 5280 Section 4.2.1.13.
10950
11041
  #
10951
11042
  # Returns an array of strings or nil or raises ASN1::ASN1Error.
10952
11043
  #
@@ -11111,7 +11202,6 @@ module OpenSSL
11111
11202
  # `#to_s(OpenSSL::X509::Name::COMPAT)`. For example: `DC=com, DC=example,
11112
11203
  # CN=nobody`
11113
11204
  #
11114
- #
11115
11205
  # Neither of them is standardized and has quirks and inconsistencies in handling
11116
11206
  # of escaped characters or multi-valued RDNs.
11117
11207
  #
@@ -11147,14 +11237,19 @@ module OpenSSL
11147
11237
  #
11148
11238
  # C
11149
11239
  # : Country Name
11240
+ #
11150
11241
  # CN
11151
11242
  # : Common Name
11243
+ #
11152
11244
  # DC
11153
11245
  # : Domain Component
11246
+ #
11154
11247
  # O
11155
11248
  # : Organization Name
11249
+ #
11156
11250
  # OU
11157
11251
  # : Organizational Unit Name
11252
+ #
11158
11253
  # ST
11159
11254
  # : State or Province Name
11160
11255
  #
@@ -11183,7 +11278,7 @@ module OpenSSL
11183
11278
  # -->
11184
11279
  # Returns true if *name* and *other* refer to the same hash key.
11185
11280
  #
11186
- def eql?: (instance other) -> bool
11281
+ def eql?: (self other) -> bool
11187
11282
 
11188
11283
  # <!--
11189
11284
  # rdoc-file=ext/openssl/ossl_x509name.c
@@ -11240,7 +11335,6 @@ module OpenSSL
11240
11335
  # * OpenSSL::X509::Name::ONELINE
11241
11336
  # * OpenSSL::X509::Name::MULTILINE
11242
11337
  #
11243
- #
11244
11338
  # If *format* is omitted, the largely broken and traditional OpenSSL format
11245
11339
  # (`X509_NAME_oneline()` format) is chosen.
11246
11340
  #
@@ -11291,7 +11385,7 @@ module OpenSSL
11291
11385
  # - initialize_copy(p1)
11292
11386
  # -->
11293
11387
  #
11294
- def initialize_copy: (instance) -> void
11388
+ def initialize_copy: (self) -> void
11295
11389
 
11296
11390
  # <!-- rdoc-file=ext/openssl/ossl_x509name.c -->
11297
11391
  # A flag for #to_s.
@@ -11536,7 +11630,7 @@ module OpenSSL
11536
11630
  # - initialize_copy(p1)
11537
11631
  # -->
11538
11632
  #
11539
- def initialize_copy: (instance) -> void
11633
+ def initialize_copy: (self) -> void
11540
11634
  end
11541
11635
 
11542
11636
  class RequestError < OpenSSL::OpenSSLError
@@ -11622,7 +11716,7 @@ module OpenSSL
11622
11716
  # - initialize_copy(p1)
11623
11717
  # -->
11624
11718
  #
11625
- def initialize_copy: (instance) -> void
11719
+ def initialize_copy: (self) -> void
11626
11720
  end
11627
11721
 
11628
11722
  class RevokedError < OpenSSL::OpenSSLError
@@ -11760,7 +11854,6 @@ module OpenSSL
11760
11854
  # * X509::PURPOSE_OCSP_HELPER
11761
11855
  # * X509::PURPOSE_TIMESTAMP_SIGN
11762
11856
  #
11763
- #
11764
11857
  # OpenSSL::X509::StoreContext#purpose= can be used to change the value for a
11765
11858
  # single verification operation.
11766
11859
  #
@@ -11779,7 +11872,6 @@ module OpenSSL
11779
11872
  # * OpenSSL::X509::DEFAULT_CERT_FILE
11780
11873
  # * OpenSSL::X509::DEFAULT_CERT_DIR
11781
11874
  #
11782
- #
11783
11875
  # See also the man page X509_STORE_set_default_paths(3).
11784
11876
  #
11785
11877
  def set_default_paths: () -> nil