Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MNG-5583] per endpoint support for PKI authentication #67

Closed
wants to merge 7 commits into from
Expand Up @@ -52,6 +52,195 @@ public class AuthenticationInfo
*/
private String privateKey;

/**
* The path to the trust store. If not defined, the JRE's cacert store is
* used.
*/
private String trustStore;

/**
* The password to the trust store.
*/
private String trustStorePassword;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This field contains a password. We must convert it to char[] later on, so can't we store it as a char[]?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The upstream model does not allow that. Given that other password fields are strings too, this is acceptable, but not ideal.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i agree with @michael-o otherwise i would have used char[]


/**
* The type of trust store, default is JKS
*/
private String trustStoreType;

/**
* The path to the keystore used for authentication purposes, or null
*/
private String keyStore;

/**
* Keystore password, can be null
*/
private String keyStorePassword;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This field contains a password. We must convert it to char[] later on, so can't we store it as a char[]?


/**
* Keystore if the key store has multiple key pairs, this can be used to
* explicitly select a specific certificate via it's alias. If null, the
* most appropriate certificate is automatically selected by the SSL Factory
*/
private String keyAlias;

/**
* The password to unlock the key, can be null
*/
private String keyPassword;
spyhunter99 marked this conversation as resolved.
Show resolved Hide resolved

/**
* The key store type, defaults to JKS
*/
private String keyStoreType;

/**
* The path to the trust store. If not defined, the JRE's cacert store is
* used.
* @return path, name or null
*/
public String getTrustStore()
{
return trustStore;
}

/**
* The path to the trust store. If not defined, the JRE's cacert store is
* used.
* @param trustStore path name or null
*/
public void setTrustStore( String trustStore )
{
this.trustStore = trustStore;
}

/**
* The password to the trust store.
* @return password or null
*/
public String getTrustStorePassword()
{
return trustStorePassword;
}

/**
* The password to the trust store.
* @param trustStorePassword password or null
*/
public void setTrustStorePassword( String trustStorePassword )
{
this.trustStorePassword = trustStorePassword;
}

/**
* The type of trust store, default is JKS
* @return type
*/
public String getTrustStoreType()
{
return trustStoreType;
}

/**
* The type of trust store, default is JKS
* @param trustStoreType key store type
*/
public void setTrustStoreType( String trustStoreType )
{
this.trustStoreType = trustStoreType;
}

/**
* The path to the keystore used for authentication purposes, or null
* @return path, named keystore or null
*/
public String getKeyStore()
{
return keyStore;
}

/**
* The path to the keystore used for authentication purposes, or null
* @param keyStore keystore path, name or null
*/
public void setKeyStore( String keyStore )
{
this.keyStore = keyStore;
}

/**
* Keystore password, can be null
* @return password or null
*/
public String getKeyStorePassword()
{
return keyStorePassword;
}

/**
* Keystore password, can be null
* @param keyStorePassword password or null
*/
public void setKeyStorePassword( String keyStorePassword )
{
this.keyStorePassword = keyStorePassword;
}

/**
* Keystore if the key store has multiple key pairs, this can be used to
* explicitly select a specific certificate via it's alias. If null, the
* most appropriate certificate is automatically selected by the SSL Factory
* @return the alias or null
*/
public String getKeyAlias()
{
return keyAlias;
}

/**
* Keystore if the key store has multiple key pairs, this can be used to
* explicitly select a specific certificate via it's alias. If null, the
* most appropriate certificate is automatically selected by the SSL Factory
* @param keyAlias alias
*/
public void setKeyAlias( String keyAlias )
{
this.keyAlias = keyAlias;
}

/**
* The password to unlock the key, can be null
*/
public String getKeyPassword()
{
return keyPassword;
}

/**
* The password to unlock the key, can be null
*/
public void setKeyPassword( String keyPassword )
{
this.keyPassword = keyPassword;
}

/**
* The key store type, defaults to JKS
*/
public String getKeyStoreType()
{
return keyStoreType;
}

/**
* The key store type, defaults to JKS
*/
public void setKeyStoreType( String keyStoreType )
{
this.keyStoreType = keyStoreType;
}

/**
* Get the passphrase of the private key file. The passphrase is used only
* when host/protocol supports authentication via exchange of
Expand Down
Expand Up @@ -19,12 +19,12 @@
* under the License.
*/

import java.util.Properties;
spyhunter99 marked this conversation as resolved.
Show resolved Hide resolved
import org.apache.maven.wagon.PathUtils;
import org.apache.maven.wagon.WagonConstants;
import org.codehaus.plexus.util.StringUtils;

import java.io.Serializable;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

import java.util.Properties;

/**
* This class is an abstraction of the location from/to resources
Expand Down