public class PublicPrivateKey extends Object implements EncryptionKey, ByteEncodable
BIT_LENGTH_UNKNOWN
Constructor and Description |
---|
PublicPrivateKey(byte[] src,
int offset,
int length) |
PublicPrivateKey(EncryptionKey key,
int encryptionBlockSize) |
PublicPrivateKey(RSAKey key) |
Modifier and Type | Method and Description |
---|---|
static PublicPrivateKey[] |
createNew() |
static PublicPrivateKey[] |
createNew(int bitLength,
long randomSeed) |
byte[] |
decrypt(byte[] source,
int offset,
int length) |
byte[] |
encodeBytes() |
int |
encodeBytes(ByteArray dest)
This requests the Object to encode itself as a stream of bytes which is appended
to the destination ByteArray.
|
byte[] |
encrypt(byte[] data,
int offset,
int length) |
static PublicPrivateKey |
fromEncryptedText(String text) |
int |
getBitLength() |
static void |
main(String[] args) |
String |
toEncryptedText() |
public PublicPrivateKey(RSAKey key)
public PublicPrivateKey(EncryptionKey key, int encryptionBlockSize)
public PublicPrivateKey(byte[] src, int offset, int length) throws StreamCorruptedException
StreamCorruptedException
public int getBitLength()
getBitLength
in interface EncryptionKey
public byte[] decrypt(byte[] source, int offset, int length) throws IOException
decrypt
in interface EncryptionKey
IOException
public byte[] encrypt(byte[] data, int offset, int length) throws IOException
encrypt
in interface EncryptionKey
IOException
public byte[] encodeBytes()
encodeBytes
in interface ByteEncodable
public int encodeBytes(ByteArray dest)
ByteEncodable
encodeBytes
in interface ByteEncodable
dest
- The destination ByteArray, or null to determine the number of bytes needed to encode.public static PublicPrivateKey[] createNew(int bitLength, long randomSeed)
public static PublicPrivateKey[] createNew()
public static PublicPrivateKey fromEncryptedText(String text) throws IOException
IOException
public String toEncryptedText() throws IOException
IOException
public static void main(String[] args) throws IOException
IOException