Tabnine Logo
ByteIterator.hexDecode
Code IndexAdd Tabnine to your IDE (free)

How to use
hexDecode
method
in
org.wildfly.security.util.ByteIterator

Best Java code snippets using org.wildfly.security.util.ByteIterator.hexDecode (Showing top 1 results out of 315)

origin: org.infinispan.server/infinispan-server-jgroups

@Override
public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
  for (Callback callback : callbacks) {
    if (callback instanceof PasswordCallback) {
      ((PasswordCallback) callback).setPassword(credential.toCharArray());
    } else if (callback instanceof NameCallback) {
      ((NameCallback) callback).setName(name);
    } else if (callback instanceof RealmCallback) {
      ((RealmCallback) callback).setText(realm);
    } else if (callback instanceof CredentialCallback) {
      CredentialCallback cb = (CredentialCallback) callback;
      Password password;
      switch (cb.getAlgorithm()) {
        case ALGORITHM_CLEAR:
          password = ClearPassword.createRaw(ALGORITHM_CLEAR, credential.toCharArray());
          break;
        case ALGORITHM_DIGEST_MD5:
          byte[] decodedDigest = ByteIterator.ofBytes(credential.getBytes(StandardCharsets.UTF_8)).hexDecode().drain();
          password = DigestPassword.createRaw(ALGORITHM_DIGEST_MD5, name, realm, decodedDigest);
          break;
        default:
          continue;
      }
      cb.setCredential(cb.getCredentialType().cast(new PasswordCredential(password)));
    }
  }
}
org.wildfly.security.utilByteIteratorhexDecode

Javadoc

Hex-decode the current stream, assuming that the byte data is encoded in an ASCII-derived encoding.

Popular methods of ByteIterator

  • asUtf8String
    Get this byte iterator as a UTF-8 string.
  • drain
    Drains up to len bytes from this iterator into the given dst array. An attempt is made to drain as m
  • ofBytes
    Get a byte iterator for a byte array with interleave.
  • appendTo
  • asLatin1String
    Get this byte iterator as a Latin-1 string.
  • base32Encode
    Base32-encode the current stream.
  • base64Encode
    Base64-encode the current stream.
  • drainTo
    Drain all the remaining bytes in this iterator to the given stream.
  • hasNext
    Determine if there are more bytes after the current byte.
  • hasPrev
    Determine if there are more bytes before the current byte.
  • hexEncode
    Hex-encode the current stream.
  • next
    Get the next byte.
  • hexEncode,
  • next,
  • offset,
  • peekNext,
  • peekPrev,
  • prev,
  • update

Popular in Java

  • Finding current android device location
  • findViewById (Activity)
  • getApplicationContext (Context)
  • putExtra (Intent)
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • JCheckBox (javax.swing)
  • 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