|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.impl.drda.DecryptionManager
This class is used to decrypt password and/or userid. It uses Diffie_Hellman algorithm to get the publick key and secret key, and then DES encryption is done using certain token (based on security mechanism) and this side's own public key. Basically, this class is called when using a security mechanism that encrypts user ID and password (eusridpwd). This class uses IBM JCE to do Diffie_Hellman algorithm and DES encryption.
Field Summary | |
private static java.math.BigInteger |
base__
|
private static byte[] |
baseBytes__
|
private static int |
exponential_length__
|
private javax.crypto.KeyAgreement |
keyAgreement_
|
private java.security.KeyPair |
keyPair_
|
private java.security.KeyPairGenerator |
keyPairGenerator_
|
private static java.math.BigInteger |
modulus__
|
private static byte[] |
modulusBytes__
|
private javax.crypto.spec.DHParameterSpec |
paramSpec_
|
Constructor Summary | |
DecryptionManager()
EncryptionManager constructor. |
Method Summary | |
private byte[] |
calculateDecryptionToken(int securityMechanism,
byte[] initVector)
This method is used to calculate the decryption token. |
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. |
byte[] |
obtainPublicKey()
This method generates the public key and returns it. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final byte[] modulusBytes__
private static final java.math.BigInteger modulus__
private static final byte[] baseBytes__
private static final java.math.BigInteger base__
private static final int exponential_length__
private java.security.KeyPairGenerator keyPairGenerator_
private java.security.KeyPair keyPair_
private javax.crypto.KeyAgreement keyAgreement_
private javax.crypto.spec.DHParameterSpec paramSpec_
Constructor Detail |
public DecryptionManager() throws java.sql.SQLException
java.sql.SQLException
- that wraps any errorMethod Detail |
public byte[] obtainPublicKey()
private byte[] calculateDecryptionToken(int securityMechanism, byte[] initVector)
securityMechanism
- security mechanisminitVector
- userid or server(this side)'s connection key
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
|
Built on Tue 2006-10-10 19:23:47+0200, from revision exported | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |