agave-systems/systems-core/src/main/java/org/iplantc/service/systems/model/AuthConfig.java
/**
	 * Encrypts the current credential in place.
	 * 
	 * @param encryptionKey
	 * @throws EncryptionException
	 */
Encrypts the current credential in place.

@param encryptionKey
@throws EncryptionException
Encrypts the current credential in place . @param encryptionKey @throws EncryptionException
@Transient
	public void encryptCurrentCredential(String encryptionKey) throws EncryptionException
	{
		if (StringUtils.isEmpty(credential)) {
			throw new EncryptionException("Cannot encrypt an empty credential");
		} else if (StringUtils.isEmpty(encryptionKey)) {
			throw new EncryptionException("Cannot encrypt credential using an empty key");
		} else {
			Encryption crypt = new Encryption();
			try
			{
				crypt.setPassword(encryptionKey.toCharArray());
				this.credential = crypt.encrypt(this.credential);
			}
			catch (Exception e)
			{
				throw new EncryptionException("Unable to encrypt the credential");
			}
		}
	}
@ Transient public void encryptCurrentCredential ( String encryptionKey ) throws EncryptionException { if ( StringUtils . isEmpty ( credential ) ) { throw new EncryptionException ( "Cannot encrypt an empty credential" ) ; } else if ( StringUtils . isEmpty ( encryptionKey ) ) { throw new EncryptionException ( "Cannot encrypt credential using an empty key" ) ; } else { Encryption crypt = new Encryption ( ) ; try { crypt . setPassword ( encryptionKey . toCharArray ( ) ) ; this . credential = crypt . encrypt ( this . credential ) ; } catch ( Exception e ) { throw new EncryptionException ( "Unable to encrypt the credential" ) ; } } }
Encrypts the current credential in place.
Encrypts the current credential in place .
//				String oldCred = credential; //				System.out.println("Username: " + username + " Key: " + encryptionKey + " Credential: " + oldCred + " => " + credential); //				System.out.println("Username: " + username + " Key: " + encryptionKey + " Pass: " + credential + " => " + crypt.decrypt(credential));