net.i2p.data
Class PublicKey
java.lang.Object
net.i2p.data.DataStructureImpl
net.i2p.data.SimpleDataStructure
net.i2p.data.PublicKey
- All Implemented Interfaces:
- DataStructure
public class PublicKey
- extends SimpleDataStructure
Defines the PublicKey as defined by the I2P data structure spec.
A public key is 256byte Integer. The public key represents only the
exponent, not the primes, which are constant and defined in the crypto spec.
- Author:
- jrandom
Methods inherited from class net.i2p.data.SimpleDataStructure |
calculateHash, equals, fromBase64, fromByteArray, getData, hashCode, readBytes, setData, toBase64, toByteArray, toString, writeBytes |
KEYSIZE_BYTES
public static final int KEYSIZE_BYTES
- See Also:
- Constant Field Values
PublicKey
public PublicKey()
PublicKey
public PublicKey(byte[] data)
- Parameters:
data
- must be non-null
PublicKey
public PublicKey(String base64Data)
throws DataFormatException
- constructs from base64
- Parameters:
base64Data
- a string of base64 data (the output of .toBase64() called
on a prior instance of PublicKey
- Throws:
DataFormatException
create
public static PublicKey create(byte[] data,
int off)
- Pull from cache or return new
- Throws:
AIOOBE
- if not enough bytes- Since:
- 0.8.3
create
public static PublicKey create(InputStream in)
throws IOException
- Pull from cache or return new
- Throws:
IOException
- Since:
- 0.8.3
length
public int length()
- Description copied from class:
SimpleDataStructure
- The legal length of the byte array in this data structure
- Specified by:
length
in class SimpleDataStructure