!!Decrypt an Encrypted value !Functionality: This function will decrypt a value in the database, if it has been encrypted. !Parameters: |CLEAR TEXT VALUE | The clear-text value (unencrypted) of a column |ENCRYPTED VALUE | The encrypted value of a column !Returns: P2K_PMSEC.CHECKANDDECRYPT returns Varchar2 or P2K_PMSEC.CHECKANDDECRYPTDATE returns Date !Errors: None !Example: {{P2K_PMSEC.CHECKANDDECRYPT(eid.government_code,eid.raw_government_code)}} {{P2K_PMSEC.CHECKANDDECRYPTDATE(eid.birth_date,eid.raw_birth_date)}} This will return the government code (or birth date) of the employee from the identity (EID) record, if it is encrypted or not. This function is normally used when you do not know if the data will be encrypted or not. By passing in both the clear-text and the encrypted values from the record, this function will determine if the data is encrypted and will decrypt and return it. If it is not encrypted, it will just pass through the clear-text data. This saves other code from having to figure out if encryption is being used for the column. This function has been added into provided views, Java code, and any PL/SQL code that use any of the supported columns. For example, A view may have been available with {{{ SELECT ... p2k_smglx('X_GENDER', ect.gender) GENDER, government_code GOVT_CODE, birth_date BIRTH_DATE, ... from P2K_CM_CONTACTS ECT ... }}} will now be seen as {{{ SELECT ... p2k_smglx('X_GENDER', ect.gender) GENDER, p2k_pmsec.CheckAndDecrypt(ect.government_code, ect.raw_government_code) GOVT_CODE, p2k_pmsec.CheckAndDecryptDate(ect.birth_date, ect.raw_birth_date) BIRTH_DATE, ... from P2K_CM_CONTACTS ECT ... }}} ---- ![Notes|Edit:Internal.P2K_PMSEC.CHECKANDDECRYPT] [{InsertPage page='Internal.P2K_PMSEC.CHECKANDDECRYPT' default='Click to create a new notes page'}]