public class DHE_RSA_Key_Exchange extends Key_Exchange
Modifier and Type | Field and Description |
---|---|
private static byte[] |
CLIENTFINISHEDLABEL |
private static mybouncycastle.org.bouncycastle.crypto.params.DHParameters |
DH_PARAMS |
private static byte[] |
KEYEXPANSION |
private byte[] |
m_clientrandom |
private mybouncycastle.org.bouncycastle.crypto.agreement.DHBasicAgreement |
m_dhe |
private mybouncycastle.org.bouncycastle.crypto.params.DHParameters |
m_dhparams |
private mybouncycastle.org.bouncycastle.crypto.params.DHPublicKeyParameters |
m_dhserverpub |
private byte[] |
m_mastersecret |
private byte[] |
m_premastersecret |
private byte[] |
m_serverrandom |
private static byte[] |
MASTERSECRET |
private static int |
MAXKEYMATERIALLENGTH |
private static java.math.BigInteger |
SAFEPRIME |
private static byte[] |
SERVERFINISHEDLABEL |
Constructor and Description |
---|
DHE_RSA_Key_Exchange() |
Modifier and Type | Method and Description |
---|---|
byte[] |
calculateClientFinished(byte[] handshakemessages)
generate the client finished message (see RFC2246)
|
byte[] |
calculateClientKeyExchange()
generates the client key exchange message (see RFC2246)
|
byte[] |
calculateKeys()
calculates the key material (see RFC2246 TLS Record Protocoll)
|
byte[] |
calculateServerFinished(byte[] handshakemessages)
calculates server finished message
|
byte[] |
generateServerKeyExchange(IMyPrivateKey key,
byte[] clientrandom,
byte[] serverrandom) |
void |
processClientFinished(byte[] verify_data,
byte[] handshakemessages)
checks the client finished message
|
void |
processClientKeyExchange(java.math.BigInteger dh_y)
processes the client key exchange
|
void |
processServerFinished(byte[] b,
int len,
byte[] handshakemessages)
checks the server finished message
|
void |
processServerKeyExchange(byte[] bytes,
int bytes_offset,
int bytes_len,
byte[] clientrandom,
byte[] serverrandom,
JAPCertificate servercertificate)
Decode the server keys and check the certificate
|
private static final int MAXKEYMATERIALLENGTH
private static final byte[] CLIENTFINISHEDLABEL
private static final byte[] SERVERFINISHEDLABEL
private static final byte[] KEYEXPANSION
private static final byte[] MASTERSECRET
private static final java.math.BigInteger SAFEPRIME
private static final mybouncycastle.org.bouncycastle.crypto.params.DHParameters DH_PARAMS
private mybouncycastle.org.bouncycastle.crypto.params.DHParameters m_dhparams
private mybouncycastle.org.bouncycastle.crypto.params.DHPublicKeyParameters m_dhserverpub
private byte[] m_premastersecret
private byte[] m_mastersecret
private byte[] m_clientrandom
private byte[] m_serverrandom
private mybouncycastle.org.bouncycastle.crypto.agreement.DHBasicAgreement m_dhe
public byte[] generateServerKeyExchange(IMyPrivateKey key, byte[] clientrandom, byte[] serverrandom) throws TLSException
generateServerKeyExchange
in class Key_Exchange
TLSException
public void processServerKeyExchange(byte[] bytes, int bytes_offset, int bytes_len, byte[] clientrandom, byte[] serverrandom, JAPCertificate servercertificate) throws TLSException
Key_Exchange
processServerKeyExchange
in class Key_Exchange
clientrandom
- clientrandomserverrandom
- serverrandomTLSException
public byte[] calculateServerFinished(byte[] handshakemessages)
Key_Exchange
calculateServerFinished
in class Key_Exchange
handshakemessages
- handshakemessagespublic void processServerFinished(byte[] b, int len, byte[] handshakemessages) throws TLSException
Key_Exchange
processServerFinished
in class Key_Exchange
b
- server finished messageTLSException
public void processClientKeyExchange(java.math.BigInteger dh_y)
Key_Exchange
processClientKeyExchange
in class Key_Exchange
dh_y
- diffie hellman parameterpublic byte[] calculateClientKeyExchange() throws TLSException
Key_Exchange
calculateClientKeyExchange
in class Key_Exchange
TLSException
public void processClientFinished(byte[] verify_data, byte[] handshakemessages) throws TLSException
Key_Exchange
processClientFinished
in class Key_Exchange
verify_data
- verify datahandshakemessages
- handshakemessagesTLSException
public byte[] calculateClientFinished(byte[] handshakemessages) throws TLSException
Key_Exchange
calculateClientFinished
in class Key_Exchange
handshakemessages
- all handshakemessages that have been send before thisTLSException
public byte[] calculateKeys()
Key_Exchange
calculateKeys
in class Key_Exchange
Copyright © 2023. All rights reserved.