Top Description Fields Constructors Methods
io.undertow.server.session

public Class SecureRandomSessionIdGenerator

extends Object
implements SessionIdGenerator
Class Inheritance
All Implemented Interfaces
io.undertow.server.session.SessionIdGenerator
Imports
java.security.SecureRandom

A SessionIdGenerator that uses a secure random to generate a session ID. On some systems this may perform poorly if not enough entropy is available, depending on the algorithm in use.
Author
Stuart Douglas

Field Summary

Modifier and TypeField and Description
private static final String
private volatile int
private final SecureRandom
private static final char[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
private char[]

Returns:

the encoded String
encode
(byte[]
The bytes you want to encode
data
)

Encode the bytes into a String with a slightly modified Base64-algorithm This code was written by Kevin Kelley <[email protected]> and adapted by Thomas Peuss <[email protected]>

public int
public void
setLength(final int length)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ALPHABET_PROPERTYback to summary
private static final String ALPHABET_PROPERTY
lengthback to summary
private volatile int length
randomback to summary
private final SecureRandom random
SESSION_ID_ALPHABETback to summary
private static final char[] SESSION_ID_ALPHABET

Constructor Detail

SecureRandomSessionIdGeneratorback to summary
public SecureRandomSessionIdGenerator()

Method Detail

createSessionIdback to summary
public String createSessionId()

Implements io.undertow.server.session.SessionIdGenerator.createSessionId.

Annotations
@Override
encodeback to summary
private char[] encode(byte[] data)

Encode the bytes into a String with a slightly modified Base64-algorithm This code was written by Kevin Kelley and adapted by Thomas Peuss

Parameters
data:byte[]

The bytes you want to encode

Returns:char[]

the encoded String

getLengthback to summary
public int getLength()
setLengthback to summary
public void setLength(final int length)