com.foxsmart.csu.config.global
Class GlobalEncryptionPassword

java.lang.Object
  extended by com.foxsmart.csu.config.CiscoRouterConfigParser
      extended by com.foxsmart.csu.config.global.GlobalEncryptionPassword
All Implemented Interfaces:
java.io.Serializable

public class GlobalEncryptionPassword
extends CiscoRouterConfigParser

A class to store a password along with its encryption type. See important comments in the setPassword method for rules for password specification.

See Also:
Serialized Form

Field Summary
static int ENCRYPTION_TYPE_0
          Encryption Type 0 is an unencrypted password.
static int ENCRYPTION_TYPE_5
          Encryption Type 5 is a heavily encrypted password.
static int ENCRYPTION_TYPE_7
          Encryption Type 7 is a weakly encrypted pasword.
 
Fields inherited from class com.foxsmart.csu.config.CiscoRouterConfigParser
log, NO, tokenIndex
 
Constructor Summary
GlobalEncryptionPassword()
          Default constructor.
 
Method Summary
 int getEncryptionType()
          Gets the encryption type.
 java.lang.String getPassword()
          Gets the password.
 void setEncryptionType(int encryptionType)
          Sets the encryption type.
 void setPassword(java.lang.String password)
          Sets the password.
 
Methods inherited from class com.foxsmart.csu.config.CiscoRouterConfigParser
checkExists, checkLineComplete, checkNotEmpty, checkRange, checkTokenCount, checkTokenCount, checkTokenMatch, checkTokenMatch, decrementTokenIndex, generateCommands, getBigDecimalNumberFromString, getDoubleNumberFromString, getEnum, getHexadecimalNumberFromString, getIntegerNumberFromString, getIpAddressFromString, getLine, getLongNumberFromString, getMacAddressFromString, getNextOptionalToken, getNextToken, getToken, getTokenIndex, getTokens, getTotalIndentedLines, getTotalLines, incrementTokenIndex, invalidConfiguration, invalidTokenFound, isEmpty, moreIndentedLines, moreLines, moreTokens, removeLines, resetTokenIndex, setTokenIndex, tokensLeft
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENCRYPTION_TYPE_0

public static final int ENCRYPTION_TYPE_0
Encryption Type 0 is an unencrypted password.

See Also:
Constant Field Values

ENCRYPTION_TYPE_5

public static final int ENCRYPTION_TYPE_5
Encryption Type 5 is a heavily encrypted password.

See Also:
Constant Field Values

ENCRYPTION_TYPE_7

public static final int ENCRYPTION_TYPE_7
Encryption Type 7 is a weakly encrypted pasword.

See Also:
Constant Field Values
Constructor Detail

GlobalEncryptionPassword

public GlobalEncryptionPassword()
Default constructor. Password will be null and the encryption type will be ENCRYPTION_TYPE_0.

Method Detail

setPassword

public void setPassword(java.lang.String password)
Sets the password. If the encryption type is not 0, then the password specified here should already be encrypted. If not properly encrypted, a configuration update will fail. If the password is associated with an "enable secret" password, an unencrypted password will automatically be encrypted. If the password is associated with an "enable password" password, an unencrypted password will automatically be encrypted if the "service password-encryption" flag is set.

Parameters:
password - The password.

getPassword

public java.lang.String getPassword()
Gets the password.

Returns:
The password.

setEncryptionType

public void setEncryptionType(int encryptionType)
                       throws InvalidConfigurationException
Sets the encryption type. The encryption type must be one of the encryption type constants defined at the top of this file or their numeric equivalent (i.e. 0, 5, or 7).

Parameters:
encryptionType - The encryption type.
Throws:
InvalidConfigurationException - if the encryption type is invalid.

getEncryptionType

public int getEncryptionType()
Gets the encryption type.

Returns:
The encryption type.


Copyright © 2005-2008 Fox Smart, Inc. All Rights Reserved.