Codota Logo
ClearPasswordSpec.getEncodedPassword
Code IndexAdd Codota to your IDE (free)

How to use
getEncodedPassword
method
in
org.wildfly.security.password.spec.ClearPasswordSpec

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

  • Common ways to obtain ClearPasswordSpec
private void myMethod () {
ClearPasswordSpec c =
  • Codota Iconnew ClearPasswordSpec(encodedPassword)
  • Codota IconLegacyPropertiesSecurityRealm.AccountEntry legacyPropertiesSecurityRealmAccountEntry;new ClearPasswordSpec(legacyPropertiesSecurityRealmAccountEntry.getPasswordRepresentation().toCharArray())
  • Codota IconPasswordFactory passwordFactory;Password password;passwordFactory.getKeySpec(passwordFactory.translate(password), ClearPasswordSpec.class)
  • Smart code suggestions by Codota
}
origin: wildfly/wildfly

UnixSHACryptPasswordImpl(final String algorithm, final ClearPasswordSpec spec) throws NoSuchAlgorithmException {
  this(algorithm, spec.getEncodedPassword());
}
origin: wildfly/wildfly

MaskedPasswordImpl(final String algorithm, final ClearPasswordSpec keySpec) throws InvalidKeySpecException {
  this(algorithm, keySpec.getEncodedPassword());
}
origin: wildfly/wildfly

BSDUnixDESCryptPasswordImpl(final ClearPasswordSpec passwordSpec) throws InvalidKeySpecException {
  this(passwordSpec.getEncodedPassword(), ThreadLocalRandom.current().nextInt() & 0xffffff, DEFAULT_ITERATION_COUNT);
}
origin: wildfly/wildfly

UnixDESCryptPasswordImpl(final ClearPasswordSpec spec) throws InvalidKeySpecException, InvalidKeyException {
  this((short) (ThreadLocalRandom.current().nextInt() & 0xfff), spec.getEncodedPassword());
}
origin: wildfly/wildfly

SimpleDigestPasswordImpl(final String algorithm, final ClearPasswordSpec spec) throws InvalidKeySpecException {
  this(algorithm, getDigestOfKS(algorithm, spec.getEncodedPassword()));
}
origin: wildfly/wildfly

ScramDigestPasswordImpl(final String algorithm, final ClearPasswordSpec spec) throws InvalidKeySpecException, NoSuchAlgorithmException, InvalidKeyException {
  this(algorithm, spec.getEncodedPassword(), PasswordUtil.generateRandomSalt(DEFAULT_SALT_SIZE), DEFAULT_ITERATION_COUNT);
}
origin: wildfly/wildfly

BCryptPasswordImpl(final ClearPasswordSpec clearPasswordSpec) {
  this.salt = PasswordUtil.generateRandomSalt(BCRYPT_SALT_SIZE);
  this.iterationCount = DEFAULT_ITERATION_COUNT;
  this.hash = bcrypt(this.iterationCount, this.salt, getNormalizedPasswordBytes(clearPasswordSpec.getEncodedPassword()));
}
origin: wildfly/wildfly

SunUnixMD5CryptPasswordImpl(final ClearPasswordSpec spec) throws NoSuchAlgorithmException {
  this.algorithm = ALGORITHM_SUN_CRYPT_MD5;
  this.salt = PasswordUtil.generateRandomSalt(DEFAULT_SALT_SIZE);
  this.iterationCount = DEFAULT_ITERATION_COUNT;
  this.hash = sunMD5Crypt(algorithm, getNormalizedPasswordBytes(spec.getEncodedPassword()), salt, iterationCount);
}
origin: wildfly/wildfly

SaltedSimpleDigestPasswordImpl(final String algorithm, final ClearPasswordSpec spec) throws InvalidKeySpecException {
  this.algorithm = algorithm;
  this.salt = PasswordUtil.generateRandomSalt(DEFAULT_SALT_SIZE);
  try {
    this.digest = digestOf(algorithm, salt, spec.getEncodedPassword());
  } catch (NoSuchAlgorithmException e) {
    throw log.invalidKeySpecNoSuchMessageDigestAlgorithm(algorithm);
  }
}
origin: wildfly/wildfly

UnixMD5CryptPasswordImpl(final ClearPasswordSpec spec) throws NoSuchAlgorithmException {
  this.salt = PasswordUtil.generateRandomSalt(SALT_SIZE);
  this.hash = encode(getNormalizedPasswordBytes(spec.getEncodedPassword()), this.salt);
}
origin: wildfly/wildfly

private static char[] keyStoreCredentialToPassword(ExceptionSupplier<KeyStore.Entry, ConfigXMLParseException> keyStoreCredential,
    Supplier<Provider[]> providers) throws GeneralSecurityException, ConfigXMLParseException {
  final KeyStore.Entry entry = keyStoreCredential == null ? null : keyStoreCredential.get();
  if (entry instanceof PasswordEntry) {
    Password password = ((PasswordEntry) entry).getPassword();
    final PasswordFactory passwordFactory = PasswordFactory.getInstance(password.getAlgorithm(), providers);
    password = passwordFactory.translate(password);
    final ClearPasswordSpec spec = passwordFactory.getKeySpec(password, ClearPasswordSpec.class);
    return spec.getEncodedPassword();
  } else if (entry instanceof KeyStore.SecretKeyEntry) {
    final SecretKey secretKey = ((KeyStore.SecretKeyEntry) entry).getSecretKey();
    final SecretKeyFactory instance = SecretKeyFactory.getInstance(secretKey.getAlgorithm());
    final SecretKeySpec keySpec = (SecretKeySpec) instance.getKeySpec(secretKey, SecretKeySpec.class);
    final byte[] encoded = keySpec.getEncoded();
    return encoded == null ? null : new String(encoded, StandardCharsets.UTF_8).toCharArray();
  } else {
    return null;
  }
}
origin: wildfly/wildfly

private static byte[] encodeClearPasswordSpec(ClearPasswordSpec keySpec) throws InvalidKeySpecException {
  byte[] passwordBytes = CodePointIterator.ofChars(keySpec.getEncodedPassword()).asUtf8().drain();
  return new ByteStringBuilder().append(CLEAR_PASSWORD_SPEC_ID).append(passwordBytes).toArray();
}
origin: wildfly/wildfly

  /**
   * Get array of password chars from TwoWayPassword
   *
   * @return
   * @throws SaslException
   */
  public static char[] getTwoWayPasswordChars(TwoWayPassword password, Supplier<Provider[]> providers, ElytronMessages log) throws AuthenticationMechanismException {
    if (password == null) {
      throw log.mechNoPasswordGiven();
    }
    try {
      PasswordFactory pf = PasswordFactory.getInstance(password.getAlgorithm(), providers);
      return pf.getKeySpec(pf.translate(password), ClearPasswordSpec.class).getEncodedPassword();
    } catch (NoSuchAlgorithmException | InvalidKeySpecException | InvalidKeyException e) {
      throw log.mechCannotGetTwoWayPasswordChars(e);
    }
  }
}
origin: wildfly/wildfly

  password = factory.getKeySpec(factory.translate(twoWayPassword), ClearPasswordSpec.class).getEncodedPassword();
} catch (UnsupportedCallbackException e) {
  if (e.getCallback() == credentialCallback) {
origin: wildfly/wildfly

  PasswordFactory passwordFactory = PasswordFactory.getInstance(password.getAlgorithm());
  ClearPasswordSpec clearPasswordSpec = passwordFactory.getKeySpec(passwordFactory.translate(password), ClearPasswordSpec.class);
  passwordCallback.setPassword(clearPasswordSpec.getEncodedPassword());
  continue;
} catch (GeneralSecurityException e) {
origin: wildfly/wildfly

final ClearPasswordSpec spec = clearFactory.getKeySpec(clearFactory.translate(twoWayPassword), ClearPasswordSpec.class);
if (matchParameters != null) {
  return passwordType.cast(passwordFactory.generatePassword(new EncryptablePasswordSpec(spec.getEncodedPassword(), generateParameters)));
} else {
  return passwordType.cast(passwordFactory.generatePassword(spec));
origin: wildfly/wildfly

encoder.encodeOctetString(new String(passwordSpec.getEncodedPassword()));
break;
origin: wildfly/wildfly

passwordCallback.setPassword(clearPasswordSpec.getEncodedPassword());
handleOne(callbacks, idx + 1);
return;
origin: wildfly/wildfly

  final PasswordFactory passwordFactory1 = PasswordFactory.getInstance(password.getAlgorithm(), providersSupplier);
  final ClearPasswordSpec passwordSpec = passwordFactory1.getKeySpec(password, ClearPasswordSpec.class);
  return passwordSpec.getEncodedPassword();
} catch (GeneralSecurityException e) {
  throw xmlLog.xmlFailedToCreateCredential(nestedLocation, e);
origin: wildfly/wildfly

case ALGORITHM_CLEAR: {
  if (keySpec instanceof ClearPasswordSpec) {
    return new ClearPasswordImpl(((ClearPasswordSpec) keySpec).getEncodedPassword().clone());
  } else if (keySpec instanceof EncryptablePasswordSpec) {
    return new ClearPasswordImpl(((EncryptablePasswordSpec) keySpec).getPassword().clone());
org.wildfly.security.password.specClearPasswordSpecgetEncodedPassword

Javadoc

Get the password characters.

Popular methods of ClearPasswordSpec

  • <init>
    Construct a new instance.

Popular in Java

  • Reading from database using SQL prepared statement
  • notifyDataSetChanged (ArrayAdapter)
  • addToBackStack (FragmentTransaction)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • PrintStream (java.io)
    A PrintStream adds functionality to another output stream, namely the ability to print representatio
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Collectors (java.util.stream)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now