Tabnine Logo
ClearPasswordSpec.getEncodedPassword
Code IndexAdd Tabnine 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)

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

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

BSDUnixDESCryptPasswordImpl(final ClearPasswordSpec passwordSpec) throws InvalidKeySpecException {
  this(passwordSpec.getEncodedPassword(), ThreadLocalRandom.current().nextInt() & 0xffffff, DEFAULT_ITERATION_COUNT);
}
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

  • Parsing JSON documents to java classes using gson
  • scheduleAtFixedRate (Timer)
  • putExtra (Intent)
  • getSharedPreferences (Context)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • JTextField (javax.swing)
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Best plugins for Eclipse
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