Tabnine Logo
ClearPasswordSpec.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.wildfly.security.password.spec.ClearPasswordSpec
constructor

Best Java code snippets using org.wildfly.security.password.spec.ClearPasswordSpec.<init> (Showing top 20 results out of 315)

origin: wildfly/wildfly

  private static PasswordSpec decodeClearPasswordSpec(ByteIterator iterator) {
    return new ClearPasswordSpec(iterator.asUtf8String().drainToString().toCharArray());
  }
}
origin: wildfly/wildfly

<S extends KeySpec> S getKeySpec(final Class<S> keySpecType) throws InvalidKeySpecException {
  if (keySpecType.isAssignableFrom(ClearPasswordSpec.class)) {
    final char[] password = getPassword();
    return keySpecType.cast(new ClearPasswordSpec(password.clone()));
  }
  throw new InvalidKeySpecException();
}
origin: wildfly/wildfly

<S extends KeySpec> S getKeySpec(final Class<S> keySpecType) throws InvalidKeySpecException {
  if (keySpecType.isAssignableFrom(MaskedPasswordSpec.class)) {
    return keySpecType.cast(new MaskedPasswordSpec(initialKeyMaterial.clone(), iterationCount, salt.clone(), maskedPasswordBytes.clone()));
  } else if (keySpecType.isAssignableFrom(ClearPasswordSpec.class)) {
    return keySpecType.cast(new ClearPasswordSpec(unmask(algorithm, initialKeyMaterial, iterationCount, salt, maskedPasswordBytes)));
  } else {
    throw new InvalidKeySpecException();
  }
}
origin: wildfly/wildfly

  passwordSpec = new ClearPasswordSpec(accountEntry.getPasswordRepresentation().toCharArray());
} else {
  passwordFactory = getPasswordFactory(ALGORITHM_DIGEST_MD5);
origin: wildfly/wildfly

if (plainText) {
  passwordFactory = getPasswordFactory(ALGORITHM_CLEAR);
  passwordSpec = new ClearPasswordSpec(accountEntry.getPasswordRepresentation().toCharArray());
} else {
  passwordFactory = getPasswordFactory(ALGORITHM_DIGEST_MD5);
origin: wildfly/wildfly

passwordSpec = new ClearPasswordSpec(decoder.decodeOctetStringAsString().toCharArray());
break;
origin: wildfly/wildfly

  passwordSpec = new ClearPasswordSpec(clear);
} else {
  return null;
origin: wildfly/wildfly

try {
  PasswordFactory factory = PasswordFactory.getInstance(ClearPassword.ALGORITHM_CLEAR, providers);
  return Assert.assertNotNull(factory.generatePassword(new ClearPasswordSpec(finalPassword)).castAs(ClearPassword.class));
} catch (InvalidKeySpecException | NoSuchAlgorithmException cause) {
  throw xmlLog.xmlFailedToCreateCredential(location, cause);
origin: wildfly/wildfly

  return passwordType.cast(passwordFactory.generatePassword(new EncryptablePasswordSpec(password, generateParameters)));
} else {
  return passwordType.cast(passwordFactory.generatePassword(new ClearPasswordSpec(password)));
origin: org.wildfly.security/wildfly-elytron

  private static PasswordSpec decodeClearPasswordSpec(ByteIterator iterator) {
    return new ClearPasswordSpec(iterator.asUtf8String().drainToString().toCharArray());
  }
}
origin: org.wildfly.security/wildfly-elytron-credential

  private static PasswordSpec decodeClearPasswordSpec(ByteIterator iterator) {
    return new ClearPasswordSpec(iterator.asUtf8String().drainToString().toCharArray());
  }
}
origin: org.jboss.eap/wildfly-client-all

  private static PasswordSpec decodeClearPasswordSpec(ByteIterator iterator) {
    return new ClearPasswordSpec(iterator.asUtf8String().drainToString().toCharArray());
  }
}
origin: org.wildfly.security/wildfly-elytron

<S extends KeySpec> S getKeySpec(final Class<S> keySpecType) throws InvalidKeySpecException {
  if (keySpecType.isAssignableFrom(ClearPasswordSpec.class)) {
    final char[] password = getPassword();
    return keySpecType.cast(new ClearPasswordSpec(password.clone()));
  }
  throw new InvalidKeySpecException();
}
origin: org.wildfly.security/wildfly-elytron-credential

<S extends KeySpec> S getKeySpec(final Class<S> keySpecType) throws InvalidKeySpecException {
  if (keySpecType.isAssignableFrom(ClearPasswordSpec.class)) {
    final char[] password = getPassword();
    return keySpecType.cast(new ClearPasswordSpec(password.clone()));
  }
  throw new InvalidKeySpecException();
}
origin: org.jboss.eap/wildfly-client-all

<S extends KeySpec> S getKeySpec(final Class<S> keySpecType) throws InvalidKeySpecException {
  if (keySpecType.isAssignableFrom(ClearPasswordSpec.class)) {
    final char[] password = getPassword();
    return keySpecType.cast(new ClearPasswordSpec(password.clone()));
  }
  throw new InvalidKeySpecException();
}
origin: wildfly/wildfly-core

/**
 * Convert {@code char[]} password to {@code PasswordCredential}
 * @param password to convert
 * @return new {@code PasswordCredential}
 * @throws UnsupportedCredentialTypeException should never happen as we have only supported types and algorithms
 */
private static PasswordCredential createCredentialFromPassword(char[] password) throws UnsupportedCredentialTypeException {
  try {
    PasswordFactory passwordFactory = PasswordFactory.getInstance(ClearPassword.ALGORITHM_CLEAR);
    return new PasswordCredential(passwordFactory.generatePassword(new ClearPasswordSpec(password)));
  } catch (NoSuchAlgorithmException | InvalidKeySpecException e) {
    throw new UnsupportedCredentialTypeException(e);
  }
}
origin: org.wildfly.security/wildfly-elytron

<S extends KeySpec> S getKeySpec(final Class<S> keySpecType) throws InvalidKeySpecException {
  if (keySpecType.isAssignableFrom(MaskedPasswordSpec.class)) {
    return keySpecType.cast(new MaskedPasswordSpec(initialKeyMaterial.clone(), iterationCount, salt.clone(), maskedPasswordBytes.clone()));
  } else if (keySpecType.isAssignableFrom(ClearPasswordSpec.class)) {
    return keySpecType.cast(new ClearPasswordSpec(unmask(algorithm, initialKeyMaterial, iterationCount, salt, maskedPasswordBytes)));
  } else {
    throw new InvalidKeySpecException();
  }
}
origin: org.wildfly.core/wildfly-domain-management

@Override
public boolean verifyEvidence(Evidence evidence) throws RealmUnavailableException {
  if (user == null || evidence instanceof PasswordGuessEvidence == false) {
    return false;
  }
  final char[] guess = ((PasswordGuessEvidence) evidence).getGuess();
  String password = user.require(PASSWORD).asString();
  final PasswordFactory passwordFactory = getPasswordFactory(ALGORITHM_CLEAR);
  final PasswordSpec passwordSpec = new ClearPasswordSpec(password.toCharArray());
  final Password actualPassword;
  try {
    actualPassword = passwordFactory.generatePassword(passwordSpec);
    return passwordFactory.verify(actualPassword, guess);
  } catch (InvalidKeySpecException | InvalidKeyException | IllegalStateException e) {
    throw new IllegalStateException(e);
  }
}
origin: org.wildfly.security/wildfly-elytron-credential

<S extends KeySpec> S getKeySpec(final Class<S> keySpecType) throws InvalidKeySpecException {
  if (keySpecType.isAssignableFrom(MaskedPasswordSpec.class)) {
    return keySpecType.cast(new MaskedPasswordSpec(initialKeyMaterial.clone(), iterationCount, salt.clone(), maskedPasswordBytes.clone()));
  } else if (keySpecType.isAssignableFrom(ClearPasswordSpec.class)) {
    return keySpecType.cast(new ClearPasswordSpec(unmask(algorithm, initialKeyMaterial, iterationCount, salt, maskedPasswordBytes)));
  } else {
    throw new InvalidKeySpecException();
  }
}
origin: org.jboss.eap/wildfly-client-all

<S extends KeySpec> S getKeySpec(final Class<S> keySpecType) throws InvalidKeySpecException {
  if (keySpecType.isAssignableFrom(MaskedPasswordSpec.class)) {
    return keySpecType.cast(new MaskedPasswordSpec(initialKeyMaterial.clone(), iterationCount, salt.clone(), maskedPasswordBytes.clone()));
  } else if (keySpecType.isAssignableFrom(ClearPasswordSpec.class)) {
    return keySpecType.cast(new ClearPasswordSpec(unmask(algorithm, initialKeyMaterial, iterationCount, salt, maskedPasswordBytes)));
  } else {
    throw new InvalidKeySpecException();
  }
}
org.wildfly.security.password.specClearPasswordSpec<init>

Javadoc

Construct a new instance.

Popular methods of ClearPasswordSpec

  • getEncodedPassword
    Get the password characters.

Popular in Java

  • Creating JSON documents from java classes using gson
  • setScale (BigDecimal)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getApplicationContext (Context)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now