Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.

public enum MacAlgorithm

  1. Object
  2. Enum<MacAlgorithm>
  3. MacAlgorithm

ImplementsComparable<MacAlgorithm>, JwsAlgorithm

The shared secret algorithms: whoever can verify a token can also make one, so these suit a server checking tokens it issued itself and nothing wider.

Enum constants

HS256HMAC with SHA-256.
HS384HMAC with SHA-384.
HS512HMAC with SHA-512.

Methods

public static MacAlgorithm[] values()
public static MacAlgorithm valueOf(String name)
public String getName()The name as a token’s alg header carries it: RS256.
public static MacAlgorithm from(String name)The algorithm of this name, or null when it is not one of these.

Inherited methods

Enum constant details

HS256

HS256
HMAC with SHA-256.

HS384

HS384
HMAC with SHA-384.

HS512

HS512
HMAC with SHA-512.

Method details

values

public static MacAlgorithm[] values()

valueOf

public static MacAlgorithm valueOf(String name)

getName

public String getName()
The name as a token’s alg header carries it: RS256.

from

public static MacAlgorithm from(String name)
The algorithm of this name, or null when it is not one of these.