Bouncy Castle Cryptography 1.50

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  short[] clientECPointFormats
           
protected  DHPrivateKeyParameters dhAgreePrivateKey
           
protected  DHPublicKeyParameters dhAgreePublicKey
           
protected  DHParameters dhParameters
           
protected  int[] namedCurves
           
protected  byte[] premasterSecret
           
protected  byte[] psk_identity_hint
           
protected  TlsPSKIdentity pskIdentity
           
protected  RSAKeyParameters rsaServerPublicKey
           
protected  TlsEncryptionCredentials serverCredentials
           
protected  short[] serverECPointFormats
           
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, DHParameters dhParameters, int[] namedCurves, short[] clientECPointFormats, short[] serverECPointFormats)
           
 
Method Summary
 void generateClientKeyExchange(java.io.OutputStream output)
           
protected  byte[] generateOtherSecret(int pskLength)
           
 byte[] generatePremasterSecret()
           
 byte[] generateServerKeyExchange()
           
 void processClientCredentials(TlsCredentials clientCredentials)
           
 void processServerCertificate(Certificate serverCertificate)
           
 void processServerCredentials(TlsCredentials serverCredentials)
           
 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
init, processClientCertificate, processClientKeyExchange, 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

dhParameters

protected DHParameters dhParameters

namedCurves

protected int[] namedCurves

clientECPointFormats

protected short[] clientECPointFormats

serverECPointFormats

protected short[] serverECPointFormats

psk_identity_hint

protected byte[] psk_identity_hint

dhAgreePrivateKey

protected DHPrivateKeyParameters dhAgreePrivateKey

dhAgreePublicKey

protected DHPublicKeyParameters dhAgreePublicKey

serverPublicKey

protected AsymmetricKeyParameter serverPublicKey

rsaServerPublicKey

protected RSAKeyParameters rsaServerPublicKey

serverCredentials

protected TlsEncryptionCredentials serverCredentials

premasterSecret

protected byte[] premasterSecret
Constructor Detail

TlsPSKKeyExchange

public TlsPSKKeyExchange(int keyExchange,
                         java.util.Vector supportedSignatureAlgorithms,
                         TlsPSKIdentity pskIdentity,
                         DHParameters dhParameters,
                         int[] namedCurves,
                         short[] clientECPointFormats,
                         short[] serverECPointFormats)
Method Detail

skipServerCredentials

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

processServerCredentials

public void processServerCredentials(TlsCredentials serverCredentials)
                              throws java.io.IOException
Specified by:
processServerCredentials in interface TlsKeyExchange
Overrides:
processServerCredentials in class AbstractTlsKeyExchange
Throws:
java.io.IOException

generateServerKeyExchange

public byte[] generateServerKeyExchange()
                                 throws java.io.IOException
Specified by:
generateServerKeyExchange in interface TlsKeyExchange
Overrides:
generateServerKeyExchange in class AbstractTlsKeyExchange
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)
                              throws java.io.IOException
Throws:
java.io.IOException

validateRSAPublicKey

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

Bouncy Castle Cryptography 1.50