class DecryptionManager
extends java.lang.Object
Constructor and Description |
---|
DecryptionManager()
EncryptionManager constructor.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
decryptData(byte[] cipherText,
int securityMechanism,
byte[] initVector,
byte[] sourcePublicKey)
This method generates a secret key using the application requester's
public key, and decrypts the usreid/password with the middle 8 bytes of
the generated secret key and a decryption token.
|
protected static byte[] |
generateSeed()
This method generates an 8-Byte random seed.
|
byte[] |
obtainPublicKey()
This method generates the public key and returns it.
|
protected static byte[] |
toHexByte(java.lang.String str,
int offset,
int length)
Convert a string into a byte array in hex format.
|
protected static java.lang.String |
toHexString(byte[] data,
int offset,
int length)
Convert a byte array to a String with a hexidecimal format.
|
DecryptionManager() throws java.sql.SQLException
java.sql.SQLException
- that wraps any errorpublic byte[] obtainPublicKey()
public byte[] decryptData(byte[] cipherText, int securityMechanism, byte[] initVector, byte[] sourcePublicKey) throws java.sql.SQLException
cipherText
- The byte array form userid/password to decrypt.securityMechanism
- security mechanisminitVector
- The byte array which is used to calculate the
decryption token for initializing the ciphersourcePublicKey
- application requester (encrypter)'s public key.java.sql.SQLException
protected static byte[] generateSeed() throws java.sql.SQLException
java.sql.SQLException
protected static java.lang.String toHexString(byte[] data, int offset, int length)
b & 0xf0
),
the second character represents the low nibble (b & 0x0f
).
data[offset]
is represented by the first two characters in the returned String.data
- byte arrayoffset
- starting byte (zero based) to convert.length
- number of bytes to convert.protected static byte[] toHexByte(java.lang.String str, int offset, int length)
b & 0xf0
),
the second byte
represents the low nibble (b & 0x0f
).
str.charAt(0)
is represented by the first two bytes
in the returned String.str
- stringoffset
- starting character (zero based) to convert.length
- number of characters to convert.