Help with comprehending the DTLS implementation Java 11

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Help with comprehending the DTLS implementation Java 11

Ben Gibbons
I am writing a P2P messenger in Java and am having to rewrite the TLS code I wrote with DTLS having realised I need to perform hole punching and that UDP has a higher success rate. Referencing both the "Java Cryptography: Tools and Techniques book which I purchased and these implementations.

Could you briefly explain what the classes in these files are doing? I am finding the documentation is quite thin and I am struggling to work it out by the decompiled classes. In the book there is no reference to the DTLSVerifier code in the DTLSServerTest or the anonymous class passed to DatagramSender, what does it do? 

How does the code in the above links validate both hosts? The book mentions for the client implementing tlsClient.getAuthentication() by defining the returned TlsAuthentication object and the methods notifyServerCertificate and getClientCredentials which pertain to it. The first validating the server and the second sending used for client authentication. It also suggests I implement tlsServer.getRSASignerCredentials to get the server credentials in addition to tlsServer.getCertificateRequest and tlsServer.notifyClientCertificate for client authentication. I have no idea how to do this and in the above code MockDTLS(Server/Client) are used in the place of DefaultTlsServer which is used in the book so are these recommendations still correct with this implementation?