com.ibm.di.util
Class RacfCredential

java.lang.Object
  extended by com.ibm.di.util.RacfCredential

public class RacfCredential
extends java.lang.Object

This class represents a decrypted RACF password or passphrase envelope.

This envelope is encrypted in PKCS#7 and contains not only the password/passphrase but some additional information about its version, expiration, time of last change and language.

Example:

 // Get password envelope bytes
 passbytes = conn.getObject("racfpasswordenvelope");
 
 // Decrypt password envelope
 pass = system.getRacfCredentialObject(psssbytes, "key.jks", "recipient_pass", "recipient_alias",
                "key_pass", "key.jks", "signer_pass", "signer_alias");
 
 // Print password related information
 task.logmsg("New Password--------> " + pass.toString());
 task.logmsg("Expired-------------> " + pass.getExpired());
 task.logmsg("Language------------> " + pass.getLanguage());
 task.logmsg("PasswordString------> " + pass.getCredentialString());
 task.logmsg("PasswordBytes-------> " + pass.getCredentialBytes());
 task.logmsg("Version-------------> " + pass.getVersion());
 task.logmsg("ChangeTime----------> " + pass.getChangeTime());
 

Since:
7.0

Method Summary
 java.lang.String dumpContents()
          Prints the password/passphrase along with the additional provided information.
 java.lang.String getChangeTime()
          Gets the time of last change of the credential.
 byte[] getCredentialBytes()
          Gets the credential as a byte array.
 java.lang.String getCredentialString()
          Gets the credential as a string.
 boolean getExpired()
          Gets the expired flag.
 java.lang.String getLanguage()
           
 int getVersion()
          Gets the version.
 void setChangeTime(java.lang.String changeTime)
          Sets the time of last change.
 void setCredential(byte[] credentialBytes)
          Sets the credential.
 void setCredential(java.lang.String credential)
          Sets the credential.
 void setExpired(boolean expired)
          Sets the expired flag
 void setLanguage(java.lang.String language)
          Sets the language field.
 void setVersion(int version)
          Sets the version.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getExpired

public boolean getExpired()
Gets the expired flag.

Returns:
true if the credential is expired; false otherwise.

setExpired

public void setExpired(boolean expired)
Sets the expired flag

Parameters:
expired - the new value of the expired flag.

getLanguage

public java.lang.String getLanguage()
Returns:
a String representation of the language code (e.g. ENU)

setLanguage

public void setLanguage(java.lang.String language)
Sets the language field.

Parameters:
language - The new language to set

getCredentialString

public java.lang.String getCredentialString()
Gets the credential as a string.

Returns:
a String

setCredential

public void setCredential(java.lang.String credential)
Sets the credential.

Parameters:
credential - The new credential to set.

getCredentialBytes

public byte[] getCredentialBytes()
Gets the credential as a byte array.

Returns:
Returns an array of byte.

setCredential

public void setCredential(byte[] credentialBytes)
Sets the credential.

Parameters:
credentialBytes - The new credential to set in bytes.

getVersion

public int getVersion()
Gets the version.

Returns:
integer representing the version.

setVersion

public void setVersion(int version)
Sets the version.

Parameters:
version - The new version to set.

getChangeTime

public java.lang.String getChangeTime()
Gets the time of last change of the credential.

Returns:
a String representation of the time.

setChangeTime

public void setChangeTime(java.lang.String changeTime)
Sets the time of last change.

Parameters:
changeTime - The new time to set.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
String representing only the credential value.

dumpContents

public java.lang.String dumpContents()
Prints the password/passphrase along with the additional provided information.

Returns:
String showing member data values