Package org.springframework.security.web.webauthn.api

# Class Bytes

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

All Implemented Interfaces:
  `Serializable`

public final class Bytes extends Object implements Serializable
An object representation of byte[].

Since:
  6.4
See Also:
  - Serialized Form

## Constructor Summary

Constructors
Constructor
Description
`Bytes(byte[] bytes)`
Creates a new instance

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object obj)`
`static Bytes`
`fromBase64(String base64UrlString)`
Creates a new instance from a base64 url string.
`byte[]`
`getBytes()`
Gets the raw bytes.
`int`
`hashCode()`
`static Bytes`
`random()`
Creates a secure random `Bytes` with random bytes and sufficient entropy.
`String`
`toBase64UrlString()`
Gets the bytes as Base64 URL encoded String.
`String`
`toString()`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## 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`