File tree Expand file tree Collapse file tree
src/main/java/org/jruby/ext/openssl Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2424require 'jopenssl.jar'
2525org . jruby . ext . openssl . OpenSSL . load ( JRuby . runtime )
2626
27- if RUBY_VERSION > '2.2'
27+ if RUBY_VERSION > '2.3'
28+ load 'jopenssl23/openssl.rb'
29+ elsif RUBY_VERSION > '2.2'
2830 load 'jopenssl22/openssl.rb'
2931elsif RUBY_VERSION > '2.1'
3032 load 'jopenssl21/openssl.rb'
Original file line number Diff line number Diff line change 1+ =begin
2+ = $RCSfile$ -- Loader for all OpenSSL C-space and Ruby-space definitions
3+
4+ = Info
5+ 'OpenSSL for Ruby 2' project
6+ Copyright (C) 2002 Michal Rokos <m.rokos@sh.cvut.cz>
7+ All rights reserved.
8+
9+ = Licence
10+ This program is licenced under the same licence as Ruby.
11+ (See the file 'LICENCE'.)
12+
13+ = Version
14+ $Id$
15+ =end
16+
17+ require 'openssl/bn'
18+ require 'openssl/cipher'
19+ require 'openssl/config'
20+ require 'openssl/digest'
21+ require 'openssl/x509'
22+ require 'openssl/ssl'
Original file line number Diff line number Diff line change 1+ # frozen_string_literal: false
2+ #--
3+ #
4+ # = Ruby-space definitions that completes C-space funcs for BN
5+ #
6+ # = Info
7+ # 'OpenSSL for Ruby 2' project
8+ # Copyright (C) 2002 Michal Rokos <m.rokos@sh.cvut.cz>
9+ # All rights reserved.
10+ #
11+ # = Licence
12+ # This program is licensed under the same licence as Ruby.
13+ # (See the file 'LICENCE'.)
14+ #++
15+
16+ module OpenSSL
17+ class BN
18+ def pretty_print ( q )
19+ q . object_group ( self ) {
20+ q . text ' '
21+ q . text to_i . to_s
22+ }
23+ end
24+ end # BN
25+ end # OpenSSL
26+
27+ ##
28+ # Add double dispatch to Integer
29+ #
30+ class Integer
31+ # Casts an Integer as an OpenSSL::BN
32+ #
33+ # See `man bn` for more info.
34+ def to_bn
35+ OpenSSL ::BN ::new ( self )
36+ end
37+ end # Integer
You can’t perform that action at this time.
0 commit comments