|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.geant.edugain.base.SecureConnection
public class SecureConnection
This class manages HTTP connections through secure SSL channels verified within the eduGAIN trust policies.
| Field Summary | |
|---|---|
private java.lang.StringBuffer |
buffer
|
private Configurator |
cfg
|
private javax.net.ssl.HttpsURLConnection |
connection
|
private javax.net.ssl.SSLContext |
context
|
private javax.net.ssl.SSLSocketFactory |
factory
|
private java.security.KeyStore |
keystore
|
private javax.net.ssl.KeyManagerFactory |
kmf
|
private org.apache.log4j.Logger |
log
|
private boolean |
opened
|
private java.lang.String |
req_method
|
private java.security.cert.X509Certificate |
srv_crt
|
private javax.net.ssl.TrustManagerFactory |
tmf
|
private java.security.KeyStore |
truststore
|
| Constructor Summary | |
|---|---|
SecureConnection()
Create a new instance of SecureConnection |
|
SecureConnection(Configurator config)
Create a new instance of SecureConnection |
|
SecureConnection(java.security.KeyStore ks)
Create a new instance of SecureConnection |
|
SecureConnection(java.security.cert.X509Certificate[] chain)
Create a new instance of SecureConnection |
|
| Method Summary | |
|---|---|
java.lang.StringBuffer |
getContents()
Get the contents of the response, if any. |
private void |
loadFactory()
|
javax.net.ssl.HttpsURLConnection |
open(java.net.URL url)
Open a new SSL connection, validating the server certificate. |
javax.net.ssl.HttpsURLConnection |
open(java.net.URL url,
boolean validate)
Open a new SSL connection specifying whether you want to validate server certificate or not. |
void |
setGet()
Configure this connection as a HTTP GET request. |
void |
setPost()
Configure this connection as a HTTP POST request. |
void |
setTrustPath(java.security.cert.X509Certificate[] chain)
Set the trust path to use to validate server certificate. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private java.security.KeyStore keystore
private java.security.KeyStore truststore
private javax.net.ssl.HttpsURLConnection connection
private javax.net.ssl.SSLSocketFactory factory
private javax.net.ssl.KeyManagerFactory kmf
private javax.net.ssl.TrustManagerFactory tmf
private javax.net.ssl.SSLContext context
private Configurator cfg
private java.security.cert.X509Certificate srv_crt
private boolean opened
private java.lang.StringBuffer buffer
private java.lang.String req_method
private org.apache.log4j.Logger log
| Constructor Detail |
|---|
public SecureConnection()
throws BaseException
BaseException
public SecureConnection(Configurator config)
throws BaseException
config - An eduGAIN Configurator instance.
BaseException
public SecureConnection(java.security.KeyStore ks)
throws BaseException
ks - A keystore to retrieve keys from.
BaseException
public SecureConnection(java.security.cert.X509Certificate[] chain)
throws BaseException
chain - The certificate chain to use as trust path.
BaseException| Method Detail |
|---|
private void loadFactory()
throws BaseException
BaseException
public void setTrustPath(java.security.cert.X509Certificate[] chain)
throws BaseException
chain - The certificate chain to use as trust path.
BaseExceptionpublic void setGet()
public void setPost()
public javax.net.ssl.HttpsURLConnection open(java.net.URL url)
throws BaseException
url - The URL to connect to.
BaseException
public javax.net.ssl.HttpsURLConnection open(java.net.URL url,
boolean validate)
throws BaseException
url - The URL to connect to.validate - Whether to validate server cert or not.
BaseException
public java.lang.StringBuffer getContents()
throws BaseException
BaseException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||