|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectanon.crypto.tinytls.ciphersuites.CipherSuite
public abstract class CipherSuite
| Field Summary | |
|---|---|
private byte[] |
m_ciphersuitecode
|
protected java.lang.String |
m_ciphersuitename
|
protected byte[] |
m_clientmacsecret
client write mac secret |
protected byte[] |
m_clientwriteIV
client write IV, only used for block ciphers |
protected byte[] |
m_clientwritekey
client write key |
protected org.bouncycastle.crypto.modes.CBCBlockCipher |
m_decryptcipher
|
protected org.bouncycastle.crypto.modes.CBCBlockCipher |
m_encryptcipher
|
private org.bouncycastle.crypto.macs.HMac |
m_hmacInput
|
private org.bouncycastle.crypto.macs.HMac |
m_hmacOutput
|
private Key_Exchange |
m_keyexchangealgorithm
|
private MyRandom |
m_Random
|
protected long |
m_readsequenznumber
readsequenznumber for packages |
private JAPCertificate |
m_servercertificate
|
protected byte[] |
m_servermacsecret
server write mac secret |
protected byte[] |
m_serverwriteIV
server write IV, only used for block ciphers |
protected byte[] |
m_serverwritekey
server write key |
protected long |
m_writesequenznumber
writesequenznumber for packages |
| Constructor Summary | |
|---|---|
CipherSuite(byte[] code)
Constructor for a ciphersuite |
|
| Method Summary | |
|---|---|
byte[] |
calculateClientKeyExchange()
calculate the client keys (see RFC2246 Client Key Exchange) |
protected abstract void |
calculateKeys(byte[] keys,
boolean forclient)
calculate server and client write keys (see RFC2246 TLS Record Protocoll) |
void |
decode(TLSPlaintextRecord msg)
decodes a message with a symmetric key |
void |
encode(TLSPlaintextRecord msg)
encodes a message with a symmetric key |
byte[] |
getCipherSuiteCode()
returns the code of a ciphersuite (see RFC2246) |
Key_Exchange |
getKeyExchangeAlgorithm()
gets the key exchange algorithm that is used |
void |
processClientKeyExchange(java.math.BigInteger dh_y)
processes the client key exchange |
void |
processServerFinished(TLSPlaintextRecord msg,
byte[] handshakemessages)
validates the finishedmessage and throws a Exception if a error occure |
protected void |
setKeyExchangeAlgorithm(Key_Exchange ke)
sets the key exchange algorithm |
void |
setServerCertificate(JAPCertificate cert)
set the Server Certificate |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private byte[] m_ciphersuitecode
protected java.lang.String m_ciphersuitename
private Key_Exchange m_keyexchangealgorithm
private JAPCertificate m_servercertificate
protected org.bouncycastle.crypto.modes.CBCBlockCipher m_decryptcipher
protected org.bouncycastle.crypto.modes.CBCBlockCipher m_encryptcipher
private org.bouncycastle.crypto.macs.HMac m_hmacInput
private org.bouncycastle.crypto.macs.HMac m_hmacOutput
private MyRandom m_Random
protected long m_writesequenznumber
protected long m_readsequenznumber
protected byte[] m_clientwritekey
protected byte[] m_clientmacsecret
protected byte[] m_clientwriteIV
protected byte[] m_serverwritekey
protected byte[] m_servermacsecret
protected byte[] m_serverwriteIV
| Constructor Detail |
|---|
public CipherSuite(byte[] code)
throws TLSException
code - Code of the ciphersuite (see RFC2246)
TLSException| Method Detail |
|---|
protected void setKeyExchangeAlgorithm(Key_Exchange ke)
ke - Key Exchange Algorithmpublic Key_Exchange getKeyExchangeAlgorithm()
public void setServerCertificate(JAPCertificate cert)
cert - server certificatepublic byte[] getCipherSuiteCode()
public void processClientKeyExchange(java.math.BigInteger dh_y)
dh_y - diffie hellman parameter
public byte[] calculateClientKeyExchange()
throws TLSException
TLSException
public void processServerFinished(TLSPlaintextRecord msg,
byte[] handshakemessages)
throws TLSException
finishedmessage - the message that have to be valideted
TLSExceptionpublic void encode(TLSPlaintextRecord msg)
message - message
public void decode(TLSPlaintextRecord msg)
throws TLSException
message - message
TLSException
protected abstract void calculateKeys(byte[] keys,
boolean forclient)
keys - array of bytes(see RFC how it is calculated)public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||