org.springframework.security.oauth.provider.verifier
Class RandomValueVerifierServices

java.lang.Object
  extended by org.springframework.security.oauth.provider.verifier.RandomValueVerifierServices
All Implemented Interfaces:
InitializingBean, OAuthVerifierServices

public class RandomValueVerifierServices
extends Object
implements OAuthVerifierServices, InitializingBean

Basic implementation of the verifier services that creates a random-value verifier and stores it in an in-memory map.

Author:
Ryan Heaton

Constructor Summary
RandomValueVerifierServices()
           
 
Method Summary
 void afterPropertiesSet()
           
 String createVerifier()
          Create a verifier.
 Random getRandom()
          The random value generator used to create token secrets.
 int getVerifierLengthBytes()
          The verifier length in bytes, before being encoded to a string.
protected  String getVerifierString(byte[] verifierBytes)
          Convert these random bytes to a verifier string.
 void setRandom(Random random)
          The random value generator used to create token secrets.
 void setVerifierLengthBytes(int verifierLengthBytes)
          The verifier length in bytes, before being encoded to a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomValueVerifierServices

public RandomValueVerifierServices()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception

createVerifier

public String createVerifier()
Description copied from interface: OAuthVerifierServices
Create a verifier.

Specified by:
createVerifier in interface OAuthVerifierServices
Returns:
The verifier.

getVerifierString

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

Parameters:
verifierBytes - The bytes.
Returns:
The string.

getRandom

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

Returns:
The random value generator used to create token secrets.

setRandom

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

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

getVerifierLengthBytes

public int getVerifierLengthBytes()
The verifier length in bytes, before being encoded to a string.

Returns:
The verifier length in bytes, before being encoded to a string.

setVerifierLengthBytes

public void setVerifierLengthBytes(int verifierLengthBytes)
The verifier length in bytes, before being encoded to a string.

Parameters:
verifierLengthBytes - The verifier length in bytes, before being encoded to a string.


Copyright © 2012. All Rights Reserved.