| Modifier and Type | Field and Description |
|---|---|
| private static final BigInteger | |
| private static final byte[] | |
| private static final int | |
| private static char[] | hex_table
Resolve * The methods and static vars below should go into some 'shared' * package when the capability is put back in (StringUtil.java). |
| private KeyAgreement | |
| private KeyPair | |
| private KeyPairGenerator | |
| private static final BigInteger | |
| private static final byte[] | |
| private DHParameterSpec | |
| private static final int | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private byte[] | Returns: byte[] the decryption tokensecurity mechanism securityMechanism, byte[] userid or server(this side)'s connection key initVector)This method is used to calculate the decryption token. |
| public byte[] | Returns: the decrypted data (plain text) in a byte array.The byte array form userid/password to decrypt. cipherText, int security mechanism securityMechanism, byte[] The byte array which is used to calculate the
decryption token for initializing the cipher initVector, byte[] application requester (encrypter)'s public key. 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[] | |
| public byte[] | Returns: a byte array that is the application server's public keyThis method generates the public key and returns it. |
| protected static byte[] | |
| protected static String | Returns: the String (with hexidecimal format) form of the byte arraybyte array data, int starting byte (zero based) to convert. offset, int number of bytes to convert. length)Convert a byte array to a String with a hexidecimal format. |
| base__ | back to summary |
|---|---|
| private static final BigInteger base__ | |
| baseBytes__ | back to summary |
|---|---|
| private static final byte[] baseBytes__ | |
| exponential_length__ | back to summary |
|---|---|
| private static final int exponential_length__ | |
| hex_table | back to summary |
|---|---|
| private static char[] hex_table Resolve * The methods and static vars below should go into some 'shared' * package when the capability is put back in (StringUtil.java). * | |
| keyAgreement_ | back to summary |
|---|---|
| private KeyAgreement keyAgreement_ | |
| keyPair_ | back to summary |
|---|---|
| private KeyPair keyPair_ | |
| keyPairGenerator_ | back to summary |
|---|---|
| private KeyPairGenerator keyPairGenerator_ | |
| modulus__ | back to summary |
|---|---|
| private static final BigInteger modulus__ | |
| modulusBytes__ | back to summary |
|---|---|
| private static final byte[] modulusBytes__ | |
| paramSpec_ | back to summary |
|---|---|
| private DHParameterSpec paramSpec_ | |
| SECMEC_USRSSBPWD_SEED_LEN | back to summary |
|---|---|
| private static final int SECMEC_USRSSBPWD_SEED_LEN | |
| SHA_1_PRNG_ALGORITHM | back to summary |
|---|---|
| private static final String SHA_1_PRNG_ALGORITHM | |
| DecryptionManager | back to summary |
|---|---|
| pack-priv DecryptionManager() throws SQLException EncryptionManager constructor. In this constructor,DHParameterSpec, KeyPairGenerator, KeyPair, and KeyAgreement are initialized.
| |
| calculateDecryptionToken | back to summary |
|---|---|
| private byte[] calculateDecryptionToken(int securityMechanism, byte[] initVector) This method is used to calculate the decryption token. DES encrypts the data using a token and the generated shared private key. The token used depends on the type of security mechanism being used: USRENCPWD - The userid is used as the token. The USRID is zero-padded to 8 bytes if less than 8 bytes or truncated to 8 bytes if greater than 8 bytes. EUSRIDPWD - The middle 8 bytes of the server's connection key is used as the token. Decryption needs to use exactly the same token as encryption.
| |
| decryptData | back to summary |
|---|---|
| public byte[] decryptData(byte[] cipherText, int securityMechanism, byte[] initVector, byte[] sourcePublicKey) throws SQLException 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. Then it returns the decrypted data in a byte array.
| |
| generateSeed | back to summary |
|---|---|
| protected static byte[] generateSeed() throws SQLException This method generates an 8-Byte random seed. Required for the SECMEC_USRSSBPWD security mechanism
| |
| obtainPublicKey | back to summary |
|---|---|
| public byte[] obtainPublicKey() This method generates the public key and returns it. This shared public key is the application server's connection key and will be exchanged with the application requester's connection key. This connection key will be put in the sectkn in ACCSECRD command and send to the application requester.
| |
| toHexByte | back to summary |
|---|---|
| protected static byte[] toHexByte(String str, int offset, int length) Convert a string into a byte array in hex format.
| |
| toHexString | back to summary |
|---|---|
| protected static String toHexString(byte[] data, int offset, int length) Convert a byte array to a String with a hexidecimal format.
The String may be converted back to a byte array using fromHexString.
| |