net.i2p.data
Class SigningPrivateKey

java.lang.Object
  extended by net.i2p.data.DataStructureImpl
      extended by net.i2p.data.SimpleDataStructure
          extended by net.i2p.data.SigningPrivateKey
All Implemented Interfaces:
DataStructure

public class SigningPrivateKey
extends SimpleDataStructure

Defines the SigningPrivateKey as defined by the I2P data structure spec. A signing private key is 20 byte Integer. The private key represents only the exponent, not the primes, which are constant and defined in the crypto spec. This key varies from the PrivateKey in its usage (signing, not decrypting)

Author:
jrandom

Field Summary
static int KEYSIZE_BYTES
           
 
Fields inherited from class net.i2p.data.SimpleDataStructure
_data, _length
 
Constructor Summary
SigningPrivateKey()
           
SigningPrivateKey(byte[] data)
           
SigningPrivateKey(String base64Data)
          constructs from base64
 
Method Summary
 int length()
          The legal length of the byte array in this data structure
 SigningPublicKey toPublic()
          converts this signing private key to its public equivalent
 
Methods inherited from class net.i2p.data.SimpleDataStructure
calculateHash, equals, fromBase64, fromByteArray, getData, hashCode, readBytes, setData, toBase64, toByteArray, toString, writeBytes
 
Methods inherited from class net.i2p.data.DataStructureImpl
read
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

KEYSIZE_BYTES

public static final int KEYSIZE_BYTES
See Also:
Constant Field Values
Constructor Detail

SigningPrivateKey

public SigningPrivateKey()

SigningPrivateKey

public SigningPrivateKey(byte[] data)

SigningPrivateKey

public SigningPrivateKey(String base64Data)
                  throws DataFormatException
constructs from base64

Parameters:
base64Data - a string of base64 data (the output of .toBase64() called on a prior instance of SigningPrivateKey
Throws:
DataFormatException
Method Detail

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

toPublic

public SigningPublicKey toPublic()
converts this signing private key to its public equivalent

Returns:
a SigningPublicKey object derived from this private key