Bouncy Castle Cryptography Library 1.49

org.bouncycastle.crypto.tls
Class TlsPSKKeyExchange

java.lang.Object
  extended by org.bouncycastle.crypto.tls.AbstractTlsKeyExchange
      extended by org.bouncycastle.crypto.tls.TlsPSKKeyExchange
All Implemented Interfaces:
TlsKeyExchange

public class TlsPSKKeyExchange
extends AbstractTlsKeyExchange

TLS 1.0 PSK key exchange (RFC 4279).


Field Summary
protected  DHPrivateKeyParameters dhAgreeClientPrivateKey
           
protected  DHPublicKeyParameters dhAgreeServerPublicKey
           
protected  byte[] premasterSecret
           
protected  byte[] psk_identity_hint
           
protected  TlsPSKIdentity pskIdentity
           
protected  RSAKeyParameters rsaServerPublicKey
           
protected  AsymmetricKeyParameter serverPublicKey
           
 
Fields inherited from class org.bouncycastle.crypto.tls.AbstractTlsKeyExchange
context, keyExchange, supportedSignatureAlgorithms
 
Constructor Summary
TlsPSKKeyExchange(int keyExchange, java.util.Vector supportedSignatureAlgorithms, TlsPSKIdentity pskIdentity)
           
 
Method Summary
 void generateClientKeyExchange(java.io.OutputStream output)
           
protected  byte[] generateOtherSecret(int pskLength)
           
 byte[] generatePremasterSecret()
           
 void processClientCredentials(TlsCredentials clientCredentials)
           
 void processServerCertificate(Certificate serverCertificate)
           
 void processServerKeyExchange(java.io.InputStream input)
           
 boolean requiresServerKeyExchange()
           
 void skipServerCredentials()
           
 void validateCertificateRequest(CertificateRequest certificateRequest)
           
protected  RSAKeyParameters validateRSAPublicKey(RSAKeyParameters key)
           
 
Methods inherited from class org.bouncycastle.crypto.tls.AbstractTlsKeyExchange
generateServerKeyExchange, init, processClientCertificate, processClientKeyExchange, processServerCredentials, skipClientCredentials, skipServerKeyExchange
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pskIdentity

protected TlsPSKIdentity pskIdentity

psk_identity_hint

protected byte[] psk_identity_hint

dhAgreeServerPublicKey

protected DHPublicKeyParameters dhAgreeServerPublicKey

dhAgreeClientPrivateKey

protected DHPrivateKeyParameters dhAgreeClientPrivateKey

serverPublicKey

protected AsymmetricKeyParameter serverPublicKey

rsaServerPublicKey

protected RSAKeyParameters rsaServerPublicKey

premasterSecret

protected byte[] premasterSecret
Constructor Detail

TlsPSKKeyExchange

public TlsPSKKeyExchange(int keyExchange,
                         java.util.Vector supportedSignatureAlgorithms,
                         TlsPSKIdentity pskIdentity)
Method Detail

skipServerCredentials

public void skipServerCredentials()
                           throws java.io.IOException
Throws:
java.io.IOException

processServerCertificate

public void processServerCertificate(Certificate serverCertificate)
                              throws java.io.IOException
Specified by:
processServerCertificate in interface TlsKeyExchange
Overrides:
processServerCertificate in class AbstractTlsKeyExchange
Throws:
java.io.IOException

requiresServerKeyExchange

public boolean requiresServerKeyExchange()
Specified by:
requiresServerKeyExchange in interface TlsKeyExchange
Overrides:
requiresServerKeyExchange in class AbstractTlsKeyExchange

processServerKeyExchange

public void processServerKeyExchange(java.io.InputStream input)
                              throws java.io.IOException
Specified by:
processServerKeyExchange in interface TlsKeyExchange
Overrides:
processServerKeyExchange in class AbstractTlsKeyExchange
Throws:
java.io.IOException

validateCertificateRequest

public void validateCertificateRequest(CertificateRequest certificateRequest)
                                throws java.io.IOException
Throws:
java.io.IOException

processClientCredentials

public void processClientCredentials(TlsCredentials clientCredentials)
                              throws java.io.IOException
Throws:
java.io.IOException

generateClientKeyExchange

public void generateClientKeyExchange(java.io.OutputStream output)
                               throws java.io.IOException
Throws:
java.io.IOException

generatePremasterSecret

public byte[] generatePremasterSecret()
                               throws java.io.IOException
Throws:
java.io.IOException

generateOtherSecret

protected byte[] generateOtherSecret(int pskLength)

validateRSAPublicKey

protected RSAKeyParameters validateRSAPublicKey(RSAKeyParameters key)
                                         throws java.io.IOException
Throws:
java.io.IOException

Bouncy Castle Cryptography Library 1.49