|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectclient.Cryptography
final class Cryptography
Provides methods for de- and encrypting messages.
| Field Summary | |
|---|---|
private javax.crypto.Cipher |
asymmetricCipher
Cipher for asymmetric cryptography. |
private static InternalInformationPortController |
internalInformationPort
Reference on component InternalInformationPortController. |
private javax.crypto.KeyGenerator |
keyGenerator
Key generator for symmetric cryptography and hash algorithm. |
private static java.util.logging.Logger |
LOGGER
Logger used to log and display information. |
private int |
NUMBER_OF_MIXES_IN_CASCADE
Number of mixes in the cascade. |
private java.security.Key[] |
PUBLIC_KEYS_OF_MIXES
Public keys of the cascade's mixes. |
private javax.crypto.spec.IvParameterSpec[] |
sessionIVs
Initialization vectors for the ciphers for each of the cascade's mixes. |
private javax.crypto.SecretKey[] |
sessionKeys
Session keys for the cascade's mixes. |
private javax.crypto.Cipher[] |
symmetricDecryptCiphers
Session (decrypt) ciphers for each of the cascade's mixes. |
private javax.crypto.Cipher[] |
symmetricEncryptCiphers
Session (encrypt) ciphers for each of the cascade's mixes. |
| Constructor Summary | |
|---|---|
protected |
Cryptography(java.security.Key[] publicKeysOfMixes)
Generates a new Cryptography object that can be used to de-
and encrypting messages (using the bypassed keys). |
| Method Summary | |
|---|---|
protected byte[] |
decryptReply(byte[] reply)
Decrypts the bypassed reply. |
protected Message |
encryptMessage(Message plaintextMessage,
int positionOfMixInCascade)
Encrypts the bypassed message (hybridly) for the specified mix. |
private static java.lang.String |
getProperty(java.lang.String key)
Simply used to shorten method calls (calls internalInformationPort.getProperty(key)). |
protected javax.crypto.spec.IvParameterSpec |
getSessionIVOfMix(int positionOfMixInCascade)
Returns the specified mix' initialization vector. |
protected javax.crypto.SecretKey |
getSessionKeyOfMix(int positionOfMixInCascade)
Returns the specified mix' session key. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static InternalInformationPortController internalInformationPort
InternalInformationPortController.
Used to display and/or log data and read general settings.
private static final java.util.logging.Logger LOGGER
private final int NUMBER_OF_MIXES_IN_CASCADE
private javax.crypto.Cipher asymmetricCipher
private javax.crypto.KeyGenerator keyGenerator
private final java.security.Key[] PUBLIC_KEYS_OF_MIXES
PUBLIC_KEYS_OF_MIXES[0].
private javax.crypto.SecretKey[] sessionKeys
sessionKeys[0].
private javax.crypto.spec.IvParameterSpec[] sessionIVs
sessionIVs[0].
symmetricEncryptCiphers,
symmetricDecryptCiphersprivate javax.crypto.Cipher[] symmetricEncryptCiphers
symmetricEncryptCiphers[0].
private javax.crypto.Cipher[] symmetricDecryptCiphers
symmetricEncryptCiphers[0].
| Constructor Detail |
|---|
protected Cryptography(java.security.Key[] publicKeysOfMixes)
Cryptography object that can be used to de-
and encrypting messages (using the bypassed keys).
publicKeysOfMixes - Public keys of the cascade's mixes. The
first mix' key must be located at
publicKeysOfMixes[0].| Method Detail |
|---|
protected javax.crypto.SecretKey getSessionKeyOfMix(int positionOfMixInCascade)
positionOfMixInCascade - The mix' position in the cascade, who's
session key shall be returned.
protected javax.crypto.spec.IvParameterSpec getSessionIVOfMix(int positionOfMixInCascade)
positionOfMixInCascade - The mix' position in the cascade, who's
initialization vector shall be returned.
protected Message encryptMessage(Message plaintextMessage,
int positionOfMixInCascade)
positionOfMixInCascade - The mix' position in the cascade, the
message shall be encrypted for.plaintextMessage - The message to be encrypted.
protected byte[] decryptReply(byte[] reply)
reply - The reply to be decrypted.
private static java.lang.String getProperty(java.lang.String key)
internalInformationPort.getProperty(key)). Returns the
property with the specified key from the property file.
key - The property key.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||