org.pfsw.security
Class Base64UrlEncodedRandomStringGenerator

java.lang.Object
  extended by org.pfsw.security.Base64UrlEncodedRandomStringGenerator
All Implemented Interfaces:
org.pfsw.text.StringGenerator

public class Base64UrlEncodedRandomStringGenerator
extends java.lang.Object
implements org.pfsw.text.StringGenerator

A generator for random strings that uses a newly generated random byte sequence and returns it base64url encoded (without padding).


Constructor Summary
Base64UrlEncodedRandomStringGenerator(org.pfsw.bif.ByteSequenceGenerator byteSequenceGenerator)
          Creates a new instance that creates new strings based on the given ByteSequenceGenerator.
Base64UrlEncodedRandomStringGenerator(int byteSequenceLength)
          Creates a new instance that creates new strings based on a ByteSequenceGenerator with the given length for the by sequences.
 
Method Summary
static Base64UrlEncodedRandomStringGenerator create(org.pfsw.bif.ByteSequenceGenerator byteSequenceGenerator)
          Creates a new instance that creates new strings based on the given ByteSequenceGenerator.
static Base64UrlEncodedRandomStringGenerator create(int byteSequenceLength)
          Creates a new instance that creates new strings based on a ByteSequenceGenerator with the given length for the by sequences.
 java.lang.String generateString()
           
 java.lang.String generateString(int length)
           
protected  org.pfsw.bif.conversion.IBase64Encoder getBase64Encoder()
           
protected  org.pfsw.bif.ByteSequenceGenerator getByteSequenceGenerator()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Base64UrlEncodedRandomStringGenerator

public Base64UrlEncodedRandomStringGenerator(int byteSequenceLength)
Creates a new instance that creates new strings based on a ByteSequenceGenerator with the given length for the by sequences.

Parameters:
byteSequenceLength - The length of the random byte sequences to be used.

Base64UrlEncodedRandomStringGenerator

public Base64UrlEncodedRandomStringGenerator(org.pfsw.bif.ByteSequenceGenerator byteSequenceGenerator)
Creates a new instance that creates new strings based on the given ByteSequenceGenerator.

Parameters:
byteSequenceGenerator - The generator for new byte sequences.
Method Detail

create

public static Base64UrlEncodedRandomStringGenerator create(int byteSequenceLength)
Creates a new instance that creates new strings based on a ByteSequenceGenerator with the given length for the by sequences.

Parameters:
byteSequenceLength - The length of the random byte sequences to be used.

create

public static Base64UrlEncodedRandomStringGenerator create(org.pfsw.bif.ByteSequenceGenerator byteSequenceGenerator)
Creates a new instance that creates new strings based on the given ByteSequenceGenerator.

Parameters:
byteSequenceGenerator - The generator for new byte sequences.

generateString

public java.lang.String generateString()
Specified by:
generateString in interface org.pfsw.text.StringGenerator

generateString

public java.lang.String generateString(int length)
Specified by:
generateString in interface org.pfsw.text.StringGenerator

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getBase64Encoder

protected org.pfsw.bif.conversion.IBase64Encoder getBase64Encoder()

getByteSequenceGenerator

protected org.pfsw.bif.ByteSequenceGenerator getByteSequenceGenerator()