|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--com.novell.ecb.secretstore.SecretStoreBean
|
+--com.novell.ecb.secretstore.GetSecretInstance
Constructs a SecretInstance or SharedSecretInstance object depending on the secretID specified.
The master password or the enhanced protection password can also be specified so that the user need not provide these values for the other beans.
ssInstance - A SecretStoreInstance object that represents the SecretStore of the user.
secretID - Secret identifier for the SecretInstance object. secretType - SecretType for the SharedSecret.
secretName - SecretName for the SharedSecret.masterPassword - The MasterPassword for the SecretStore
useMasterPassword - Determines whether to use master password while creating secrets. It is a boolean property.
enhancedProtectionPassword - Password for enhanced protected secret.
SecretInstance - SecretInstance or SharedSecretInstance object as per
the secret identifier specified.
SecretType,
SecretInstance,
SharedSecretInstance,
Serialized Form| Field Summary |
| Fields inherited from class com.novell.ecb.secretstore.SecretStoreBean |
MAX_BUFFER_SIZE |
| Constructor Summary | |
GetSecretInstance()
Constructs a GetSecretInstance command bean. |
|
GetSecretInstance(SecretStoreInstance ssInstance)
Constructs a GetSecretInstance command bean and sets the SecretStoreInstance to be used. |
|
GetSecretInstance(SecretStoreInstance ssInstance,
java.lang.String secretID)
Constructs a GetSecretInstance command bean and sets the SecretStoreInstance to be used and SecretID for which SecretInstance is to be created. |
|
| Method Summary | |
void |
execute()
Executes this command bean for getting a SecretInstance object. |
java.lang.String |
getSecretID()
Returns the secretID for which SecretInstance is to be created. |
SecretInstance |
getSecretInstance()
Returns the SecretInstance or SharedSecretInstance object representing the Secret identified by the given SecretID in the SecretStore. |
java.lang.String |
getSecretName()
Returns the name of the SharedSecret to be instantiated. |
java.lang.String |
getSecretType()
Returns the type of the SharedSecret to be instantiated. |
boolean |
getUseMasterPassword()
Returns the useMasterPassword property value. |
boolean |
isReady()
Tests whether the required input properties are set and the bean is in "initialized" state. |
void |
reset()
Resets the output properties to the values they had before the execute method was called. |
void |
setEnhancedProtectionPassword(char[] epPassword)
Sets the enhanced protection password property. |
void |
setEnhancedProtectionPassword(java.lang.String epPassword)
Deprecated. Replaced by setEnhancedProtectionPassword(char[]). |
void |
setMasterPassword(char[] password)
Sets the master password of the SecretStore. |
void |
setMasterPassword(java.lang.String password)
Deprecated. Replaced by setMasterPassword(char[]). |
void |
setSecretID(java.lang.String secretID)
Sets the secretID for which SecretInstance is to be created. |
void |
setSecretName(java.lang.String secretName)
Sets the name of the SharedSecret to be instantiated. |
void |
setSecretType(java.lang.String secretType)
Sets the type of the SharedSecret to be instantiated. |
void |
setUseMasterPassword(boolean useMP)
Sets the useMasterPassword property. |
| Methods inherited from class com.novell.ecb.secretstore.SecretStoreBean |
getSecretStoreInstance, setSecretStoreInstance |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public GetSecretInstance()
public GetSecretInstance(SecretStoreInstance ssInstance)
ssInstance - A SecretStoreInstance object that represents the SecretStore of the target object.
public GetSecretInstance(SecretStoreInstance ssInstance,
java.lang.String secretID)
ssInstance - A SecretStoreInstance object that represents the SecretStore of the target object.secretID - Secret identifier for the SecretInstance object.| Method Detail |
public void setSecretID(java.lang.String secretID)
secretID - Secret identifier for the SecretInstance object.public java.lang.String getSecretID()
public void setEnhancedProtectionPassword(java.lang.String epPassword)
setEnhancedProtectionPassword(char[]).
Once this password is set, it is not required to set it again if the same SecretInstance object is used.
epPassword - EnhancedProtectionPassword for the Secret.public void setEnhancedProtectionPassword(char[] epPassword)
Once this password is set, it is not required to set it again if the same SecretInstance object is used.
epPassword - EnhancedProtectionPassword for the Secret.public void setMasterPassword(java.lang.String password)
setMasterPassword(char[]).
password - The master password. If password is a non-null and non-empty string,
useMasterPassword property is set to true automatically, when this bean is executed.public void setMasterPassword(char[] password)
password - The master password. If password is a non-null and non-empty string,
useMasterPassword property is set to true automatically, when this bean is executed.public void setUseMasterPassword(boolean useMP)
useMP - The boolean flag to create SecretInstance with a reference to master password.
Setting this property is required only if master password is set by other beans and
SecretInstance is to be created with a reference to master password.public boolean getUseMasterPassword()
public void setSecretType(java.lang.String secretType)
secretType - Type of the SharedSecret.public java.lang.String getSecretType()
public void setSecretName(java.lang.String secretName)
secretName - Name of the SharedSecret.public java.lang.String getSecretName()
public boolean isReady()
If the user does not set a value for optional input property, default value is used. Therefore, these properties do not affect the readiness of the bean. However, bean will not be in ready state if any of the required input properties is not set.
public void reset()
Sets the output property, secretInstance, to its default value i.e. Null.
public void execute()
throws CommandException
CommandException - Thrown if the bean fails to execute.
Example 1: Shows how to use GetSecretInstance bean for an ordinary Secret.
// Get the SecretStoreInstance created by the CreateSecretStoreInstance bean.
SecretStoreInstance ssi = createSSI.getSecretStoreInstance();
// Instantiate the command bean
GetSecretInstance getSI = new GetSecretInstance(ssi);
SecretInstance si = null;
try
{
// Set the input properties of the command bean
getSI.setSecretID("myApp1");
// To maintain a reference to already set master password
// useMasterPassword can set to true.
// Any of master password and enhanced protection password can
// be used to read a Secret. However, it is recommended to use
// enhanced protection password for reading an enhanced protected
// Secret.
// getSI.setUseMasterPassword(true);
getSI.setEnhancedProtectionPassword("epPassword".toCharArray());
// Call the execute method of the command bean
getSI.execute();
// Query the output properties of the command bean
si = getSI.getSecretInstance();
// Do any further opertions on SecretInstance
...
...
}
catch(CommandException e)
{
// TODO: Handle exception
}
Example 2: Shows how to use GetSecretInstance bean for a SharedSecret.
// Get the SecretStoreInstance created by the CreateSecretStoreInstance bean.
SecretStoreInstance ssi = createSSI.getSecretStoreInstance();
// Instantiate the command bean
GetSecretInstance getSI = new GetSecretInstance(ssi);
SecretInstance si = null;
try
{
// Set the input properties of the command bean
// For Shared Secret set secretID as follows
getSI.setSecretID("SS_App:mySharedApp1");
// OR set secretType and secretName separately
// getSI.setSecretType(SecretType.APPICATION);
// getSI.setSecretName("mySharedApp1");
// Setting something as follows would result in creating
// an instance with "apps:myApp" as secretID.
// getSI.setSecretType("apps");
// getSI.setSecretName("myApp");
// To maintain a reference to already set master password
// useMasterPassword can set to true.
// Any of master password and enhanced protection password can
// be used to read a Secret. However, it is recommended to use
// enhanced protection password for reading an enhanced protected
// Secret.
// getSI.setUseMasterPassword(true);
getSI.setEnhancedProtectionPassword("epPassword".toCharArray());
// Call the execute method of the command bean
getSI.execute();
// Query the output properties of the command bean
si = getSI.getSecretInstance();
// Do any further opertions on SecretInstance
...
...
}
catch(CommandException e)
{
// TODO: Handle exception
}
CreateSecretStoreInstancepublic SecretInstance getSecretInstance()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||