Class PGEncryptionUtil


  • @Scriptable
    public class PGEncryptionUtil
    extends Object
    • Constructor Detail

      • PGEncryptionUtil

        public PGEncryptionUtil()
    • Method Detail

      • getDecryptedFile

        public static File getDecryptedFile​(IProcessingContext p_ctx,
                                            String p_strFieldGuid,
                                            Object p_recId)
                                     throws Exception
        Get a file from file storage and decrypt it. The returned unencrypted files should be deleted by the user after usage.
        Parameters:
        p_ctx - processing context
        p_strFieldGuid - field GUID
        p_recId - record id
        Returns:
        a decrypted file
        Throws:
        Exception - if any occurs
      • writeEncryptedFile

        public static void writeEncryptedFile​(IProcessingContext p_ctx,
                                              File p_file,
                                              String p_strFieldGuid,
                                              Object p_recId,
                                              String p_strFileName)
                                       throws Exception
        Encrypt a given file and move it to a file storage.
        Parameters:
        p_ctx - processing context
        p_file - file
        p_strFieldGuid - field GUID
        p_recId - record id
        p_strFileName - the destination file name
        Throws:
        Exception - if any occurs
      • deleteEncryptedFile

        public static void deleteEncryptedFile​(IProcessingContext p_ctx,
                                               String p_strFieldGuid,
                                               Object p_recId)
                                        throws Exception
        Delete a encrypted file from storage.
        Parameters:
        p_ctx - processing context
        p_strFieldGuid - field GUID
        p_recId - record id
        Throws:
        Exception - if any occurs
      • encrypt

        public static void encrypt​(String p_strAppGuid,
                                   Path p_path)