|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.uiuc.ncsa.MyProxy.MyProxyLogon
public class MyProxyLogon
The MyProxyLogon class provides an interface for retrieving credentials from a MyProxy server.
First, usesetHost
, setPort
,
setUsername
, setPassphrase
,
setCredentialName
, setLifetime
and
requestTrustRoots
to configure. Then call connect
,
logon
, getCredentials
, then
disconnect
. Use getCertificates
and
getPrivateKey
to access the retrieved credentials, or
writeProxyFile
or saveCredentialsToFile
to
write them to a file. Use writeTrustRoots
,
getTrustedCAs
, getCRLs
,
getTrustRootData
, and getTrustRootFilenames
for trust root information.
Field Summary | |
---|---|
static java.lang.String |
BouncyCastleLicense
|
static java.lang.String |
version
|
Constructor Summary | |
---|---|
MyProxyLogon()
Constructs a MyProxyLogon object. |
Method Summary | |
---|---|
void |
connect()
Connects to the MyProxy server at the desired host and port. |
void |
disconnect()
Disconnects from the MyProxy server. |
java.util.Collection |
getCertificates()
Gets the certificates returned from the MyProxy server by getCredentials(). |
java.lang.String |
getCredentialName()
Gets the optional MyProxy credential name. |
void |
getCredentials()
Retrieves credentials from the MyProxy server. |
java.security.cert.X509CRL[] |
getCRLs()
Gets the CRLs returned by the MyProxy server. |
static java.lang.String |
getExistingTrustRootPath()
Gets the existing trusted CA certificates directory. |
java.lang.String |
getHost()
Gets the hostname of the MyProxy server. |
javax.net.ssl.KeyManagerFactory |
getKeyManagerFactory()
Get the key manager factory set by setKeyManagerFactory(). |
int |
getLifetime()
Gets the requested credential lifetime. |
int |
getPort()
Gets the port of the MyProxy server. |
java.security.PrivateKey |
getPrivateKey()
Gets the private key generated by getCredentials(). |
static java.lang.String |
getProxyLocation()
Returns the default Globus proxy file location. |
java.security.cert.X509Certificate[] |
getTrustedCAs()
Gets the trusted CA certificates returned by the MyProxy server. |
java.lang.String[] |
getTrustRootData()
Gets trust root data corresponding to the trust root filenames. |
java.lang.String[] |
getTrustRootFilenames()
Gets trust root filenames. |
static java.lang.String |
getTrustRootPath()
Returns the trusted certificates directory location where writeTrustRoots() will store certificates. |
java.lang.String |
getUsername()
Gets the MyProxy username. |
void |
logon()
Logs on to the MyProxy server by issuing the MyProxy GET command. |
static void |
main(java.lang.String[] args)
Provides a simple command-line interface. |
void |
requestTrustRoots(boolean flag)
Sets whether to request trust roots (CA certificates, CRLs, signing policy files) from the MyProxy server. |
void |
saveCredentials(java.io.OutputStream os)
Writes the retrieved credentials to the specified output stream. |
void |
saveCredentialsToFile(java.lang.String filename)
Writes the retrieved credentials to the specified filename. |
void |
setCredentialName(java.lang.String credname)
Sets the optional MyProxy credential name. |
void |
setHost(java.lang.String host)
Sets the hostname of the MyProxy server. |
void |
setKeyManagerFactory(javax.net.ssl.KeyManagerFactory keyManagerFactory)
Set the key manager factory for use in client-side SSLSocket certificate-based authentication to the MyProxy server. |
void |
setLifetime(int seconds)
Sets the requested credential lifetime. |
void |
setPassphrase(java.lang.String passphrase)
Sets the MyProxy passphrase. |
void |
setPort(int port)
Sets the port of the MyProxy server. |
void |
setUsername(java.lang.String username)
Sets the MyProxy username. |
void |
writeProxyFile()
Writes the retrieved credentials to the Globus proxy file location. |
boolean |
writeTrustRoots()
Writes the retrieved trust roots to the Globus trusted certificates directory. |
boolean |
writeTrustRoots(java.lang.String directory)
Writes the retrieved trust roots to a trusted certificates directory. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String version
public static final java.lang.String BouncyCastleLicense
Constructor Detail |
---|
public MyProxyLogon()
Method Detail |
---|
public java.lang.String getHost()
public void setHost(java.lang.String host)
host
- MyProxy server hostnamepublic int getPort()
public void setPort(int port)
port
- MyProxy server portpublic java.lang.String getUsername()
public void setUsername(java.lang.String username)
username
- MyProxy usernamepublic java.lang.String getCredentialName()
public void setCredentialName(java.lang.String credname)
credname
- credential namepublic void setPassphrase(java.lang.String passphrase)
passphrase
- MyProxy passphrasepublic int getLifetime()
public void setLifetime(int seconds)
seconds
- Credential lifetimepublic java.util.Collection getCertificates()
public java.security.PrivateKey getPrivateKey()
public void requestTrustRoots(boolean flag)
flag
- If true, request trust roots. If false, don't request trust
roots.public java.lang.String[] getTrustRootFilenames()
public java.lang.String[] getTrustRootData()
public void connect() throws java.io.IOException, java.security.GeneralSecurityException
java.io.IOException
java.security.GeneralSecurityException
public javax.net.ssl.KeyManagerFactory getKeyManagerFactory()
public void setKeyManagerFactory(javax.net.ssl.KeyManagerFactory keyManagerFactory)
keyManagerFactory
- Key manager factory to usepublic void disconnect() throws java.io.IOException
java.io.IOException
public void logon() throws java.io.IOException, java.security.GeneralSecurityException
java.io.IOException
java.security.GeneralSecurityException
public void getCredentials() throws java.io.IOException, java.security.GeneralSecurityException
java.io.IOException
java.security.GeneralSecurityException
public void writeProxyFile() throws java.io.IOException, java.security.GeneralSecurityException
java.io.IOException
java.security.GeneralSecurityException
public void saveCredentials(java.io.OutputStream os) throws java.io.IOException, java.security.GeneralSecurityException
os
- OutputStream to write to
java.io.IOException
java.security.GeneralSecurityException
public void saveCredentialsToFile(java.lang.String filename) throws java.io.IOException, java.security.GeneralSecurityException
java.io.IOException
java.security.GeneralSecurityException
public boolean writeTrustRoots() throws java.io.IOException
java.io.IOException
public boolean writeTrustRoots(java.lang.String directory) throws java.io.IOException
directory
- path where the trust roots should be written
java.io.IOException
public java.security.cert.X509Certificate[] getTrustedCAs() throws java.security.cert.CertificateException
java.security.cert.CertificateException
public java.security.cert.X509CRL[] getCRLs() throws java.security.cert.CertificateException
java.security.cert.CertificateException
public static java.lang.String getTrustRootPath()
public static java.lang.String getExistingTrustRootPath()
public static java.lang.String getProxyLocation() throws java.io.IOException
java.io.IOException
public static void main(java.lang.String[] args)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |