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
StreamCorruptedExceptionpublic int getBitLength()
getBitLength in interface EncryptionKeypublic byte[] decrypt(byte[] source,
int offset,
int length)
throws IOException
decrypt in interface EncryptionKeyIOExceptionpublic byte[] encrypt(byte[] data,
int offset,
int length)
throws IOException
encrypt in interface EncryptionKeyIOExceptionpublic byte[] encodeBytes()
encodeBytes in interface ByteEncodablepublic int encodeBytes(ByteArray dest)
ByteEncodableencodeBytes in interface ByteEncodabledest - 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
IOExceptionpublic String toEncryptedText() throws IOException
IOExceptionpublic static void main(String[] args) throws IOException
IOException