import
java.io.IOException;
import
java.io.InputStream;
import
java.net.*;
import
java.security.Principal;
import
java.security.cert.Certificate;
import
java.util.List;
import
java.util.Map;
import
javax.net.ssl.SSLPeerUnverifiedException;
public
class
GFG {
public
static
void
main(String args[])
throws
Exception
{
final
Principal gfgPrincipal =
new
Principal() {
public
String getName()
{
return
null
;
}
};
final
SecureCacheResponse secureCacheResponse
=
new
SecureCacheResponse() {
public
String getCipherSuite()
{
return
"Connection established"
;
}
public
List<Certificate>
getLocalCertificateChain()
{
return
null
;
}
public
List<Certificate>
getServerCertificateChain()
throws
SSLPeerUnverifiedException
{
return
null
;
}
public
Principal getPeerPrincipal()
throws
SSLPeerUnverifiedException
{
return
gfgPrincipal;
}
public
Principal getLocalPrincipal()
{
return
gfgPrincipal;
}
public
Map<String, List<String> >
getHeaders()
throws
IOException
{
return
null
;
}
public
InputStream getBody()
throws
IOException
{
return
null
;
}
};
System.out.println(
"getCipherSuite() method returns: "
+ secureCacheResponse.getCipherSuite());
System.out.println(
"getPeerPrincipal() method returns: "
+ secureCacheResponse.getPeerPrincipal());
System.out.println(
"getLocalCertificateChain() returns: "
+ secureCacheResponse
.getLocalCertificateChain());
System.out.println(
"getLocalPrincipal() method returns: "
+ secureCacheResponse.getLocalPrincipal());
}
}