code: public static Credential getCredential(String credential)
      {
          if (credential.startsWith(Crypt.__TYPE))
              return new Crypt(credential);
          if (credential.startsWith(MD5.__TYPE))
              return new MD5(credential);
          
          return new Password(credential);
      }
docs: Get a credential from a String.
  If the credential String starts with a known Credential type (eg
  "CRYPT:" or "MD5:" ) then a Credential of that type is returned. Else the
  credential is assumed to be a Password.
  @param credential String representation of the credential
  @return A Credential or Password instance.