Interface CipherService

  • All Known Implementing Classes:
    DefaultCipherService

    public interface CipherService
    Service to perform encryption and decryption of values, in order to secure the communication with the PunchOut service.
    • Method Detail

      • encrypt

        java.lang.String encrypt​(java.lang.String userId,
                                 PunchOutSession punchoutSession)
                          throws PunchOutCipherException,
                                 java.lang.IllegalArgumentException
        Create 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.IllegalArgumentException
        Retrieves 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.