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

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

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

origin: wildfly/wildfly

/**
 * Get a byte iterator for a byte array.
 *
 * @param bytes the array
 * @return the byte iterator
 */
public static ByteIterator ofBytes(final byte... bytes) {
  return ofBytes(bytes, 0, bytes.length);
}
origin: wildfly/wildfly

/**
 * Get a byte iterator for a byte array with interleave.
 *
 * @param bytes the array
 * @param interleave the interleave table to use
 * @return the byte iterator
 */
public static ByteIterator ofBytes(final byte[] bytes, final int[] interleave) {
  return ofBytes(bytes, 0, bytes.length, interleave);
}
origin: wildfly/wildfly

public ByteIterator sign(Signature signature) throws IllegalStateException {
  update(signature);
  try {
    return ByteIterator.ofBytes(signature.sign());
  } catch (SignatureException e) {
    throw new IllegalStateException(e);
  }
}
origin: wildfly/wildfly

public ByteIterator doFinal(final MessageDigest digest) throws IllegalStateException {
  update(digest);
  return ByteIterator.ofBytes(digest.digest());
}
origin: wildfly/wildfly

public ByteIterator doFinal(final Mac mac) throws IllegalStateException {
  update(mac);
  return ByteIterator.ofBytes(mac.doFinal());
}
origin: wildfly/wildfly

public ByteIterator doFinal(MessageDigest digest) throws IllegalStateException {
  update(digest);
  return ByteIterator.ofBytes(digest.digest());
}
origin: wildfly/wildfly

/**
 * Get a code point iterator for a UTF-8 encoded array.
 *
 * @param bytes the array
 * @param offs the array offset
 * @param len the number of characters to include
 * @return the code point iterator
 */
public static CodePointIterator ofUtf8Bytes(final byte[] bytes, final int offs, final int len) {
  if (len <= 0) {
    return EMPTY;
  }
  return ByteIterator.ofBytes(bytes, offs, len).asUtf8String();
}
origin: wildfly/wildfly

/**
 * Get a code point iterator for a ISO-8859-1 (Latin-1) encoded array.
 *
 * @param bytes the array
 * @param offs the array offset
 * @param len the number of characters to include
 * @return the code point iterator
 */
public static CodePointIterator ofLatin1Bytes(final byte[] bytes, final int offs, final int len) {
  if (len <= 0) {
    return EMPTY;
  }
  return ByteIterator.ofBytes(bytes, offs, len).asLatin1String();
}
origin: wildfly/wildfly

public ByteIterator doFinal(Mac mac) throws IllegalStateException {
  return ByteIterator.ofBytes(mac.doFinal(drain()));
}
origin: wildfly/wildfly

  @Override
  public boolean verifyCertificate(X509Certificate certificate, Attributes attributes) throws NamingException, RealmUnavailableException {
    Attribute attribute = attributes.get(ldapAttribute);
    if (attribute == null) return false;
    final int size = attribute.size();
    try {
      MessageDigest md = MessageDigest.getInstance(algorithm);
      String digest = ByteIterator.ofBytes(md.digest(certificate.getEncoded())).hexEncode(true).drainToString();
      for (int i = 0; i < size; i++) {
        Object attrDigest = attribute.get(i);
        if (attrDigest != null){
          if (digest.equalsIgnoreCase((String) attrDigest)) {
            return true;
          }
        }
      }
    } catch (NoSuchAlgorithmException | CertificateEncodingException e) {
      throw new RealmUnavailableException(e);
    }
    return false;
  }
}
origin: org.jboss.eap/wildfly-client-all

/**
 * Get a byte iterator for a byte array.
 *
 * @param bytes the array
 * @return the byte iterator
 */
public static ByteIterator ofBytes(final byte... bytes) {
  return ofBytes(bytes, 0, bytes.length);
}
origin: org.wildfly.security/wildfly-elytron

/**
 * Get a byte iterator for a byte array.
 *
 * @param bytes the array
 * @return the byte iterator
 */
public static ByteIterator ofBytes(final byte... bytes) {
  return ofBytes(bytes, 0, bytes.length);
}
origin: org.wildfly.security/wildfly-elytron

/**
 * Get a byte iterator for a byte array with interleave.
 *
 * @param bytes the array
 * @param interleave the interleave table to use
 * @return the byte iterator
 */
public static ByteIterator ofBytes(final byte[] bytes, final int[] interleave) {
  return ofBytes(bytes, 0, bytes.length, interleave);
}
origin: org.jboss.eap/wildfly-client-all

/**
 * Get a byte iterator for a byte array with interleave.
 *
 * @param bytes the array
 * @param interleave the interleave table to use
 * @return the byte iterator
 */
public static ByteIterator ofBytes(final byte[] bytes, final int[] interleave) {
  return ofBytes(bytes, 0, bytes.length, interleave);
}
origin: org.wildfly.security/wildfly-elytron

public ByteIterator sign(Signature signature) throws IllegalStateException {
  update(signature);
  try {
    return ByteIterator.ofBytes(signature.sign());
  } catch (SignatureException e) {
    throw new IllegalStateException(e);
  }
}
origin: org.jboss.eap/wildfly-client-all

public ByteIterator sign(Signature signature) throws IllegalStateException {
  update(signature);
  try {
    return ByteIterator.ofBytes(signature.sign());
  } catch (SignatureException e) {
    throw new IllegalStateException(e);
  }
}
origin: org.wildfly.security/wildfly-elytron

public ByteIterator doFinal(final MessageDigest digest) throws IllegalStateException {
  update(digest);
  return ByteIterator.ofBytes(digest.digest());
}
origin: org.wildfly.security/wildfly-elytron

public ByteIterator doFinal(MessageDigest digest) throws IllegalStateException {
  update(digest);
  return ByteIterator.ofBytes(digest.digest());
}
origin: org.wildfly.security/wildfly-elytron

public ByteIterator doFinal(final Mac mac) throws IllegalStateException {
  update(mac);
  return ByteIterator.ofBytes(mac.doFinal());
}
origin: org.jboss.eap/wildfly-client-all

public ByteIterator doFinal(final MessageDigest digest) throws IllegalStateException {
  update(digest);
  return ByteIterator.ofBytes(digest.digest());
}
org.wildfly.security.utilByteIteratorofBytes

Javadoc

Get a byte iterator for a byte array.

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
  • 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.
  • offset
    Get the current offset, in bytes.
  • next,
  • offset,
  • peekNext,
  • peekPrev,
  • prev,
  • update,
  • hexDecode

Popular in Java

  • Reactive rest calls using spring rest template
  • putExtra (Intent)
  • getSupportFragmentManager (FragmentActivity)
  • getContentResolver (Context)
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • JLabel (javax.swing)
  • Top Vim plugins
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