it.eng.spagobi.engines.jpivot.security
Class SecurityUtilities

java.lang.Object
  extended by it.eng.spagobi.engines.jpivot.security.SecurityUtilities

public class SecurityUtilities
extends java.lang.Object


Field Summary
private  org.apache.log4j.Logger logger
           
 
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.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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private transient org.apache.log4j.Logger logger
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