public class MyProxy extends Object
More information about MyProxy is available on the MyProxy Home Page.
Modifier and Type | Field and Description |
---|---|
protected Authorization |
authorization
The authorization policy in effect for the target MyProxy server.
|
static int |
CHANGE_PASSWORD
The integer command number for the MyProxy Password Change
command (4).
|
protected GSSContext |
context
The GSSContext for communication with the MyProxy server.
|
static int |
DEFAULT_KEYBITS
The default key size (2048 bits).
|
static int |
DEFAULT_PORT
The default MyProxy server port (7512).
|
static int |
DESTROY_PROXY
The integer command number for the MyProxy 'Destroy' command (3).
|
static int |
GET_PROXY
The integer command number for the MyProxy 'Get' command (0).
|
static int |
GET_TRUSTROOTS
The integer command number for the MyProxy 'Get Trustroots' command (7).
|
protected String |
host
The hostname(s) of the target MyProxy server(s).
|
static int |
INFO_PROXY
The integer command number for the MyProxy 'Info' command (2).
|
static int |
MIN_PASSWORD_LENGTH |
static String |
MYPROXY_PROTOCOL_VERSION |
protected int |
port
The port of the target MyProxy server (default 7512).
|
static int |
PUT_PROXY
The integer command number for the MyProxy 'Put' command (1).
|
static int |
RETRIEVE_CREDENTIAL
The integer command number for the MyProxy 'Retrieve' command (6).
|
static int |
STORE_CREDENTIAL
The integer command number for the MyProxy 'Store' command (5).
|
protected String[] |
trustrootData |
protected String[] |
trustrootFilenames
Trustroot information and path constant.
|
static String |
version |
Constructor and Description |
---|
MyProxy()
Initialize the MyProxy client object with the default
authorization policy.
|
MyProxy(String host,
int port)
Prepare to connect to the MyProxy server at the specified
host and port using the default authorization policy.
|
Modifier and Type | Method and Description |
---|---|
void |
bootstrapTrust()
Bootstraps trustroot information from the MyProxy server.
|
void |
changePassword(GSSCredential credential,
ChangePasswordParams params)
Changes the password of the credential on the
MyProxy server.
|
void |
destroy(GSSCredential credential,
DestroyParams params)
Removes delegated credentials from the MyProxy server.
|
void |
destroy(GSSCredential credential,
String username,
String passphrase)
Removes delegated credentials from the MyProxy server.
|
GSSCredential |
get(GSSCredential credential,
GetParams params)
Retrieves delegated credentials from the MyProxy server.
|
GSSCredential |
get(GSSCredential credential,
String username,
String passphrase,
int lifetime)
Retrieves delegated credentials from the MyProxy server.
|
GSSCredential |
get(String username,
String passphrase,
int lifetime)
Retrieves delegated credentials from MyProxy server Anonymously
(without local credentials)
Notes: Performs simple verification of private/public keys of
the delegated credential.
|
Authorization |
getAuthorization()
Get MyProxy server authorization mechanism.
|
String |
getHost()
Get MyProxy server hostname.
|
int |
getPort()
Get MyProxy server port.
|
static String |
getTrustRootPath()
Returns the trusted certificates directory location where
writeTrustRoots() will store certificates.
|
void |
getTrustroots(GSSCredential credential,
GetTrustrootsParams params)
Retrieves trustroot information from the MyProxy server.
|
CredentialInfo[] |
info(GSSCredential credential,
InfoParams params)
Retrieves credential information from MyProxy server.
|
CredentialInfo |
info(GSSCredential credential,
String username,
String passphrase)
Retrieves credential information from MyProxy server.
|
void |
put(GSSCredential credential,
InitParams params)
Delegate credentials to a MyProxy server.
|
void |
put(GSSCredential credential,
String username,
String passphrase,
int lifetime)
Delegate credentials to a MyProxy server.
|
void |
setAuthorization(Authorization authorization)
Set MyProxy server authorization mechanism.
|
void |
setHost(String host)
Set MyProxy server hostname.
|
void |
setPort(int port)
Set MyProxy server port.
|
void |
store(GSSCredential credential,
X509Certificate[] certs,
OpenSSLKey key,
StoreParams params)
Store credentials on a MyProxy server.
|
boolean |
writeTrustRoots()
Writes the retrieved trust roots to the Globus trusted certificates
directory.
|
boolean |
writeTrustRoots(String directory)
Writes the retrieved trust roots to a trusted certificates directory.
|
public static final String version
public static final int MIN_PASSWORD_LENGTH
public static final String MYPROXY_PROTOCOL_VERSION
public static final int DEFAULT_PORT
public static final int DEFAULT_KEYBITS
public static final int GET_PROXY
public static final int PUT_PROXY
public static final int INFO_PROXY
public static final int DESTROY_PROXY
public static final int CHANGE_PASSWORD
public static final int STORE_CREDENTIAL
public static final int RETRIEVE_CREDENTIAL
public static final int GET_TRUSTROOTS
protected String host
protected int port
protected Authorization authorization
protected GSSContext context
protected String[] trustrootFilenames
protected String[] trustrootData
public MyProxy()
public MyProxy(String host, int port)
host
- The hostname(s) of the MyProxy server(s) with optional port
info. Multiple hostnames can be specified in a comma separated
list with each hostname optionally followed by a ':' and port
number. The client will communicate with the first server it has
a successful network connection with.port
- The port number of the MyProxy server to use if one is not
specified as part of the host string.public void setHost(String host)
host
- The hostname(s) of the MyProxy server(s). Multiple host names
are comma delimited with each hostname optionally followed by a
':' and port number. The client will communicate with the first
server it has a successful network connection with.public String getHost()
public void setPort(int port)
port
- The port number of the MyProxy server to use if one is not
specified as part of the host string. Defaults to
MyProxy.DEFAULT_PORT.public int getPort()
public void setAuthorization(Authorization authorization)
authorization
- The authorization mechanism for the MyProxy server.public Authorization getAuthorization()
public void put(GSSCredential credential, String username, String passphrase, int lifetime) throws MyProxyException
credential
- The GSI credentials to use.username
- The username to store the credentials under.passphrase
- The passphrase to use to encrypt the stored
credentials.lifetime
- The maximum lifetime of credentials delegated by the server
(in seconds).MyProxyException
- If an error occurred during the operation.public void put(GSSCredential credential, InitParams params) throws MyProxyException
credential
- The GSI credentials to use.params
- The parameters for the put operation.MyProxyException
- If an error occurred during the operation.public void store(GSSCredential credential, X509Certificate[] certs, OpenSSLKey key, StoreParams params) throws MyProxyException
credential
- The local GSI credentials to use for authentication.certs
- The certificate(s) to store.key
- The private key to store (typically encrypted).params
- The parameters for the store operation.MyProxyException
- If an error occurred during the operation.public void destroy(GSSCredential credential, String username, String passphrase) throws MyProxyException
credential
- The local GSI credentials to use for authentication.username
- The username of the credentials to remove.passphrase
- The passphrase of the credentials to remove.MyProxyException
- If an error occurred during the operation.public void destroy(GSSCredential credential, DestroyParams params) throws MyProxyException
credential
- The local GSI credentials to use for authentication.params
- The parameters for the destroy operation.MyProxyException
- If an error occurred during the operation.public void changePassword(GSSCredential credential, ChangePasswordParams params) throws MyProxyException
credential
- The local GSI credentials to use for authentication.params
- The parameters for the change password operation.MyProxyException
- If an error occurred during the operation.public CredentialInfo info(GSSCredential credential, String username, String passphrase) throws MyProxyException
credential
- The local GSI credentials to use for authentication.username
- The username of the credentials to remove.passphrase
- The passphrase of the credentials to remove.MyProxyException
- If an error occurred during the operation.public CredentialInfo[] info(GSSCredential credential, InfoParams params) throws MyProxyException
credential
- The local GSI credentials to use for authentication.params
- The parameters for the info operation.MyProxyException
- If an error occurred during the operation.public GSSCredential get(String username, String passphrase, int lifetime) throws MyProxyException
username
- The username of the credentials to retrieve.passphrase
- The passphrase of the credentials to retrieve.lifetime
- The requested lifetime of the retrieved credential (in seconds).MyProxyException
- If an error occurred during the operation.public GSSCredential get(GSSCredential credential, String username, String passphrase, int lifetime) throws MyProxyException
credential
- The local GSI credentials to use for authentication.
Can be set to null if no local credentials.username
- The username of the credentials to retrieve.passphrase
- The passphrase of the credentials to retrieve.lifetime
- The requested lifetime of the retrieved credential (in seconds).MyProxyException
- If an error occurred during the operation.public GSSCredential get(GSSCredential credential, GetParams params) throws MyProxyException
credential
- The local GSI credentials to use for authentication.
Can be set to null if no local credentials.params
- The parameters for the get operation.MyProxyException
- If an error occurred during the operation.public void getTrustroots(GSSCredential credential, GetTrustrootsParams params) throws MyProxyException
credential
- The local GSI credentials to use for authentication.
Can be set to null if no local credentials.params
- The parameters for the get-trustroots operation.MyProxyException
- If an error occurred during the operation.public void bootstrapTrust() throws MyProxyException
MyProxyException
- If an error occurred during the operation.public static String getTrustRootPath()
public boolean writeTrustRoots() throws IOException
IOException
public boolean writeTrustRoots(String directory) throws IOException
directory
- path where the trust roots should be writtenIOException
Copyright © 2016. All rights reserved.