Skip to content
Snippets Groups Projects
Commit 610cdacd authored by Lyubomir Marinov's avatar Lyubomir Marinov
Browse files

Implements DefaultTlsServer.getRSAEncryptionCredentials() which may be...

Implements DefaultTlsServer.getRSAEncryptionCredentials() which may be required by certain cipher suites.
parent a9f4661a
No related branches found
No related tags found
No related merge requests found
...@@ -26,6 +26,10 @@ public class TlsServerImpl ...@@ -26,6 +26,10 @@ public class TlsServerImpl
*/ */
private static final Logger logger = Logger.getLogger(TlsServerImpl.class); private static final Logger logger = Logger.getLogger(TlsServerImpl.class);
/**
*
* @see TlsServer#getCertificateRequest()
*/
private final CertificateRequest certificateRequest private final CertificateRequest certificateRequest
= new CertificateRequest( = new CertificateRequest(
new short[] { ClientCertificateType.rsa_sign }, new short[] { ClientCertificateType.rsa_sign },
...@@ -43,6 +47,16 @@ public class TlsServerImpl ...@@ -43,6 +47,16 @@ public class TlsServerImpl
*/ */
private final DtlsPacketTransformer packetTransformer; private final DtlsPacketTransformer packetTransformer;
/**
*
* @see DefaultTlsServer#getRSAEncryptionCredentials()
*/
private TlsEncryptionCredentials rsaEncryptionCredentials;
/**
*
* @see DefaultTlsServer#getRSASignerCredentials()
*/
private TlsSignerCredentials rsaSignerCredentials; private TlsSignerCredentials rsaSignerCredentials;
/** /**
...@@ -162,6 +176,36 @@ protected ProtocolVersion getMinimumVersion() ...@@ -162,6 +176,36 @@ protected ProtocolVersion getMinimumVersion()
/** /**
* {@inheritDoc} * {@inheritDoc}
*
* Depending on the <tt>selectedCipherSuite</tt>, <tt>DefaultTlsServer</tt>
* will require either <tt>rsaEncryptionCredentials</tt> or
* <tt>rsaSignerCredentials</tt> neither of which is implemented by
* <tt>DefaultTlsServer</tt>.
*/
@Override
protected TlsEncryptionCredentials getRSAEncryptionCredentials()
throws IOException
{
if (rsaEncryptionCredentials == null)
{
DtlsControlImpl dtlsControl = getDtlsControl();
rsaEncryptionCredentials
= new DefaultTlsEncryptionCredentials(
context,
dtlsControl.getCertificate(),
dtlsControl.getKeyPair().getPrivate());
}
return rsaEncryptionCredentials;
}
/**
* {@inheritDoc}
*
* Depending on the <tt>selectedCipherSuite</tt>, <tt>DefaultTlsServer</tt>
* will require either <tt>rsaEncryptionCredentials</tt> or
* <tt>rsaSignerCredentials</tt> neither of which is implemented by
* <tt>DefaultTlsServer</tt>.
*/ */
@Override @Override
protected TlsSignerCredentials getRSASignerCredentials() protected TlsSignerCredentials getRSASignerCredentials()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment