public class TinyTLS
extends java.net.Socket
| Modifier and Type | Field and Description |
|---|---|
static byte[] |
PROTOCOLVERSION
SSL VERSION :
3.1 for TLS
|
| Constructor and Description |
|---|
TinyTLS(java.lang.String addr,
int port)
TinyTLS creates a TLS Connection to a server
|
TinyTLS(java.lang.String addr,
int port,
ImmutableProxyInterface a_proxyInterface)
TinyTLS creates a TLS Connection to a server which may use a proxy
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCipherSuite(CipherSuite cs)
add a ciphersuites to TinyTLS
|
void |
checkRootCertificate(boolean check)
check or check not the root certificate
|
void |
close() |
java.io.InputStream |
getInputStream() |
java.io.OutputStream |
getOutputStream() |
java.net.Socket |
getSocket() |
void |
setClientCertificate(JAPCertificate[] certificates,
IMyPrivateKey key)
sets a client certificate chain
|
void |
setClientCertificate(JAPCertificate cert,
IMyPrivateKey key)
sets the client certificate
|
void |
setRootKey(IMyPublicKey rootKey)
sets the root key that is accepted
|
void |
setSoTimeout(int i) |
void |
startHandshake()
start the handshake
|
bind, connect, connect, getChannel, getInetAddress, getKeepAlive, getLocalAddress, getLocalPort, getLocalSocketAddress, getOOBInline, getPort, getReceiveBufferSize, getRemoteSocketAddress, getReuseAddress, getSendBufferSize, getSoLinger, getSoTimeout, getTcpNoDelay, getTrafficClass, isBound, isClosed, isConnected, isInputShutdown, isOutputShutdown, sendUrgentData, setKeepAlive, setOOBInline, setPerformancePreferences, setReceiveBufferSize, setReuseAddress, setSendBufferSize, setSocketImplFactory, setSoLinger, setTcpNoDelay, setTrafficClass, shutdownInput, shutdownOutput, toStringpublic TinyTLS(java.lang.String addr,
int port)
throws java.net.UnknownHostException,
java.io.IOException,
java.lang.Exception
addr - Server Addressport - Server's TLS Portjava.net.UnknownHostExceptionjava.io.IOExceptionjava.lang.Exceptionpublic TinyTLS(java.lang.String addr,
int port,
ImmutableProxyInterface a_proxyInterface)
throws java.net.UnknownHostException,
java.io.IOException,
java.lang.Exception
addr - Server Addressport - Server's TLS Porta_proxyInterface - Proxy Settingsjava.net.UnknownHostExceptionjava.io.IOExceptionjava.lang.Exceptionpublic void addCipherSuite(CipherSuite cs)
cs - ciphersuite you want to addpublic void startHandshake()
throws java.io.IOException
java.io.IOExceptionCertificateExceptionjava.lang.Exceptionpublic void setRootKey(IMyPublicKey rootKey)
rootKey - rootkeypublic void checkRootCertificate(boolean check)
check - public java.io.InputStream getInputStream()
getInputStream in class java.net.Socketpublic java.io.OutputStream getOutputStream()
getOutputStream in class java.net.Socketpublic void setSoTimeout(int i)
throws java.net.SocketException
setSoTimeout in class java.net.Socketjava.net.SocketExceptionpublic void setClientCertificate(JAPCertificate cert, IMyPrivateKey key) throws java.io.IOException
cert - certificatekey - private keyjava.io.IOExceptionpublic void setClientCertificate(JAPCertificate[] certificates, IMyPrivateKey key) throws java.io.IOException
certificates - certificate chain, where the previous certificate is signed with the followingkey - private keyjava.io.IOExceptionpublic void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.net.Socketpublic java.net.Socket getSocket()
Copyright © 2023. All rights reserved.