- java.lang.Object
-
- net.luminis.tls.engine.impl.TlsEngineImpl
-
- All Implemented Interfaces:
MessageProcessor,TlsEngine,TrafficSecrets
- Direct Known Subclasses:
TlsClientEngineImpl,TlsServerEngineImpl
public abstract class TlsEngineImpl extends java.lang.Object implements TlsEngine
-
-
Field Summary
Fields Modifier and Type Field Description protected AlgorithmMappingalgorithmMappingprotected java.security.PrivateKeyprivateKeyprotected java.security.PublicKeypublicKeyprotected TlsStatestate
-
Constructor Summary
Constructors Constructor Description TlsEngineImpl()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected byte[]computeFinishedVerifyData(byte[] transcriptHash, byte[] baseKey)protected byte[]computeSignature(byte[] content, java.security.PrivateKey certificatePrivateKey, TlsConstants.SignatureScheme signatureScheme, boolean client)Compute the signature used in certificate verify message to proof possession of private key.protected voidgenerateKeys(TlsConstants.NamedGroup namedGroup)byte[]getClientApplicationTrafficSecret()byte[]getClientEarlyTrafficSecret()byte[]getClientHandshakeTrafficSecret()abstract TlsConstants.CipherSuitegetSelectedCipher()byte[]getServerApplicationTrafficSecret()byte[]getServerHandshakeTrafficSecret()protected java.security.SignaturegetSignatureAlgorithm(TlsConstants.SignatureScheme signatureScheme)static inthashLength(TlsConstants.CipherSuite cipher)static intkeyLength(TlsConstants.CipherSuite cipher)protected booleanrecognizedExtension(Extension extension)
-
-
-
Field Detail
-
publicKey
protected java.security.PublicKey publicKey
-
privateKey
protected java.security.PrivateKey privateKey
-
state
protected TlsState state
-
algorithmMapping
protected AlgorithmMapping algorithmMapping
-
-
Method Detail
-
getSelectedCipher
public abstract TlsConstants.CipherSuite getSelectedCipher()
-
hashLength
public static int hashLength(TlsConstants.CipherSuite cipher)
-
keyLength
public static int keyLength(TlsConstants.CipherSuite cipher)
-
generateKeys
protected void generateKeys(TlsConstants.NamedGroup namedGroup)
-
computeSignature
protected byte[] computeSignature(byte[] content, java.security.PrivateKey certificatePrivateKey, TlsConstants.SignatureScheme signatureScheme, boolean client) throws ErrorAlertCompute the signature used in certificate verify message to proof possession of private key.- Parameters:
content- the content to be signed (transcript hash)certificatePrivateKey- the private key associated with the certificatesignatureScheme-client- whether the signature must be computed- Returns:
- Throws:
ErrorAlert
-
computeFinishedVerifyData
protected byte[] computeFinishedVerifyData(byte[] transcriptHash, byte[] baseKey)
-
getSignatureAlgorithm
protected java.security.Signature getSignatureAlgorithm(TlsConstants.SignatureScheme signatureScheme) throws HandshakeFailureAlert
- Throws:
HandshakeFailureAlert
-
getClientEarlyTrafficSecret
public byte[] getClientEarlyTrafficSecret()
- Specified by:
getClientEarlyTrafficSecretin interfaceTrafficSecrets
-
getClientHandshakeTrafficSecret
public byte[] getClientHandshakeTrafficSecret()
- Specified by:
getClientHandshakeTrafficSecretin interfaceTrafficSecrets
-
getServerHandshakeTrafficSecret
public byte[] getServerHandshakeTrafficSecret()
- Specified by:
getServerHandshakeTrafficSecretin interfaceTrafficSecrets
-
getClientApplicationTrafficSecret
public byte[] getClientApplicationTrafficSecret()
- Specified by:
getClientApplicationTrafficSecretin interfaceTrafficSecrets
-
getServerApplicationTrafficSecret
public byte[] getServerApplicationTrafficSecret()
- Specified by:
getServerApplicationTrafficSecretin interfaceTrafficSecrets
-
recognizedExtension
protected boolean recognizedExtension(Extension extension)
-
-