org.eclipse.mtj.api.extension
Interface SecurityManagement

All Superinterfaces:
org.eclipse.emf.ecore.EObject, MtjExtension, org.eclipse.emf.common.notify.Notifier

public interface SecurityManagement
extends MtjExtension

The Security Managment Provider provides the interface to interact with Key Stores.


Method Summary
 boolean changeStorePassword(java.lang.String newStorePass, java.lang.String storePass, org.eclipse.core.runtime.IProgressMonitor monitor)
          Changes the password of the current keystore.
 boolean createNewKey(java.lang.String alias, java.lang.String commonName, java.lang.String orgUnit, java.lang.String orgName, java.lang.String localityName, java.lang.String stateName, java.lang.String country, org.eclipse.core.runtime.IProgressMonitor monitor)
          Creates a new key pair with the information passed in.
 boolean deleteKey(org.eclipse.core.runtime.IProgressMonitor monitor)
          Deletes the current key pair, from the current keystore
 boolean generateCSR(java.lang.String certFile, org.eclipse.core.runtime.IProgressMonitor monitor)
          Generates a new CSR.
 java.lang.String getAliaskey()
          Returns the current key alias.
 java.lang.String getCertificateInfo(org.eclipse.core.runtime.IProgressMonitor monitor)
          Get the certificates associated with the alias key/keystore.
 java.lang.String getKeyStoreNameLoc()
          Returns the location of the current keystore.
 java.lang.String getPassWrd()
          Returns the current keystore password.
 java.lang.String getStoreType()
          Returns the keystore type used by keystore.
 java.lang.String getToolLocation(org.eclipse.core.runtime.IProgressMonitor monitor)
          Implementations that rely on an external security tool, are responsible for persistant storage of the tool location value.
 java.lang.String getValidity()
          Returns the validity of the current key pair.
 boolean importSignedCert(java.lang.String certFile, org.eclipse.core.runtime.IProgressMonitor monitor)
          Imports signed certificate to current keystore.
 boolean isKeyStoreSelected()
          Return true if the keystore name and location were set during this session.
 java.lang.String[] openKeyStore(java.lang.String keyStore, java.lang.String storePass, org.eclipse.core.runtime.IProgressMonitor monitor)
          Accesses an existing keystore, opens the keystore and returns a string array containing the key aliases within the keystore.
 void resetValues()
          Resets all values including keystore, password, alias key, etc
 void setAliaskey(java.lang.String aliasKey)
          Sets the alias for the current key pair.
 void setKeyStoreNameLoc(java.lang.String keyStoreNameLoc)
          Sets the Key Store name location.
 void setPassWrd(java.lang.String passWrd)
          Sets the password for the current keystore.
 void setStoreType(java.lang.String storeType)
          Sets the type of keystore to generate.
 void setValidity(java.lang.String validity)
          Sets the validity period for the certificate.
 void setValues(java.lang.String loc, java.lang.String alias, java.lang.String psswd, java.lang.String strtype)
          Allows users of this class to set the keystore values.
 void storeToolLocation(java.lang.String loc, org.eclipse.core.runtime.IProgressMonitor monitor)
          Implementations that rely on an external security tool, are responsible for persistant storage of the tool location value.
 
Methods inherited from interface org.eclipse.mtj.api.extension.MtjExtension
getDescription, getId, getType, getVendor, getVersion, isActive, setActive, setDescription, setId, setType, setVendor, setVersion
 
Methods inherited from interface org.eclipse.emf.ecore.EObject
eAllContents, eClass, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eGet, eIsProxy, eIsSet, eResource, eSet, eUnset
 
Methods inherited from interface org.eclipse.emf.common.notify.Notifier
eAdapters, eDeliver, eNotify, eSetDeliver
 

Method Detail

openKeyStore

java.lang.String[] openKeyStore(java.lang.String keyStore,
                                java.lang.String storePass,
                                org.eclipse.core.runtime.IProgressMonitor monitor)
                                throws org.eclipse.mtj.exception.MtjException
Accesses an existing keystore, opens the keystore and returns a string array containing the key aliases within the keystore.

Parameters:
keyStore -
storePass -
monitor -
Returns:
String[]
Throws:
org.eclipse.mtj.exception.MtjException

getStoreType

java.lang.String getStoreType()
                              throws org.eclipse.mtj.exception.MtjException
Returns the keystore type used by keystore.

Returns:
String
Throws:
org.eclipse.mtj.exception.MtjException

getAliaskey

java.lang.String getAliaskey()
                             throws org.eclipse.mtj.exception.MtjException
Returns the current key alias. Calling classes will set this value based on user selection from the keystore.

Returns:
key alias that is currently being used.
Throws:
org.eclipse.mtj.exception.MtjException

getPassWrd

java.lang.String getPassWrd()
                            throws org.eclipse.mtj.exception.MtjException
Returns the current keystore password.

Returns:
Throws:
org.eclipse.mtj.exception.MtjException

getKeyStoreNameLoc

java.lang.String getKeyStoreNameLoc()
                                    throws org.eclipse.mtj.exception.MtjException
Returns the location of the current keystore.

Returns:
Throws:
org.eclipse.mtj.exception.MtjException

getValidity

java.lang.String getValidity()
                             throws org.eclipse.mtj.exception.MtjException
Returns the validity of the current key pair.

Returns:
Throws:
org.eclipse.mtj.exception.MtjException

setStoreType

void setStoreType(java.lang.String storeType)
                  throws org.eclipse.mtj.exception.MtjException
Sets the type of keystore to generate.

Parameters:
storeType -
Throws:
org.eclipse.mtj.exception.MtjException

setAliaskey

void setAliaskey(java.lang.String aliasKey)
                 throws org.eclipse.mtj.exception.MtjException
Sets the alias for the current key pair.

Parameters:
aliasKey -
Throws:
org.eclipse.mtj.exception.MtjException

setPassWrd

void setPassWrd(java.lang.String passWrd)
                throws org.eclipse.mtj.exception.MtjException
Sets the password for the current keystore.

Parameters:
passWrd -
Throws:
org.eclipse.mtj.exception.MtjException

setKeyStoreNameLoc

void setKeyStoreNameLoc(java.lang.String keyStoreNameLoc)
                        throws org.eclipse.mtj.exception.MtjException
Sets the Key Store name location.

Parameters:
keyStoreNameLoc -
Throws:
org.eclipse.mtj.exception.MtjException

setValidity

void setValidity(java.lang.String validity)
                 throws org.eclipse.mtj.exception.MtjException
Sets the validity period for the certificate.

Parameters:
validity -
Throws:
org.eclipse.mtj.exception.MtjException

setValues

void setValues(java.lang.String loc,
               java.lang.String alias,
               java.lang.String psswd,
               java.lang.String strtype)
               throws org.eclipse.mtj.exception.MtjException
Allows users of this class to set the keystore values.

Parameters:
loc -
alias -
psswd -
strtype -
Throws:
org.eclipse.mtj.exception.MtjException

resetValues

void resetValues()
                 throws org.eclipse.mtj.exception.MtjException
Resets all values including keystore, password, alias key, etc

Throws:
org.eclipse.mtj.exception.MtjException

isKeyStoreSelected

boolean isKeyStoreSelected()
                           throws org.eclipse.mtj.exception.MtjException
Return true if the keystore name and location were set during this session.

Returns:
true if a keystore name and location were set during this session, false otherwise.
Throws:
org.eclipse.mtj.exception.MtjException

generateCSR

boolean generateCSR(java.lang.String certFile,
                    org.eclipse.core.runtime.IProgressMonitor monitor)
                    throws org.eclipse.mtj.exception.MtjException
Generates a new CSR.

Parameters:
certFile - - location and name of file to generate
monitor -
Returns:
- True if success, otherwise false.
Throws:
org.eclipse.mtj.exception.MtjException

importSignedCert

boolean importSignedCert(java.lang.String certFile,
                         org.eclipse.core.runtime.IProgressMonitor monitor)
                         throws org.eclipse.mtj.exception.MtjException
Imports signed certificate to current keystore.

Parameters:
certFile - - location of signed certificate to import
monitor -
Returns:
- True if success, otherwise false.
Throws:
org.eclipse.mtj.exception.MtjException

deleteKey

boolean deleteKey(org.eclipse.core.runtime.IProgressMonitor monitor)
                  throws org.eclipse.mtj.exception.MtjException
Deletes the current key pair, from the current keystore

Parameters:
monitor -
Returns:
- True if success, otherwise false.
Throws:
org.eclipse.mtj.exception.MtjException

changeStorePassword

boolean changeStorePassword(java.lang.String newStorePass,
                            java.lang.String storePass,
                            org.eclipse.core.runtime.IProgressMonitor monitor)
                            throws org.eclipse.mtj.exception.MtjException
Changes the password of the current keystore.

Parameters:
newStorePass - - Changes the keystore password to newStorePass.
storePass - - Previous keystore password.
monitor -
Returns:
- True if success, otherwise false.
Throws:
org.eclipse.mtj.exception.MtjException

createNewKey

boolean createNewKey(java.lang.String alias,
                     java.lang.String commonName,
                     java.lang.String orgUnit,
                     java.lang.String orgName,
                     java.lang.String localityName,
                     java.lang.String stateName,
                     java.lang.String country,
                     org.eclipse.core.runtime.IProgressMonitor monitor)
                     throws org.eclipse.mtj.exception.MtjException
Creates a new key pair with the information passed in. Attaches the new key pair to the current keystore.

Parameters:
alias - - New key pair alias.
commonName - - New key pair common name.
orgUnit - - New key pair organization unit name.
orgName - - New key pair organization name.
localityName - - New key pair locality name.
stateName - - New key pair state name.
country - - New key pair country name.
monitor - - Progress monitor.
Returns:
- true is success, otherwise false.
Throws:
org.eclipse.mtj.exception.MtjException

getCertificateInfo

java.lang.String getCertificateInfo(org.eclipse.core.runtime.IProgressMonitor monitor)
                                    throws org.eclipse.mtj.exception.MtjException
Get the certificates associated with the alias key/keystore.

Parameters:
monitor -
Returns:
Throws:
org.eclipse.mtj.exception.MtjException

getToolLocation

java.lang.String getToolLocation(org.eclipse.core.runtime.IProgressMonitor monitor)
                                 throws org.eclipse.mtj.exception.MtjException
Implementations that rely on an external security tool, are responsible for persistant storage of the tool location value. This method should return the location of the tool. Should never return null.

Parameters:
monitor -
Returns:
- Tool location.
Throws:
org.eclipse.mtj.exception.MtjException

storeToolLocation

void storeToolLocation(java.lang.String loc,
                       org.eclipse.core.runtime.IProgressMonitor monitor)
                       throws org.eclipse.mtj.exception.MtjException
Implementations that rely on an external security tool, are responsible for persistant storage of the tool location value. This method should contain the code to store the location.

Parameters:
loc - - Directory where tool resides.
monitor -
Throws:
org.eclipse.mtj.exception.MtjException