it.eng.spagobi.jpivotaddins.util
Class SecurityUtilities

java.lang.Object
  extended by it.eng.spagobi.jpivotaddins.util.SecurityUtilities

public class SecurityUtilities
extends java.lang.Object


Constructor Summary
SecurityUtilities(org.apache.log4j.Logger log)
           
 
Method Summary
 boolean authenticate(java.lang.String token, java.lang.String tokenclear, java.security.PublicKey publicKey)
          Authenticate the caller (must be SpagoBI)
 byte[] decodeBase64(java.lang.String encoded)
          Decode a Base64 String into a byte array
 java.util.Map decodeParameterMap(java.util.Map parMap)
          Decodes (using byte64 decoding function) all the value contained into the input map
 java.security.PublicKey getPublicKey()
          Get the SpagoBI Public Key for a DSA alghoritm
 boolean verifySignature(byte[] tokenclear, byte[] tokensign, java.security.PublicKey publicKeyDSASbi)
          Verify the signature
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecurityUtilities

public SecurityUtilities(org.apache.log4j.Logger log)
Method Detail

getPublicKey

public java.security.PublicKey getPublicKey()
Get the SpagoBI Public Key for a DSA alghoritm

Returns:
Public Key for SpagoBI (DSA alghoritm)

decodeBase64

public byte[] decodeBase64(java.lang.String encoded)
Decode a Base64 String into a byte array

Parameters:
encoded - String encoded with Base64 algorithm
Returns:
byte array decoded

verifySignature

public boolean verifySignature(byte[] tokenclear,
                               byte[] tokensign,
                               java.security.PublicKey publicKeyDSASbi)
Verify the signature

Parameters:
tokenclear - Clear data
tokensign - Signed data
Returns:

authenticate

public boolean authenticate(java.lang.String token,
                            java.lang.String tokenclear,
                            java.security.PublicKey publicKey)
Authenticate the caller (must be SpagoBI)

Parameters:
request - HttpRequest
response - HttpResponse
Returns:
boolean, true if autheticated false otherwise

decodeParameterMap

public java.util.Map decodeParameterMap(java.util.Map parMap)
Decodes (using byte64 decoding function) all the value contained into the input map

Parameters:
parMap - Map containing value to be decoded
Returns:
Map with value decoded