rbs 3.7.0 → 3.8.0.pre.1
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.
- checksums.yaml +4 -4
- data/.github/workflows/comments.yml +3 -3
- data/.github/workflows/ruby.yml +7 -7
- data/CHANGELOG.md +52 -0
- data/core/array.rbs +1743 -1580
- data/core/basic_object.rbs +38 -35
- data/core/comparable.rbs +1 -1
- data/core/complex.rbs +165 -93
- data/core/data.rbs +1 -1
- data/core/dir.rbs +1 -17
- data/core/encoding.rbs +12 -6
- data/core/enumerable.rbs +270 -266
- data/core/enumerator.rbs +0 -2
- data/core/env.rbs +1 -1
- data/core/errno.rbs +33 -16
- data/core/errors.rbs +2 -2
- data/core/exception.rbs +236 -170
- data/core/fiber.rbs +3 -2
- data/core/file.rbs +32 -74
- data/core/float.rbs +125 -72
- data/core/gc.rbs +138 -40
- data/core/hash.rbs +120 -141
- data/core/integer.rbs +79 -50
- data/core/io/buffer.rbs +49 -43
- data/core/io.rbs +97 -144
- data/core/kernel.rbs +290 -200
- data/core/match_data.rbs +76 -2
- data/core/math.rbs +0 -36
- data/core/module.rbs +28 -23
- data/core/nil_class.rbs +0 -3
- data/core/numeric.rbs +100 -103
- data/core/object.rbs +0 -4
- data/core/object_space/weak_key_map.rbs +3 -4
- data/core/object_space.rbs +3 -3
- data/core/proc.rbs +0 -2
- data/core/process.rbs +109 -57
- data/core/ractor.rbs +37 -4
- data/core/range.rbs +114 -87
- data/core/rational.rbs +0 -2
- data/core/rbs/unnamed/argf.rbs +234 -33
- data/core/rbs/unnamed/env_class.rbs +35 -53
- data/core/rbs/unnamed/random.rbs +1 -2
- data/core/regexp.rbs +4 -52
- data/core/ruby_vm.rbs +88 -9
- data/core/rubygems/config_file.rbs +3 -0
- data/core/rubygems/errors.rbs +0 -5
- data/core/rubygems/platform.rbs +0 -9
- data/core/rubygems/rubygems.rbs +0 -5
- data/core/rubygems/version.rbs +6 -6
- data/core/set.rbs +3 -15
- data/core/string.rbs +130 -136
- data/core/struct.rbs +6 -18
- data/core/symbol.rbs +14 -21
- data/core/thread.rbs +32 -35
- data/core/time.rbs +127 -50
- data/core/trace_point.rbs +16 -0
- data/core/true_class.rbs +0 -1
- data/core/warning.rbs +9 -2
- data/docs/architecture.md +1 -1
- data/docs/syntax.md +1 -1
- data/ext/rbs_extension/location.c +29 -19
- data/ext/rbs_extension/parser.c +267 -292
- data/ext/rbs_extension/parserstate.c +56 -22
- data/lib/rbs/annotate/annotations.rb +3 -3
- data/lib/rbs/annotate/rdoc_source.rb +2 -2
- data/lib/rbs/cli/diff.rb +3 -3
- data/lib/rbs/cli/validate.rb +1 -1
- data/lib/rbs/cli.rb +13 -13
- data/lib/rbs/collection/config.rb +3 -1
- data/lib/rbs/definition_builder/ancestor_builder.rb +3 -3
- data/lib/rbs/environment_loader.rb +1 -1
- data/lib/rbs/namespace.rb +1 -0
- data/lib/rbs/parser_aux.rb +2 -2
- data/lib/rbs/prototype/rb.rb +11 -8
- data/lib/rbs/prototype/rbi.rb +9 -5
- data/lib/rbs/prototype/runtime/value_object_generator.rb +7 -5
- data/lib/rbs/prototype/runtime.rb +4 -5
- data/lib/rbs/type_name.rb +14 -9
- data/lib/rbs/unit_test/type_assertions.rb +2 -2
- data/lib/rbs/validator.rb +3 -1
- data/lib/rbs/version.rb +1 -1
- data/lib/rdoc_plugin/parser.rb +2 -2
- data/rbs.gemspec +4 -0
- data/sig/ancestor_graph.rbs +4 -4
- data/sig/namespace.rbs +2 -3
- data/sig/resolver/constant_resolver.rbs +2 -2
- data/sig/resolver/context.rbs +1 -1
- data/sig/type_alias_regularity.rbs +5 -5
- data/sig/typename.rbs +8 -5
- data/sig/use_map.rbs +1 -1
- data/sig/validator.rbs +2 -2
- data/stdlib/base64/0/base64.rbs +0 -9
- data/stdlib/benchmark/0/benchmark.rbs +11 -2
- data/stdlib/bigdecimal/0/big_decimal.rbs +26 -182
- data/stdlib/cgi/0/core.rbs +47 -0
- data/stdlib/coverage/0/coverage.rbs +0 -3
- data/stdlib/csv/0/csv.rbs +18 -58
- data/stdlib/date/0/date.rbs +4 -19
- data/stdlib/did_you_mean/0/did_you_mean.rbs +0 -5
- data/stdlib/digest/0/digest.rbs +25 -2
- data/stdlib/erb/0/erb.rbs +0 -1
- data/stdlib/etc/0/etc.rbs +51 -34
- data/stdlib/fileutils/0/fileutils.rbs +3 -44
- data/stdlib/io-console/0/io-console.rbs +69 -15
- data/stdlib/ipaddr/0/ipaddr.rbs +8 -4
- data/stdlib/json/0/json.rbs +56 -71
- data/stdlib/logger/0/log_device.rbs +1 -1
- data/stdlib/logger/0/logger.rbs +3 -18
- data/stdlib/net-http/0/net-http.rbs +19 -77
- data/stdlib/nkf/0/nkf.rbs +30 -0
- data/stdlib/objspace/0/objspace.rbs +1 -2
- data/stdlib/observable/0/observable.rbs +1 -1
- data/stdlib/open-uri/0/open-uri.rbs +52 -0
- data/stdlib/open3/0/open3.rbs +0 -8
- data/stdlib/openssl/0/openssl.rbs +136 -69
- data/stdlib/optparse/0/optparse.rbs +58 -18
- data/stdlib/pathname/0/pathname.rbs +2 -8
- data/stdlib/pp/0/pp.rbs +3 -1
- data/stdlib/prettyprint/0/prettyprint.rbs +0 -4
- data/stdlib/pstore/0/pstore.rbs +0 -6
- data/stdlib/psych/0/psych.rbs +15 -4
- data/stdlib/pty/0/pty.rbs +46 -4
- data/stdlib/rdoc/0/code_object.rbs +0 -4
- data/stdlib/rdoc/0/markup.rbs +10 -12
- data/stdlib/rdoc/0/rdoc.rbs +1 -2
- data/stdlib/resolv/0/resolv.rbs +8 -3
- data/stdlib/ripper/0/ripper.rbs +0 -2
- data/stdlib/securerandom/0/securerandom.rbs +0 -2
- data/stdlib/shellwords/0/shellwords.rbs +11 -12
- data/stdlib/singleton/0/singleton.rbs +0 -1
- data/stdlib/socket/0/addrinfo.rbs +0 -1
- data/stdlib/socket/0/basic_socket.rbs +0 -5
- data/stdlib/socket/0/socket.rbs +49 -25
- data/stdlib/socket/0/tcp_server.rbs +0 -3
- data/stdlib/socket/0/tcp_socket.rbs +58 -3
- data/stdlib/socket/0/udp_socket.rbs +0 -1
- data/stdlib/socket/0/unix_server.rbs +0 -3
- data/stdlib/strscan/0/string_scanner.rbs +1265 -422
- data/stdlib/tempfile/0/tempfile.rbs +135 -28
- data/stdlib/time/0/time.rbs +48 -35
- data/stdlib/timeout/0/timeout.rbs +11 -8
- data/stdlib/tmpdir/0/tmpdir.rbs +8 -1
- data/stdlib/tsort/0/tsort.rbs +0 -4
- data/stdlib/uri/0/common.rbs +11 -30
- data/stdlib/uri/0/ftp.rbs +1 -1
- data/stdlib/uri/0/generic.rbs +22 -18
- data/stdlib/uri/0/http.rbs +2 -2
- data/stdlib/uri/0/rfc2396_parser.rbs +3 -0
- data/stdlib/zlib/0/buf_error.rbs +1 -70
- data/stdlib/zlib/0/data_error.rbs +1 -70
- data/stdlib/zlib/0/deflate.rbs +8 -72
- data/stdlib/zlib/0/error.rbs +1 -70
- data/stdlib/zlib/0/gzip_file/crc_error.rbs +2 -105
- data/stdlib/zlib/0/gzip_file/error.rbs +2 -105
- data/stdlib/zlib/0/gzip_file/length_error.rbs +2 -105
- data/stdlib/zlib/0/gzip_file/no_footer.rbs +2 -105
- data/stdlib/zlib/0/gzip_file.rbs +1 -71
- data/stdlib/zlib/0/gzip_reader.rbs +3 -74
- data/stdlib/zlib/0/gzip_writer.rbs +1 -70
- data/stdlib/zlib/0/inflate.rbs +4 -71
- data/stdlib/zlib/0/mem_error.rbs +1 -70
- data/stdlib/zlib/0/need_dict.rbs +1 -70
- data/stdlib/zlib/0/stream_end.rbs +1 -70
- data/stdlib/zlib/0/stream_error.rbs +1 -70
- data/stdlib/zlib/0/version_error.rbs +1 -70
- data/stdlib/zlib/0/zlib.rbs +0 -2
- data/stdlib/zlib/0/zstream.rbs +4 -72
- metadata +4 -6
|
@@ -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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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*.
|
|
@@ -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` -
|
|
1856
|
+
# * `16` - Hexadecimal number representation, with a leading '-' for a
|
|
1858
1857
|
# negative bignum.
|
|
1859
1858
|
#
|
|
1860
1859
|
def to_s: () -> String
|
|
@@ -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,7 +1903,7 @@ module OpenSSL
|
|
|
1903
1903
|
# number.
|
|
1904
1904
|
# * `10` - Decimal number representation, with a leading '-' for a
|
|
1905
1905
|
# negative number.
|
|
1906
|
-
# * `16` -
|
|
1906
|
+
# * `16` - Hexadecimal number representation, with a leading '-' for a
|
|
1907
1907
|
# negative number.
|
|
1908
1908
|
#
|
|
1909
1909
|
def initialize: (instance) -> void
|
|
@@ -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
|
|
@@ -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
|
|
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
|
|
3028
|
+
# Given the following configuration file being loaded:
|
|
3032
3029
|
#
|
|
3033
|
-
# config = OpenSSL::Config.
|
|
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
|
|
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...
|
|
@@ -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')
|
|
@@ -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
|
|
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.
|
|
@@ -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
|
#
|
|
@@ -3888,7 +3884,6 @@ module OpenSSL
|
|
|
3888
3884
|
# * scrypt
|
|
3889
3885
|
# * HKDF
|
|
3890
3886
|
#
|
|
3891
|
-
#
|
|
3892
3887
|
# ## Examples
|
|
3893
3888
|
# ### Generating a 128 bit key for a Cipher (e.g. AES)
|
|
3894
3889
|
# pass = "secret"
|
|
@@ -3923,26 +3918,30 @@ module OpenSSL
|
|
|
3923
3918
|
# - KDF.hkdf(ikm, salt:, info:, length:, hash:) -> String
|
|
3924
3919
|
# -->
|
|
3925
3920
|
# HMAC-based Extract-and-Expand Key Derivation Function (HKDF) as specified in
|
|
3926
|
-
# [RFC 5869](https://
|
|
3921
|
+
# [RFC 5869](https://www.rfc-editor.org/rfc/rfc5869).
|
|
3927
3922
|
#
|
|
3928
3923
|
# New in OpenSSL 1.1.0.
|
|
3929
3924
|
#
|
|
3930
3925
|
# ### Parameters
|
|
3931
3926
|
# *ikm*
|
|
3932
3927
|
# : The input keying material.
|
|
3928
|
+
#
|
|
3933
3929
|
# *salt*
|
|
3934
3930
|
# : The salt.
|
|
3931
|
+
#
|
|
3935
3932
|
# *info*
|
|
3936
3933
|
# : The context and application specific information.
|
|
3934
|
+
#
|
|
3937
3935
|
# *length*
|
|
3938
3936
|
# : The output length in octets. Must be <= `255 * HashLen`, where HashLen is
|
|
3939
3937
|
# the length of the hash function output in octets.
|
|
3938
|
+
#
|
|
3940
3939
|
# *hash*
|
|
3941
3940
|
# : The hash function.
|
|
3942
3941
|
#
|
|
3943
3942
|
#
|
|
3944
3943
|
# ### Example
|
|
3945
|
-
# # The values from https://
|
|
3944
|
+
# # The values from https://www.rfc-editor.org/rfc/rfc5869#appendix-A.1
|
|
3946
3945
|
# ikm = ["0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b"].pack("H*")
|
|
3947
3946
|
# salt = ["000102030405060708090a0b0c"].pack("H*")
|
|
3948
3947
|
# info = ["f0f1f2f3f4f5f6f7f8f9"].pack("H*")
|
|
@@ -3960,22 +3959,26 @@ module OpenSSL
|
|
|
3960
3959
|
# *length* bytes.
|
|
3961
3960
|
#
|
|
3962
3961
|
# For more information about PBKDF2, see RFC 2898 Section 5.2
|
|
3963
|
-
# (https://
|
|
3962
|
+
# (https://www.rfc-editor.org/rfc/rfc2898#section-5.2).
|
|
3964
3963
|
#
|
|
3965
3964
|
# ### Parameters
|
|
3966
3965
|
# pass
|
|
3967
3966
|
# : The password.
|
|
3967
|
+
#
|
|
3968
3968
|
# salt
|
|
3969
3969
|
# : The salt. Salts prevent attacks based on dictionaries of common passwords
|
|
3970
3970
|
# and attacks based on rainbow tables. It is a public value that can be
|
|
3971
3971
|
# safely stored along with the password (e.g. if the derived value is used
|
|
3972
3972
|
# for password storage).
|
|
3973
|
+
#
|
|
3973
3974
|
# iterations
|
|
3974
3975
|
# : The iteration count. This provides the ability to tune the algorithm. It
|
|
3975
3976
|
# is better to use the highest count possible for the maximum resistance to
|
|
3976
3977
|
# brute-force attacks.
|
|
3978
|
+
#
|
|
3977
3979
|
# length
|
|
3978
3980
|
# : The desired length of the derived key in octets.
|
|
3981
|
+
#
|
|
3979
3982
|
# hash
|
|
3980
3983
|
# : The hash algorithm used with HMAC for the PRF. May be a String
|
|
3981
3984
|
# representing the algorithm name, or an instance of OpenSSL::Digest.
|
|
@@ -3994,22 +3997,27 @@ module OpenSSL
|
|
|
3994
3997
|
# attacks using custom hardwares than alternative KDFs such as PBKDF2 or bcrypt.
|
|
3995
3998
|
#
|
|
3996
3999
|
# The keyword arguments *N*, *r* and *p* can be used to tune scrypt. RFC 7914
|
|
3997
|
-
# (published on 2016-08, https://
|
|
3998
|
-
# 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.
|
|
3999
4002
|
#
|
|
4000
|
-
# See RFC 7914 (https://
|
|
4003
|
+
# See RFC 7914 (https://www.rfc-editor.org/rfc/rfc7914) for more information.
|
|
4001
4004
|
#
|
|
4002
4005
|
# ### Parameters
|
|
4003
4006
|
# pass
|
|
4004
4007
|
# : Passphrase.
|
|
4008
|
+
#
|
|
4005
4009
|
# salt
|
|
4006
4010
|
# : Salt.
|
|
4011
|
+
#
|
|
4007
4012
|
# N
|
|
4008
4013
|
# : CPU/memory cost parameter. This must be a power of 2.
|
|
4014
|
+
#
|
|
4009
4015
|
# r
|
|
4010
4016
|
# : Block size parameter.
|
|
4017
|
+
#
|
|
4011
4018
|
# p
|
|
4012
4019
|
# : Parallelization parameter.
|
|
4020
|
+
#
|
|
4013
4021
|
# length
|
|
4014
4022
|
# : Length in octets of the derived key.
|
|
4015
4023
|
#
|
|
@@ -4065,8 +4073,8 @@ module OpenSSL
|
|
|
4065
4073
|
# <!-- rdoc-file=ext/openssl/ossl_ns_spki.c -->
|
|
4066
4074
|
# OpenSSL::Netscape is a namespace for SPKI (Simple Public Key Infrastructure)
|
|
4067
4075
|
# which implements Signed Public Key and Challenge. See [RFC
|
|
4068
|
-
# 2692](
|
|
4069
|
-
# 2693](
|
|
4076
|
+
# 2692](https://www.rfc-editor.org/rfc/rfc2692) and [RFC
|
|
4077
|
+
# 2693](https://www.rfc-editor.org/rfc/rfc2692) for details.
|
|
4070
4078
|
#
|
|
4071
4079
|
module Netscape
|
|
4072
4080
|
# <!-- rdoc-file=ext/openssl/ossl_ns_spki.c -->
|
|
@@ -4122,7 +4130,6 @@ module OpenSSL
|
|
|
4122
4130
|
# ### Parameters
|
|
4123
4131
|
# * *str* - the challenge string to be set for this instance
|
|
4124
4132
|
#
|
|
4125
|
-
#
|
|
4126
4133
|
# Sets the challenge to be associated with the SPKI. May be used by the server,
|
|
4127
4134
|
# e.g. to prevent replay.
|
|
4128
4135
|
#
|
|
@@ -4143,7 +4150,6 @@ module OpenSSL
|
|
|
4143
4150
|
# ### Parameters
|
|
4144
4151
|
# * *pub* - the public key to be set for this instance
|
|
4145
4152
|
#
|
|
4146
|
-
#
|
|
4147
4153
|
# Sets the public key to be associated with the SPKI, an instance of
|
|
4148
4154
|
# OpenSSL::PKey. This should be the public key corresponding to the private key
|
|
4149
4155
|
# used for signing the SPKI.
|
|
@@ -4158,7 +4164,6 @@ module OpenSSL
|
|
|
4158
4164
|
# * *key* - the private key to be used for signing this instance
|
|
4159
4165
|
# * *digest* - the digest to be used for signing this instance
|
|
4160
4166
|
#
|
|
4161
|
-
#
|
|
4162
4167
|
# To sign an SPKI, the private key corresponding to the public key set for this
|
|
4163
4168
|
# instance should be used, in addition to a digest algorithm in the form of an
|
|
4164
4169
|
# OpenSSL::Digest. The private key should be an instance of OpenSSL::PKey.
|
|
@@ -4201,7 +4206,6 @@ module OpenSSL
|
|
|
4201
4206
|
# ### Parameters
|
|
4202
4207
|
# * *key* - the public key to be used for verifying the SPKI signature
|
|
4203
4208
|
#
|
|
4204
|
-
#
|
|
4205
4209
|
# Returns `true` if the signature is valid, `false` otherwise. To verify an
|
|
4206
4210
|
# SPKI, the public key contained within the SPKI should be used.
|
|
4207
4211
|
#
|
|
@@ -4518,7 +4522,6 @@ module OpenSSL
|
|
|
4518
4522
|
# * OpenSSL::OCSP::V_CERTSTATUS_REVOKED
|
|
4519
4523
|
# * OpenSSL::OCSP::V_CERTSTATUS_UNKNOWN
|
|
4520
4524
|
#
|
|
4521
|
-
#
|
|
4522
4525
|
# *reason* and *revocation_time* can be given only when *status* is
|
|
4523
4526
|
# OpenSSL::OCSP::V_CERTSTATUS_REVOKED. *reason* describes the reason for the
|
|
4524
4527
|
# revocation, and must be one of OpenSSL::OCSP::REVOKED_STATUS_* constants.
|
|
@@ -4573,8 +4576,10 @@ module OpenSSL
|
|
|
4573
4576
|
# *flags* can include:
|
|
4574
4577
|
# OpenSSL::OCSP::NOCERTS
|
|
4575
4578
|
# : don't include certificates
|
|
4579
|
+
#
|
|
4576
4580
|
# OpenSSL::OCSP::NOTIME
|
|
4577
4581
|
# : don't set producedAt
|
|
4582
|
+
#
|
|
4578
4583
|
# OpenSSL::OCSP::RESPID_KEY
|
|
4579
4584
|
# : use signer's public key hash as responderID
|
|
4580
4585
|
#
|
|
@@ -4774,12 +4779,16 @@ module OpenSSL
|
|
|
4774
4779
|
#
|
|
4775
4780
|
# -1
|
|
4776
4781
|
# : nonce in request only.
|
|
4782
|
+
#
|
|
4777
4783
|
# 0
|
|
4778
4784
|
# : nonces both present and not equal.
|
|
4785
|
+
#
|
|
4779
4786
|
# 1
|
|
4780
4787
|
# : nonces present and equal.
|
|
4788
|
+
#
|
|
4781
4789
|
# 2
|
|
4782
4790
|
# : nonces both absent.
|
|
4791
|
+
#
|
|
4783
4792
|
# 3
|
|
4784
4793
|
# : nonce present in response only.
|
|
4785
4794
|
#
|
|
@@ -4939,7 +4948,6 @@ module OpenSSL
|
|
|
4939
4948
|
# * V_CERTSTATUS_REVOKED
|
|
4940
4949
|
# * V_CERTSTATUS_UNKNOWN
|
|
4941
4950
|
#
|
|
4942
|
-
#
|
|
4943
4951
|
# When the status is V_CERTSTATUS_REVOKED, the time at which the certificate was
|
|
4944
4952
|
# revoked can be retrieved by #revocation_time.
|
|
4945
4953
|
#
|
|
@@ -5056,7 +5064,6 @@ module OpenSSL
|
|
|
5056
5064
|
# * The public_key portion of the certificate must contain a valid public
|
|
5057
5065
|
# key.
|
|
5058
5066
|
# * The not_before and not_after fields must be filled in.
|
|
5059
|
-
#
|
|
5060
5067
|
# * *ca* - An optional array of X509::Certificate's.
|
|
5061
5068
|
# * *key_pbe* - string
|
|
5062
5069
|
# * *cert_pbe* - string
|
|
@@ -5064,7 +5071,6 @@ module OpenSSL
|
|
|
5064
5071
|
# * *mac_iter* - integer
|
|
5065
5072
|
# * *keytype* - An integer representing an MSIE specific extension.
|
|
5066
5073
|
#
|
|
5067
|
-
#
|
|
5068
5074
|
# Any optional arguments may be supplied as `nil` to preserve the OpenSSL
|
|
5069
5075
|
# defaults.
|
|
5070
5076
|
#
|
|
@@ -5137,8 +5143,13 @@ module OpenSSL
|
|
|
5137
5143
|
class PKCS7
|
|
5138
5144
|
# <!--
|
|
5139
5145
|
# rdoc-file=ext/openssl/ossl_pkcs7.c
|
|
5140
|
-
# - PKCS7.encrypt(certs, data,
|
|
5146
|
+
# - PKCS7.encrypt(certs, data, cipher, flags = 0) => pkcs7
|
|
5141
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).
|
|
5142
5153
|
#
|
|
5143
5154
|
def self.encrypt: (X509::Certificate certs, String data, ?Cipher cipher, ?Integer flags) -> instance
|
|
5144
5155
|
|
|
@@ -5466,7 +5477,6 @@ module OpenSSL
|
|
|
5466
5477
|
# * RSA (OpenSSL::PKey::RSA)
|
|
5467
5478
|
# * DSA (OpenSSL::PKey::DSA)
|
|
5468
5479
|
# * Elliptic Curve Cryptography (OpenSSL::PKey::EC)
|
|
5469
|
-
#
|
|
5470
5480
|
# Each of these implementations is in fact a sub-class of the abstract PKey
|
|
5471
5481
|
# class which offers the interface for supporting digital signatures in the form
|
|
5472
5482
|
# of PKey#sign and PKey#verify.
|
|
@@ -5509,11 +5519,14 @@ module OpenSSL
|
|
|
5509
5519
|
# ### Accessor methods for the Diffie-Hellman parameters
|
|
5510
5520
|
# DH#p
|
|
5511
5521
|
# : The prime (an OpenSSL::BN) of the Diffie-Hellman parameters.
|
|
5522
|
+
#
|
|
5512
5523
|
# DH#g
|
|
5513
5524
|
# : The generator (an OpenSSL::BN) g of the Diffie-Hellman parameters.
|
|
5525
|
+
#
|
|
5514
5526
|
# DH#pub_key
|
|
5515
5527
|
# : The per-session public key (an OpenSSL::BN) matching the private key. This
|
|
5516
5528
|
# needs to be passed to DH#compute_key.
|
|
5529
|
+
#
|
|
5517
5530
|
# DH#priv_key
|
|
5518
5531
|
# : The per-session private key, an OpenSSL::BN.
|
|
5519
5532
|
#
|
|
@@ -5550,6 +5563,7 @@ module OpenSSL
|
|
|
5550
5563
|
#
|
|
5551
5564
|
# `size`
|
|
5552
5565
|
# : The desired key size in bits.
|
|
5566
|
+
#
|
|
5553
5567
|
# `generator`
|
|
5554
5568
|
# : The generator.
|
|
5555
5569
|
#
|
|
@@ -5793,8 +5807,10 @@ module OpenSSL
|
|
|
5793
5807
|
#
|
|
5794
5808
|
# `string`
|
|
5795
5809
|
# : A String that contains the DER or PEM encoded key.
|
|
5810
|
+
#
|
|
5796
5811
|
# `size`
|
|
5797
5812
|
# : See DH.generate.
|
|
5813
|
+
#
|
|
5798
5814
|
# `generator`
|
|
5799
5815
|
# : See DH.generate.
|
|
5800
5816
|
#
|
|
@@ -5877,6 +5893,7 @@ module OpenSSL
|
|
|
5877
5893
|
# X.509 SubjectPublicKeyInfo regardless of whether it is a public key or a
|
|
5878
5894
|
# private key.
|
|
5879
5895
|
#
|
|
5896
|
+
#
|
|
5880
5897
|
# When the key contains private components, and no parameters are given
|
|
5881
5898
|
# : Serializes it into a traditional OpenSSL DSAPrivateKey.
|
|
5882
5899
|
#
|
|
@@ -5886,6 +5903,7 @@ module OpenSSL
|
|
|
5886
5903
|
# [...]
|
|
5887
5904
|
# -----END DSA PRIVATE KEY-----
|
|
5888
5905
|
#
|
|
5906
|
+
#
|
|
5889
5907
|
# When the key contains private components, and *cipher* and *password* are given
|
|
5890
5908
|
# : Serializes it into a traditional OpenSSL DSAPrivateKey and encrypts it in
|
|
5891
5909
|
# OpenSSL's traditional PEM encryption format. *cipher* must be a cipher
|
|
@@ -6023,6 +6041,7 @@ module OpenSSL
|
|
|
6023
6041
|
#
|
|
6024
6042
|
# `digest`
|
|
6025
6043
|
# : A message digest of the original input data to be signed.
|
|
6044
|
+
#
|
|
6026
6045
|
# `sig`
|
|
6027
6046
|
# : A DSA signature value.
|
|
6028
6047
|
#
|
|
@@ -6060,6 +6079,7 @@ module OpenSSL
|
|
|
6060
6079
|
# X.509 SubjectPublicKeyInfo regardless of whether it is a public key or a
|
|
6061
6080
|
# private key.
|
|
6062
6081
|
#
|
|
6082
|
+
#
|
|
6063
6083
|
# When the key contains private components, and no parameters are given
|
|
6064
6084
|
# : Serializes it into a traditional OpenSSL DSAPrivateKey.
|
|
6065
6085
|
#
|
|
@@ -6069,6 +6089,7 @@ module OpenSSL
|
|
|
6069
6089
|
# [...]
|
|
6070
6090
|
# -----END DSA PRIVATE KEY-----
|
|
6071
6091
|
#
|
|
6092
|
+
#
|
|
6072
6093
|
# When the key contains private components, and *cipher* and *password* are given
|
|
6073
6094
|
# : Serializes it into a traditional OpenSSL DSAPrivateKey and encrypts it in
|
|
6074
6095
|
# OpenSSL's traditional PEM encryption format. *cipher* must be a cipher
|
|
@@ -6112,6 +6133,7 @@ module OpenSSL
|
|
|
6112
6133
|
# X.509 SubjectPublicKeyInfo regardless of whether it is a public key or a
|
|
6113
6134
|
# private key.
|
|
6114
6135
|
#
|
|
6136
|
+
#
|
|
6115
6137
|
# When the key contains private components, and no parameters are given
|
|
6116
6138
|
# : Serializes it into a traditional OpenSSL DSAPrivateKey.
|
|
6117
6139
|
#
|
|
@@ -6121,6 +6143,7 @@ module OpenSSL
|
|
|
6121
6143
|
# [...]
|
|
6122
6144
|
# -----END DSA PRIVATE KEY-----
|
|
6123
6145
|
#
|
|
6146
|
+
#
|
|
6124
6147
|
# When the key contains private components, and *cipher* and *password* are given
|
|
6125
6148
|
# : Serializes it into a traditional OpenSSL DSAPrivateKey and encrypts it in
|
|
6126
6149
|
# OpenSSL's traditional PEM encryption format. *cipher* must be a cipher
|
|
@@ -6177,8 +6200,10 @@ module OpenSSL
|
|
|
6177
6200
|
#
|
|
6178
6201
|
# `string`
|
|
6179
6202
|
# : A String that contains a DER or PEM encoded key.
|
|
6203
|
+
#
|
|
6180
6204
|
# `pass`
|
|
6181
6205
|
# : A String that contains an optional password.
|
|
6206
|
+
#
|
|
6182
6207
|
# `size`
|
|
6183
6208
|
# : See DSA.generate.
|
|
6184
6209
|
#
|
|
@@ -6311,6 +6336,7 @@ module OpenSSL
|
|
|
6311
6336
|
# X.509 SubjectPublicKeyInfo regardless of whether it is a public key or a
|
|
6312
6337
|
# private key.
|
|
6313
6338
|
#
|
|
6339
|
+
#
|
|
6314
6340
|
# When the key contains private components, and no parameters are given
|
|
6315
6341
|
# : Serializes it into a SEC 1/RFC 5915 ECPrivateKey.
|
|
6316
6342
|
#
|
|
@@ -6320,6 +6346,7 @@ module OpenSSL
|
|
|
6320
6346
|
# [...]
|
|
6321
6347
|
# -----END EC PRIVATE KEY-----
|
|
6322
6348
|
#
|
|
6349
|
+
#
|
|
6323
6350
|
# When the key contains private components, and *cipher* and *password* are given
|
|
6324
6351
|
# : Serializes it into a SEC 1/RFC 5915 ECPrivateKey and encrypts it in
|
|
6325
6352
|
# OpenSSL's traditional PEM encryption format. *cipher* must be a cipher
|
|
@@ -6488,6 +6515,7 @@ module OpenSSL
|
|
|
6488
6515
|
# X.509 SubjectPublicKeyInfo regardless of whether it is a public key or a
|
|
6489
6516
|
# private key.
|
|
6490
6517
|
#
|
|
6518
|
+
#
|
|
6491
6519
|
# When the key contains private components, and no parameters are given
|
|
6492
6520
|
# : Serializes it into a SEC 1/RFC 5915 ECPrivateKey.
|
|
6493
6521
|
#
|
|
@@ -6497,6 +6525,7 @@ module OpenSSL
|
|
|
6497
6525
|
# [...]
|
|
6498
6526
|
# -----END EC PRIVATE KEY-----
|
|
6499
6527
|
#
|
|
6528
|
+
#
|
|
6500
6529
|
# When the key contains private components, and *cipher* and *password* are given
|
|
6501
6530
|
# : Serializes it into a SEC 1/RFC 5915 ECPrivateKey and encrypts it in
|
|
6502
6531
|
# OpenSSL's traditional PEM encryption format. *cipher* must be a cipher
|
|
@@ -6593,7 +6622,6 @@ module OpenSSL
|
|
|
6593
6622
|
# * EC::NAMED_CURVE
|
|
6594
6623
|
# * EC::EXPLICIT_CURVE
|
|
6595
6624
|
#
|
|
6596
|
-
#
|
|
6597
6625
|
# See the OpenSSL documentation for EC_GROUP_set_asn1_flag().
|
|
6598
6626
|
#
|
|
6599
6627
|
def asn1_flag=: (Integer) -> Integer
|
|
@@ -6677,8 +6705,10 @@ module OpenSSL
|
|
|
6677
6705
|
# `:compressed`
|
|
6678
6706
|
# : Encoded as z||x, where z is an octet indicating which solution of the
|
|
6679
6707
|
# equation y is. z will be 0x02 or 0x03.
|
|
6708
|
+
#
|
|
6680
6709
|
# `:uncompressed`
|
|
6681
6710
|
# : Encoded as z||x||y, where z is an octet 0x04.
|
|
6711
|
+
#
|
|
6682
6712
|
# `:hybrid`
|
|
6683
6713
|
# : Encodes as z||x||y, where z is an octet indicating which solution of the
|
|
6684
6714
|
# equation y is. z will be 0x06 or 0x07.
|
|
@@ -7008,8 +7038,10 @@ module OpenSSL
|
|
|
7008
7038
|
# the PKey type requires no digest algorithm. For backwards compatibility,
|
|
7009
7039
|
# this can be an instance of OpenSSL::Digest. Its state will not affect the
|
|
7010
7040
|
# signature.
|
|
7041
|
+
#
|
|
7011
7042
|
# `data`
|
|
7012
7043
|
# : A String. The data to be hashed and signed.
|
|
7044
|
+
#
|
|
7013
7045
|
# `options`
|
|
7014
7046
|
# : A Hash that contains algorithm specific control operations to OpenSSL. See
|
|
7015
7047
|
# OpenSSL's man page EVP_PKEY_CTX_ctrl_str(3) for details. `options`
|
|
@@ -7044,10 +7076,13 @@ module OpenSSL
|
|
|
7044
7076
|
#
|
|
7045
7077
|
# `digest`
|
|
7046
7078
|
# : See #sign.
|
|
7079
|
+
#
|
|
7047
7080
|
# `signature`
|
|
7048
7081
|
# : A String containing the signature to be verified.
|
|
7082
|
+
#
|
|
7049
7083
|
# `data`
|
|
7050
7084
|
# : See #sign.
|
|
7085
|
+
#
|
|
7051
7086
|
# `options`
|
|
7052
7087
|
# : See #sign. `options` parameter was added in version 3.0.
|
|
7053
7088
|
#
|
|
@@ -7094,6 +7129,7 @@ module OpenSSL
|
|
|
7094
7129
|
#
|
|
7095
7130
|
# `size`
|
|
7096
7131
|
# : The desired key size in bits.
|
|
7132
|
+
#
|
|
7097
7133
|
# `exponent`
|
|
7098
7134
|
# : An odd Integer, normally 3, 17, or 65537.
|
|
7099
7135
|
#
|
|
@@ -7129,6 +7165,7 @@ module OpenSSL
|
|
|
7129
7165
|
# X.509 SubjectPublicKeyInfo regardless of whether the key is a public key
|
|
7130
7166
|
# or a private key.
|
|
7131
7167
|
#
|
|
7168
|
+
#
|
|
7132
7169
|
# When the key contains private components, and no parameters are given
|
|
7133
7170
|
# : Serializes it into a PKCS #1 RSAPrivateKey.
|
|
7134
7171
|
#
|
|
@@ -7138,6 +7175,7 @@ module OpenSSL
|
|
|
7138
7175
|
# [...]
|
|
7139
7176
|
# -----END RSA PRIVATE KEY-----
|
|
7140
7177
|
#
|
|
7178
|
+
#
|
|
7141
7179
|
# When the key contains private components, and *cipher* and *password* are given
|
|
7142
7180
|
# : Serializes it into a PKCS #1 RSAPrivateKey and encrypts it in OpenSSL's
|
|
7143
7181
|
# traditional PEM encryption format. *cipher* must be a cipher name
|
|
@@ -7312,13 +7350,16 @@ module OpenSSL
|
|
|
7312
7350
|
# ### Parameters
|
|
7313
7351
|
# *digest*
|
|
7314
7352
|
# : A String containing the message digest algorithm name.
|
|
7353
|
+
#
|
|
7315
7354
|
# *data*
|
|
7316
7355
|
# : A String. The data to be signed.
|
|
7356
|
+
#
|
|
7317
7357
|
# *salt_length*
|
|
7318
7358
|
# : The length in octets of the salt. Two special values are reserved:
|
|
7319
7359
|
# `:digest` means the digest length, and `:max` means the maximum possible
|
|
7320
7360
|
# length for the combination of the private key and the selected message
|
|
7321
7361
|
# digest algorithm.
|
|
7362
|
+
#
|
|
7322
7363
|
# *mgf1_hash*
|
|
7323
7364
|
# : The hash algorithm used in MGF1 (the currently supported mask generation
|
|
7324
7365
|
# function (MGF)).
|
|
@@ -7366,6 +7407,7 @@ module OpenSSL
|
|
|
7366
7407
|
# X.509 SubjectPublicKeyInfo regardless of whether the key is a public key
|
|
7367
7408
|
# or a private key.
|
|
7368
7409
|
#
|
|
7410
|
+
#
|
|
7369
7411
|
# When the key contains private components, and no parameters are given
|
|
7370
7412
|
# : Serializes it into a PKCS #1 RSAPrivateKey.
|
|
7371
7413
|
#
|
|
@@ -7375,6 +7417,7 @@ module OpenSSL
|
|
|
7375
7417
|
# [...]
|
|
7376
7418
|
# -----END RSA PRIVATE KEY-----
|
|
7377
7419
|
#
|
|
7420
|
+
#
|
|
7378
7421
|
# When the key contains private components, and *cipher* and *password* are given
|
|
7379
7422
|
# : Serializes it into a PKCS #1 RSAPrivateKey and encrypts it in OpenSSL's
|
|
7380
7423
|
# traditional PEM encryption format. *cipher* must be a cipher name
|
|
@@ -7418,6 +7461,7 @@ module OpenSSL
|
|
|
7418
7461
|
# X.509 SubjectPublicKeyInfo regardless of whether the key is a public key
|
|
7419
7462
|
# or a private key.
|
|
7420
7463
|
#
|
|
7464
|
+
#
|
|
7421
7465
|
# When the key contains private components, and no parameters are given
|
|
7422
7466
|
# : Serializes it into a PKCS #1 RSAPrivateKey.
|
|
7423
7467
|
#
|
|
@@ -7427,6 +7471,7 @@ module OpenSSL
|
|
|
7427
7471
|
# [...]
|
|
7428
7472
|
# -----END RSA PRIVATE KEY-----
|
|
7429
7473
|
#
|
|
7474
|
+
#
|
|
7430
7475
|
# When the key contains private components, and *cipher* and *password* are given
|
|
7431
7476
|
# : Serializes it into a PKCS #1 RSAPrivateKey and encrypts it in OpenSSL's
|
|
7432
7477
|
# traditional PEM encryption format. *cipher* must be a cipher name
|
|
@@ -7479,12 +7524,15 @@ module OpenSSL
|
|
|
7479
7524
|
# ### Parameters
|
|
7480
7525
|
# *digest*
|
|
7481
7526
|
# : A String containing the message digest algorithm name.
|
|
7527
|
+
#
|
|
7482
7528
|
# *data*
|
|
7483
7529
|
# : A String. The data to be signed.
|
|
7530
|
+
#
|
|
7484
7531
|
# *salt_length*
|
|
7485
7532
|
# : The length in octets of the salt. Two special values are reserved:
|
|
7486
7533
|
# `:digest` means the digest length, and `:auto` means automatically
|
|
7487
7534
|
# determining the length based on the signature.
|
|
7535
|
+
#
|
|
7488
7536
|
# *mgf1_hash*
|
|
7489
7537
|
# : The hash algorithm used in MGF1.
|
|
7490
7538
|
#
|
|
@@ -7834,8 +7882,10 @@ module OpenSSL
|
|
|
7834
7882
|
# ### Parameters
|
|
7835
7883
|
# *certificate*
|
|
7836
7884
|
# : A certificate. An instance of OpenSSL::X509::Certificate.
|
|
7885
|
+
#
|
|
7837
7886
|
# *pkey*
|
|
7838
7887
|
# : The private key for *certificate*. An instance of OpenSSL::PKey::PKey.
|
|
7888
|
+
#
|
|
7839
7889
|
# *extra_certs*
|
|
7840
7890
|
# : Optional. An array of OpenSSL::X509::Certificate. When sending a
|
|
7841
7891
|
# certificate chain, the certificates specified by this are sent following
|
|
@@ -8194,7 +8244,7 @@ module OpenSSL
|
|
|
8194
8244
|
|
|
8195
8245
|
# <!--
|
|
8196
8246
|
# rdoc-file=ext/openssl/ossl_ssl.c
|
|
8197
|
-
# - options
|
|
8247
|
+
# - ctx.options -> integer
|
|
8198
8248
|
# -->
|
|
8199
8249
|
# Gets various OpenSSL options.
|
|
8200
8250
|
#
|
|
@@ -8202,9 +8252,16 @@ module OpenSSL
|
|
|
8202
8252
|
|
|
8203
8253
|
# <!--
|
|
8204
8254
|
# rdoc-file=ext/openssl/ossl_ssl.c
|
|
8205
|
-
# - options=
|
|
8255
|
+
# - ctx.options = integer
|
|
8206
8256
|
# -->
|
|
8207
|
-
# 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).
|
|
8208
8265
|
#
|
|
8209
8266
|
def options=: (Integer ssl_options) -> Integer
|
|
8210
8267
|
|
|
@@ -8349,26 +8406,37 @@ module OpenSSL
|
|
|
8349
8406
|
#
|
|
8350
8407
|
# :accept
|
|
8351
8408
|
# : Number of started SSL/TLS handshakes in server mode
|
|
8409
|
+
#
|
|
8352
8410
|
# :accept_good
|
|
8353
8411
|
# : Number of established SSL/TLS sessions in server mode
|
|
8412
|
+
#
|
|
8354
8413
|
# :accept_renegotiate
|
|
8355
8414
|
# : Number of start renegotiations in server mode
|
|
8415
|
+
#
|
|
8356
8416
|
# :cache_full
|
|
8357
8417
|
# : Number of sessions that were removed due to cache overflow
|
|
8418
|
+
#
|
|
8358
8419
|
# :cache_hits
|
|
8359
8420
|
# : Number of successfully reused connections
|
|
8421
|
+
#
|
|
8360
8422
|
# :cache_misses
|
|
8361
8423
|
# : Number of sessions proposed by clients that were not found in the cache
|
|
8424
|
+
#
|
|
8362
8425
|
# :cache_num
|
|
8363
8426
|
# : Number of sessions in the internal session cache
|
|
8427
|
+
#
|
|
8364
8428
|
# :cb_hits
|
|
8365
8429
|
# : Number of sessions retrieved from the external cache in server mode
|
|
8430
|
+
#
|
|
8366
8431
|
# :connect
|
|
8367
8432
|
# : Number of started SSL/TLS handshakes in client mode
|
|
8433
|
+
#
|
|
8368
8434
|
# :connect_good
|
|
8369
8435
|
# : Number of established SSL/TLS sessions in client mode
|
|
8436
|
+
#
|
|
8370
8437
|
# :connect_renegotiate
|
|
8371
8438
|
# : Number of start renegotiations in client mode
|
|
8439
|
+
#
|
|
8372
8440
|
# :timeouts
|
|
8373
8441
|
# : Number of sessions proposed by clients that were found in the cache but
|
|
8374
8442
|
# had expired due to timeouts
|
|
@@ -9521,13 +9589,11 @@ module OpenSSL
|
|
|
9521
9589
|
# * Request#algorithm
|
|
9522
9590
|
# * Request#message_imprint
|
|
9523
9591
|
#
|
|
9524
|
-
#
|
|
9525
9592
|
# Mandatory parameters that need to be set in the Factory:
|
|
9526
9593
|
# * Factory#serial_number
|
|
9527
9594
|
# * Factory#gen_time
|
|
9528
9595
|
# * Factory#allowed_digests
|
|
9529
9596
|
#
|
|
9530
|
-
#
|
|
9531
9597
|
# In addition one of either Request#policy_id or Factory#default_policy_id must
|
|
9532
9598
|
# be set.
|
|
9533
9599
|
#
|
|
@@ -10971,7 +11037,7 @@ module OpenSSL
|
|
|
10971
11037
|
# - crl_uris()
|
|
10972
11038
|
# -->
|
|
10973
11039
|
# Get the distributionPoint fullName URI from the certificate's CRL distribution
|
|
10974
|
-
# points extension, as described in
|
|
11040
|
+
# points extension, as described in RFC 5280 Section 4.2.1.13.
|
|
10975
11041
|
#
|
|
10976
11042
|
# Returns an array of strings or nil or raises ASN1::ASN1Error.
|
|
10977
11043
|
#
|
|
@@ -11136,7 +11202,6 @@ module OpenSSL
|
|
|
11136
11202
|
# `#to_s(OpenSSL::X509::Name::COMPAT)`. For example: `DC=com, DC=example,
|
|
11137
11203
|
# CN=nobody`
|
|
11138
11204
|
#
|
|
11139
|
-
#
|
|
11140
11205
|
# Neither of them is standardized and has quirks and inconsistencies in handling
|
|
11141
11206
|
# of escaped characters or multi-valued RDNs.
|
|
11142
11207
|
#
|
|
@@ -11172,14 +11237,19 @@ module OpenSSL
|
|
|
11172
11237
|
#
|
|
11173
11238
|
# C
|
|
11174
11239
|
# : Country Name
|
|
11240
|
+
#
|
|
11175
11241
|
# CN
|
|
11176
11242
|
# : Common Name
|
|
11243
|
+
#
|
|
11177
11244
|
# DC
|
|
11178
11245
|
# : Domain Component
|
|
11246
|
+
#
|
|
11179
11247
|
# O
|
|
11180
11248
|
# : Organization Name
|
|
11249
|
+
#
|
|
11181
11250
|
# OU
|
|
11182
11251
|
# : Organizational Unit Name
|
|
11252
|
+
#
|
|
11183
11253
|
# ST
|
|
11184
11254
|
# : State or Province Name
|
|
11185
11255
|
#
|
|
@@ -11265,7 +11335,6 @@ module OpenSSL
|
|
|
11265
11335
|
# * OpenSSL::X509::Name::ONELINE
|
|
11266
11336
|
# * OpenSSL::X509::Name::MULTILINE
|
|
11267
11337
|
#
|
|
11268
|
-
#
|
|
11269
11338
|
# If *format* is omitted, the largely broken and traditional OpenSSL format
|
|
11270
11339
|
# (`X509_NAME_oneline()` format) is chosen.
|
|
11271
11340
|
#
|
|
@@ -11785,7 +11854,6 @@ module OpenSSL
|
|
|
11785
11854
|
# * X509::PURPOSE_OCSP_HELPER
|
|
11786
11855
|
# * X509::PURPOSE_TIMESTAMP_SIGN
|
|
11787
11856
|
#
|
|
11788
|
-
#
|
|
11789
11857
|
# OpenSSL::X509::StoreContext#purpose= can be used to change the value for a
|
|
11790
11858
|
# single verification operation.
|
|
11791
11859
|
#
|
|
@@ -11804,7 +11872,6 @@ module OpenSSL
|
|
|
11804
11872
|
# * OpenSSL::X509::DEFAULT_CERT_FILE
|
|
11805
11873
|
# * OpenSSL::X509::DEFAULT_CERT_DIR
|
|
11806
11874
|
#
|
|
11807
|
-
#
|
|
11808
11875
|
# See also the man page X509_STORE_set_default_paths(3).
|
|
11809
11876
|
#
|
|
11810
11877
|
def set_default_paths: () -> nil
|