es.rediris.papi
Class Ciphers

java.lang.Object
  extended by es.rediris.papi.Ciphers

public class Ciphers
extends Object

Cryptographic class for PAPIFilter. Includes AES and RSA encoding/decoding

Author:
ajay

Constructor Summary
Ciphers(Properties papiConf)
          Creates a new instance of Ciphers .
 
Method Summary
 String AES_Encode(boolean encode, boolean isHcook, String data)
          AES encoding/decoding
 String createDigest(String data)
           
 void init(String ASname)
          Initializes the RSA engine, used with GPoA data and AS assertions
 String RSA_Encode(boolean encoding, String data)
          RSA encoding/decoding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Ciphers

public Ciphers(Properties papiConf)
        throws ServletException
Creates a new instance of Ciphers . Uses default falues set in the PAPI configuration file. Initializes AES hkey and lkey files.

Parameters:
papiConf - Configuration values
Throws:
ServletException - if there's been any exception while creating the engines or reading the key files
Method Detail

init

public void init(String ASname)
          throws ServletException
Initializes the RSA engine, used with GPoA data and AS assertions

Parameters:
ASname - name of the signer
Throws:
ServletException

RSA_Encode

public String RSA_Encode(boolean encoding,
                         String data)
                  throws ServletException
RSA encoding/decoding

Parameters:
encoding - true if we wish to encode data
data - data to encode/decode
Returns:
ciphered data
Throws:
ServletException

AES_Encode

public String AES_Encode(boolean encode,
                         boolean isHcook,
                         String data)
                  throws ServletException
AES encoding/decoding

Parameters:
encode - True if we wish to encode
isHcook - True if the data to process belongs to a Hcook
data - Data to process
Returns:
Encoded/decoded data
Throws:
ServletException

createDigest

public String createDigest(String data)