java.lang.Object
org.springframework.security.web.webauthn.api.Bytes

public final class Bytes extends Object
An object representation of byte[].
Since:
6.4
  • Constructor Details

    • Bytes

      public Bytes(byte[] bytes)
      Creates a new instance
      Parameters:
      bytes - the raw base64UrlString that will be encoded.
  • Method Details

    • getBytes

      public byte[] getBytes()
      Gets the raw bytes.
      Returns:
      the bytes
    • toBase64UrlString

      public String toBase64UrlString()
      Gets the bytes as Base64 URL encoded String.
      Returns:
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • random

      public static Bytes random()
      Creates a secure random Bytes with random bytes and sufficient entropy.
      Returns:
      a new secure random generated Bytes
    • fromBase64

      public static Bytes fromBase64(String base64UrlString)
      Creates a new instance from a base64 url string.
      Parameters:
      base64UrlString - the base64 url string
      Returns:
      the Bytes