jruby-openssl 0.8.0.pre1 → 0.8.0.pre2

Sign up to get free protection for your applications and to get access to all the features.
@@ -35,14 +35,8 @@ lib/1.9/openssl/x509.rb
35
35
  lib/shared/jopenssl
36
36
  lib/shared/jopenssl.jar
37
37
  lib/shared/jruby-openssl.rb
38
- lib/shared/openssl
39
38
  lib/shared/openssl.rb
40
39
  lib/shared/jopenssl/version.rb
41
- lib/shared/openssl/dummy.rb
42
- lib/shared/openssl/dummyssl.rb
43
- lib/shared/openssl/pkcs12.rb
44
- lib/shared/openssl/ssl.rb
45
- lib/shared/openssl/x509.rb
46
40
  test/1.8
47
41
  test/1.9
48
42
  test/cert_with_ec_pk.cer
data/Rakefile CHANGED
@@ -34,7 +34,7 @@ task :java_compile do
34
34
  end
35
35
 
36
36
  File.open("pkg/compile_sourcefiles", "w") do |f|
37
- f << FileList['src/java/**/*.java'].join(' ')
37
+ f << FileList['src/org/jruby/ext/openssl/**/*.java'].join(' ')
38
38
  end
39
39
 
40
40
  sh "javac @pkg/compile_options @pkg/compile_classpath @pkg/compile_sourcefiles"
Binary file
@@ -1,5 +1,5 @@
1
1
  module Jopenssl
2
2
  module Version
3
- VERSION = "0.8.0.pre1"
3
+ VERSION = "0.8.0.pre2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jruby-openssl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0.pre1
4
+ version: 0.8.0.pre2
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -85,11 +85,6 @@ files:
85
85
  - lib/shared/jruby-openssl.rb
86
86
  - lib/shared/openssl.rb
87
87
  - lib/shared/jopenssl/version.rb
88
- - lib/shared/openssl/dummy.rb
89
- - lib/shared/openssl/dummyssl.rb
90
- - lib/shared/openssl/pkcs12.rb
91
- - lib/shared/openssl/ssl.rb
92
- - lib/shared/openssl/x509.rb
93
88
  - test/cert_with_ec_pk.cer
94
89
  - test/test_all.rb
95
90
  - test/test_certificate.rb
@@ -1,33 +0,0 @@
1
- warn "OpenSSL ASN1/PKey/X509/Netscape/PKCS7 implementation unavailable"
2
- warn "gem install bouncy-castle-java for full support."
3
- module OpenSSL
4
- module ASN1
5
- class ASN1Error < OpenSSLError; end
6
- class ASN1Data; end
7
- class Primitive; end
8
- class Constructive; end
9
- end
10
- module X509
11
- class Name; end
12
- class Certificate; end
13
- class Extension; end
14
- class CRL; end
15
- class Revoked; end
16
- class Store
17
- def set_default_paths; end
18
- end
19
- class Request; end
20
- class Attribute; end
21
- end
22
- module Netscape
23
- class SPKI; end
24
- end
25
- class PKCS7
26
- # this definition causes TypeError "superclass mismatch for class PKCS7"
27
- # MRI also crashes following definition;
28
- # class Foo; class Foo < Foo; end; end
29
- # class Foo; class Foo < Foo; end; end
30
- #
31
- # class PKCS7 < PKCS7; end
32
- end
33
- end
@@ -1,14 +0,0 @@
1
- warn "Warning: OpenSSL SSL implementation unavailable"
2
- warn "You must run on JDK 1.5 (Java 5) or higher to use SSL"
3
- module OpenSSL
4
- module SSL
5
- class SSLError < OpenSSLError; end
6
- class SSLContext; end
7
- class SSLSocket; end
8
- VERIFY_NONE = 0
9
- VERIFY_PEER = 1
10
- VERIFY_FAIL_IF_NO_PEER_CERT = 2
11
- VERIFY_CLIENT_ONCE = 4
12
- OP_ALL = 0x00000FFF
13
- end
14
- end
@@ -1,50 +0,0 @@
1
- require 'java'
2
-
3
- module OpenSSL
4
- class PKCS12
5
- java_import java.io.StringReader
6
- java_import java.io.StringBufferInputStream
7
- java_import java.security.cert.CertificateFactory
8
- java_import java.security.KeyStore
9
- java_import java.io.ByteArrayOutputStream
10
- java_import org.bouncycastle.openssl.PEMReader
11
-
12
- java.security.Security.add_provider(org.bouncycastle.jce.provider.BouncyCastleProvider.new)
13
-
14
- def self.create(pass, name, key, cert)
15
- pkcs12 = self.new(pass, name, key, cert)
16
- pkcs12.generate
17
- pkcs12
18
- end
19
-
20
- attr_reader :key, :certificate
21
-
22
- def initialize(pass, name, key, cert)
23
- @pass = pass
24
- @name = name
25
- @key = key
26
- @certificate = cert
27
- end
28
-
29
- def generate
30
- key_reader = StringReader.new(key.to_pem)
31
- key_pair = PEMReader.new(key_reader).read_object
32
-
33
- cert_input_stream = StringBufferInputStream.new(certificate.to_pem)
34
- certs = CertificateFactory.get_instance("X.509").generate_certificates(cert_input_stream)
35
-
36
- store = KeyStore.get_instance("PKCS12", "BC")
37
- store.load(nil, nil)
38
- store.set_key_entry(@name, key_pair.get_private, nil, certs.to_array(Java::java.security.cert.Certificate[certs.size].new))
39
-
40
- pkcs12_output_stream = ByteArrayOutputStream.new
41
- store.store(pkcs12_output_stream, @pass.to_java.to_char_array)
42
-
43
- @der = String.from_java_bytes(pkcs12_output_stream.to_byte_array)
44
- end
45
-
46
- def to_der
47
- @der
48
- end
49
- end
50
- end
@@ -1 +0,0 @@
1
- require 'openssl'
@@ -1 +0,0 @@
1
- require 'openssl'