Class: I2P::PublicKey

Inherits:
Key show all
Defined in:
lib/i2p/data/public_key.rb,
lib/i2p/sdk.rb

Overview

**I2P public key data structure.**

An I2P public key is a 2048-bit (256-byte) integer. The public key represents only the exponent, not the primes, which are constant and defined in the crypto spec.

Constant Summary collapse

BYTESIZE =

Since:

  • 0.1.3

256

Instance Attribute Summary

Attributes inherited from Key

#data

Instance Method Summary collapse

Methods inherited from Key

#initialize, read, #to_s, #valid?

Methods inherited from Structure

#==, #eql?, parse, read, #size, #to_base64, #to_s

Constructor Details

This class inherits a constructor from I2P::Key

Instance Method Details

#to_javaObject

Returns an instance of the Java class ‘net.i2p.data.PublicKey`.

**This method only works with JRuby, not with MRI or YARV.**



69
70
71
# File 'lib/i2p/sdk.rb', line 69

def to_java
  I2P::SDK::PublicKey.new(to_s.to_java_bytes)
end