org.springframework.security.oauth2.common.util
类 RandomValueStringGenerator

java.lang.Object
  继承者 org.springframework.security.oauth2.common.util.RandomValueStringGenerator

public class RandomValueStringGenerator
extends Object

Utility that generates a random-value ASCII string.

作者:
Ryan Heaton, Dave Syer

构造方法摘要
RandomValueStringGenerator()
          Create a generator with the default length (6).
RandomValueStringGenerator(int length)
          Create a generator of random strings of the length provided
 
方法摘要
 String generate()
           
protected  String getAuthorizationCodeString(byte[] verifierBytes)
          Convert these random bytes to a verifier string.
 void setLength(int length)
          The length of string to generate.
 void setRandom(Random random)
          The random value generator used to create token secrets.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

RandomValueStringGenerator

public RandomValueStringGenerator()
Create a generator with the default length (6).


RandomValueStringGenerator

public RandomValueStringGenerator(int length)
Create a generator of random strings of the length provided

参数:
length - the length of the strings generated
方法详细信息

generate

public String generate()

getAuthorizationCodeString

protected String getAuthorizationCodeString(byte[] verifierBytes)
Convert these random bytes to a verifier string. The length of the byte array can be configured. The default implementation mods the bytes to fit into the ASCII letters 1-9, A-Z, a-z .

参数:
verifierBytes - The bytes.
返回:
The string.

setRandom

public void setRandom(Random random)
The random value generator used to create token secrets.

参数:
random - The random value generator used to create token secrets.

setLength

public void setLength(int length)
The length of string to generate.

参数:
length - the length to set


Copyright © 2013. All rights reserved.