Class: Vertx::SelfSignedCertificate

Inherits:
Object
  • Object
show all
Defined in:
/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/self_signed_certificate.rb

Overview

A self-signed certificate helper for testing and development purposes.

While it helps for testing and development, it should never ever be used in production settings.

Constant Summary

@@j_api_type =
Object.new

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Boolean) accept?(obj)

Returns:

  • (Boolean)


19
20
21
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/self_signed_certificate.rb', line 19

def @@j_api_type.accept?(obj)
  obj.class == SelfSignedCertificate
end

+ (::Vertx::SelfSignedCertificate) create(fqdn = nil)

Create a new SelfSignedCertificate instance with a fully-qualified domain name,

Parameters:

  • fqdn (String) (defaults to: nil)
    a fully qualified domain name.

Returns:

Raises:

  • (ArgumentError)


77
78
79
80
81
82
83
84
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/self_signed_certificate.rb', line 77

def self.create(fqdn=nil)
  if !block_given? && fqdn == nil
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxCoreNet::SelfSignedCertificate.java_method(:create, []).call(),::Vertx::SelfSignedCertificate)
  elsif fqdn.class == String && !block_given?
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxCoreNet::SelfSignedCertificate.java_method(:create, [Java::java.lang.String.java_class]).call(fqdn),::Vertx::SelfSignedCertificate)
  end
  raise ArgumentError, "Invalid arguments when calling create(#{fqdn})"
end

+ (Object) j_api_type



28
29
30
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/self_signed_certificate.rb', line 28

def self.j_api_type
  @@j_api_type
end

+ (Object) j_class



31
32
33
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/self_signed_certificate.rb', line 31

def self.j_class
  Java::IoVertxCoreNet::SelfSignedCertificate.java_class
end

+ (Object) unwrap(obj)



25
26
27
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/self_signed_certificate.rb', line 25

def @@j_api_type.unwrap(obj)
  obj.j_del
end

+ (Object) wrap(obj)



22
23
24
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/self_signed_certificate.rb', line 22

def @@j_api_type.wrap(obj)
  SelfSignedCertificate.new(obj)
end

Instance Method Details

- (String) certificate_path

Filesystem path to the X.509 certificate file in PEM format .

Returns:

  • (String)
    the absolute path to the certificate.

Raises:

  • (ArgumentError)


60
61
62
63
64
65
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/self_signed_certificate.rb', line 60

def certificate_path
  if !block_given?
    return @j_del.java_method(:certificatePath, []).call()
  end
  raise ArgumentError, "Invalid arguments when calling certificate_path()"
end

- (void) delete

This method returns an undefined value.

Delete the private key and certificate files.

Raises:

  • (ArgumentError)


68
69
70
71
72
73
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/self_signed_certificate.rb', line 68

def delete
  if !block_given?
    return @j_del.java_method(:delete, []).call()
  end
  raise ArgumentError, "Invalid arguments when calling delete()"
end

- (Hash) key_cert_options

Provides the Nil RSA private key file in PEM format corresponding to the #private_key_path

Returns:

  • (Hash)
    a Hash based on the generated certificate.

Raises:

  • (ArgumentError)


36
37
38
39
40
41
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/self_signed_certificate.rb', line 36

def key_cert_options
  if !block_given?
    return @j_del.java_method(:keyCertOptions, []).call() != nil ? JSON.parse(@j_del.java_method(:keyCertOptions, []).call().toJson.encode) : nil
  end
  raise ArgumentError, "Invalid arguments when calling key_cert_options()"
end

- (String) private_key_path

Filesystem path to the RSA private key file in PEM format

Returns:

  • (String)
    the absolute path to the private key.

Raises:

  • (ArgumentError)


52
53
54
55
56
57
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/self_signed_certificate.rb', line 52

def private_key_path
  if !block_given?
    return @j_del.java_method(:privateKeyPath, []).call()
  end
  raise ArgumentError, "Invalid arguments when calling private_key_path()"
end

- (Hash) trust_options

Provides the Nil X.509 certificate file in PEM format corresponding to the #certificate_path

Returns:

  • (Hash)
    a Hash based on the generated certificate.

Raises:

  • (ArgumentError)


44
45
46
47
48
49
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/self_signed_certificate.rb', line 44

def trust_options
  if !block_given?
    return @j_del.java_method(:trustOptions, []).call() != nil ? JSON.parse(@j_del.java_method(:trustOptions, []).call().toJson.encode) : nil
  end
  raise ArgumentError, "Invalid arguments when calling trust_options()"
end