|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.aselect.server.crypto.CryptoEngine
public class CryptoEngine
This class contains crypto-related (helper) methods.
It is thread-safe.
Method Summary | |
---|---|
byte[] |
decryptTGT(java.lang.String sEncTgt)
Decrypt a TGT using the configured encryption algorithm (cipher). |
java.lang.String |
encryptTGT(byte[] baData)
Encrypt a TGT using the configured encryption algorithm (cipher). |
java.lang.String |
generateSignature(java.lang.String sAuthsp,
java.lang.String sData)
Generate a signature using the authsp-specific private key. |
java.lang.String |
getAuthSPSpecificCertId(java.lang.String sAuthsp)
Retrieve the optional configured AuthSP specific Certificate ID. |
static CryptoEngine |
getHandle()
Return a reference to the CryptoEngine object. |
void |
init()
Initialize the CryptoEngine. |
static void |
nextRandomBytes(byte[] baRandom)
Generate random bytes. |
void |
signRequest(java.util.Hashtable htRequest)
Sign a request. |
void |
stop()
Stops the CryptoEngine and performs cleanup. |
boolean |
verifyApplicationSignature(java.security.PublicKey oPublicKey,
java.lang.String sData,
java.lang.String sSignature)
Verify a signature generated by an application. |
boolean |
verifyCrossASelectSignature(java.security.PublicKey oPublicKey,
java.lang.String sData,
java.lang.String sSignature)
Verify a signature generated by a remote cross A-Select Server. |
boolean |
verifyPrivilegedSignature(java.lang.String sAlias,
java.lang.String sData,
java.lang.String sSignature)
Verify a signature generated by a privileged application. |
boolean |
verifySignature(java.lang.String sAlias,
java.lang.String sData,
java.lang.String sSignature)
Verify a signature generated by an authsp. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static CryptoEngine getHandle()
CryptoEngine
objectpublic void init() throws ASelectException
ASelectException
- if initialization failspublic boolean verifyPrivilegedSignature(java.lang.String sAlias, java.lang.String sData, java.lang.String sSignature)
sAlias
- The id of the privileged application, which is also the alias
under which the application public key is stored in the keystore.sData
- The data to be verifiedsSignature
- The data's signature
true
if verification was succesful,
false
otherwisepublic boolean verifySignature(java.lang.String sAlias, java.lang.String sData, java.lang.String sSignature)
sAlias
- The id of the authsp, which is also the alias
under which the authsp's public key is stored in the keystore.sData
- The data to be verifiedsSignature
- The data's signature
true
if verification was succesful,
false
otherwisepublic boolean verifyCrossASelectSignature(java.security.PublicKey oPublicKey, java.lang.String sData, java.lang.String sSignature)
oPublicKey
- The A-Select Server's public keysData
- The data to be verifiedsSignature
- The data's signature
true
if verification was succesful,
false
otherwisepublic boolean verifyApplicationSignature(java.security.PublicKey oPublicKey, java.lang.String sData, java.lang.String sSignature)
oPublicKey
- The application's public keysData
- The data to be verifiedsSignature
- The data's signature
true
if verification was succesful,
false
otherwisepublic java.lang.String generateSignature(java.lang.String sAuthsp, java.lang.String sData)
sAuthsp
- The id of the authsp, or null
to
use the default signing key.sData
- The data to be signed.
public java.lang.String encryptTGT(byte[] baData) throws ASelectException
baData
- A byte array representing the TGT
ASelectException
- If encrypting fails.public byte[] decryptTGT(java.lang.String sEncTgt) throws ASelectException
sEncTgt
- A String representation of the encrypted TGT
ASelectException
- If decrypting fails.public java.lang.String getAuthSPSpecificCertId(java.lang.String sAuthsp)
sAuthsp != null
sAuthsp
- The AuthSP name.
public void stop()
public static void nextRandomBytes(byte[] baRandom) throws java.lang.Exception
baRandom
- A byte array that will hold the random bytes
upon completion of this method
java.lang.Exception
public void signRequest(java.util.Hashtable htRequest) throws ASelectException
htRequest
should contain all parameters
that are send to the remote A-Select Server.
htRequest
will contain an additional "signature" parameter
containg the generated signature of the request.
htRequest
- The request that should be signed.
ASelectException
- If signing fails.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |