Class DefaultLoadCredentialsStrategy
java.lang.Object
org.italiangrid.voms.credential.impl.AbstractLoadCredentialsStrategy
org.italiangrid.voms.credential.impl.DefaultLoadCredentialsStrategy
- All Implemented Interfaces:
LoadCredentialsStrategy,VOMSEnvironmentVariables
The default strategy used to load user credentials when no file is explicitly
pointed out by the user of this API.
Credentials are searched in the following places (in sequence):
- If the
X509_USER_CERTandX509_USER_KEYenvironment variables are set, their values are used to load the user credentials - If the
X509_USER_CERTandX509_USER_KEYsystem properties are set, their values are used to load the user credentials - If the
PKCS12_USER_CERTenvironment variable is set, its value is used to load the user credentials. - If the
PKCS12_USER_CERTsystem property is set, its value is used to load the user credentials. - The content of the
.globusdirectory in the user's home is searched for a PEM certificate (in theusercert.pemanduserkey.pemfiles). - The content of the .globus directory in the user's home is searched for a
PKC12 certificate (in the
usercert.p12file).
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate static final Stringprivate static final Stringprivate Stringstatic final Stringprivate static final ProxyNamingPolicyprivate Stringstatic final Stringstatic final StringFields inherited from class org.italiangrid.voms.credential.impl.AbstractLoadCredentialsStrategy
listenerFields inherited from interface org.italiangrid.voms.credential.VOMSEnvironmentVariables
PKCS12_USER_CERT, VOMS_USER_ID, X509_CERT_DIR, X509_USER_CERT, X509_USER_KEY, X509_USER_PROXY, X509_VOMS_DIR -
Constructor Summary
ConstructorsConstructorDescriptionDefaultLoadCredentialsStrategy(String homeFolder) DefaultLoadCredentialsStrategy(String homeFolder, String tempDir, LoadCredentialsEventListener listener) -
Method Summary
Modifier and TypeMethodDescriptiongetFromEnvOrSystemProperty(String propName) Looks for the value of a given property in the environment or in the system propertieseu.emi.security.authn.x509.X509CredentialloadCredentials(eu.emi.security.authn.x509.helpers.PasswordSupplier pf) Loads a user credentialprotected eu.emi.security.authn.x509.X509CredentialloadPEMCredentialFromEnv(eu.emi.security.authn.x509.helpers.PasswordSupplier pf) protected eu.emi.security.authn.x509.X509CredentialloadPEMCredentialsFromGlobusDir(eu.emi.security.authn.x509.helpers.PasswordSupplier pf) protected eu.emi.security.authn.x509.X509CredentialloadPKCS12CredentialFromEnv(eu.emi.security.authn.x509.helpers.PasswordSupplier pf) protected eu.emi.security.authn.x509.X509CredentialloadPKCS12CredentialsFromGlobusDir(eu.emi.security.authn.x509.helpers.PasswordSupplier pf) protected eu.emi.security.authn.x509.X509Credentialprotected eu.emi.security.authn.x509.X509CredentialMethods inherited from class org.italiangrid.voms.credential.impl.AbstractLoadCredentialsStrategy
fileExistsAndIsReadable, loadPEMCredential, loadPKCS12Credential, loadProxyCredential
-
Field Details
-
GLOBUS_PKCS12_CRED_PATH_SUFFIX
- See Also:
-
GLOBUS_PEM_CERT_PATH_SUFFIX
- See Also:
-
GLOBUS_PEM_KEY_PATH_SUFFIX
- See Also:
-
HOME_PROPERTY
- See Also:
-
TMPDIR_PROPERTY
- See Also:
-
TMPDIR_PATH
- See Also:
-
proxyPathBuilder
-
home
-
tmpDir
-
-
Constructor Details
-
DefaultLoadCredentialsStrategy
public DefaultLoadCredentialsStrategy(String homeFolder, String tempDir, LoadCredentialsEventListener listener) -
DefaultLoadCredentialsStrategy
-
DefaultLoadCredentialsStrategy
public DefaultLoadCredentialsStrategy() -
DefaultLoadCredentialsStrategy
-
-
Method Details
-
getFromEnvOrSystemProperty
Looks for the value of a given property in the environment or in the system properties- Parameters:
propName- the property that will be looked for- Returns:
- the property value, or null if no property was found
-
loadCredentials
public eu.emi.security.authn.x509.X509Credential loadCredentials(eu.emi.security.authn.x509.helpers.PasswordSupplier pf) Description copied from interface:LoadCredentialsStrategyLoads a user credential- Parameters:
pf- the password finder used to potentially decrypt the credential encrypted private key.- Returns:
- an
X509Credential, ornullif no credential was found
-
loadProxyFromUID
protected eu.emi.security.authn.x509.X509Credential loadProxyFromUID() -
loadProxyFromEnv
protected eu.emi.security.authn.x509.X509Credential loadProxyFromEnv() -
loadPEMCredentialFromEnv
protected eu.emi.security.authn.x509.X509Credential loadPEMCredentialFromEnv(eu.emi.security.authn.x509.helpers.PasswordSupplier pf) -
loadPKCS12CredentialFromEnv
protected eu.emi.security.authn.x509.X509Credential loadPKCS12CredentialFromEnv(eu.emi.security.authn.x509.helpers.PasswordSupplier pf) -
loadPKCS12CredentialsFromGlobusDir
protected eu.emi.security.authn.x509.X509Credential loadPKCS12CredentialsFromGlobusDir(eu.emi.security.authn.x509.helpers.PasswordSupplier pf) -
loadPEMCredentialsFromGlobusDir
protected eu.emi.security.authn.x509.X509Credential loadPEMCredentialsFromGlobusDir(eu.emi.security.authn.x509.helpers.PasswordSupplier pf)
-