net.i2p.data
Class SigningPrivateKey
java.lang.Object
net.i2p.data.DataStructureImpl
net.i2p.data.SimpleDataStructure
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
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 |
KEYSIZE_BYTES
public static final int KEYSIZE_BYTES
- See Also:
- Constant Field Values
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
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