Class DefaultLoadCredentialsStrategy

java.lang.Object
org.italiangrid.voms.credential.impl.AbstractLoadCredentialsStrategy
org.italiangrid.voms.credential.impl.DefaultLoadCredentialsStrategy
All Implemented Interfaces:
LoadCredentialsStrategy, VOMSEnvironmentVariables

public class DefaultLoadCredentialsStrategy extends AbstractLoadCredentialsStrategy
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_CERT and X509_USER_KEY environment variables are set, their values are used to load the user credentials
  • If the X509_USER_CERT and X509_USER_KEY system properties are set, their values are used to load the user credentials
  • If the PKCS12_USER_CERT environment variable is set, its value is used to load the user credentials.
  • If the PKCS12_USER_CERT system property is set, its value is used to load the user credentials.
  • The content of the .globus directory in the user's home is searched for a PEM certificate (in the usercert.pem and userkey.pem files).
  • The content of the .globus directory in the user's home is searched for a PKC12 certificate (in the usercert.p12 file).
  • Field Details

  • Constructor Details

    • DefaultLoadCredentialsStrategy

      public DefaultLoadCredentialsStrategy(String homeFolder, String tempDir, LoadCredentialsEventListener listener)
    • DefaultLoadCredentialsStrategy

      public DefaultLoadCredentialsStrategy(String homeFolder)
    • DefaultLoadCredentialsStrategy

      public DefaultLoadCredentialsStrategy()
    • DefaultLoadCredentialsStrategy

      public DefaultLoadCredentialsStrategy(LoadCredentialsEventListener listener)
  • Method Details

    • getFromEnvOrSystemProperty

      public String getFromEnvOrSystemProperty(String propName)
      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: LoadCredentialsStrategy
      Loads a user credential
      Parameters:
      pf - the password finder used to potentially decrypt the credential encrypted private key.
      Returns:
      an X509Credential, or null if 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)