Interface CipherService
-
- All Known Implementing Classes:
DefaultCipherService
public interface CipherServiceService to perform encryption and decryption of values, in order to secure the communication with the PunchOut service.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Stringencrypt(java.lang.String userId, PunchOutSession punchoutSession)Create a hash for a given user to be used in punchout login.java.lang.StringretrieveUserId(java.lang.String encryptedText, PunchOutSession punchoutSession)Retrieves the userId for a given encrypted text.
-
-
-
Method Detail
-
encrypt
java.lang.String encrypt(java.lang.String userId, PunchOutSession punchoutSession) throws PunchOutCipherException, java.lang.IllegalArgumentExceptionCreate a hash for a given user to be used in punchout login.- Parameters:
userId- The human readable id of the user that will get an associated hash.punchoutSession- The session of the current punchout user.- Returns:
- The encrypted value.
- Throws:
PunchOutCipherException- If Cipher has issues encrypting the text.java.lang.IllegalArgumentException- If some of the required arguments is missing or empty.
-
retrieveUserId
java.lang.String retrieveUserId(java.lang.String encryptedText, PunchOutSession punchoutSession) throws PunchOutCipherException, java.lang.IllegalArgumentExceptionRetrieves the userId for a given encrypted text.- Parameters:
encryptedText- The text to be decrypted.punchoutSession- The session of the current punchout user.- Returns:
- The userId, if the information contained in the encryptedText passes the security verification (null otherwise).
- Throws:
PunchOutCipherException- If Cipher has issues decrypting the text.java.lang.IllegalArgumentException- If some of the required arguments is missing or empty.
-
-