Does anyone know of a way to reverse encryption on attachments?

John VanBruggen
Giga Guru

I am looking for a way to remove encryption context from a large number of attachments in relation to a specific table.

Is there a way to do this?   I see scripts in the WIKI that show how to encrypt en mass but nothing for removing encryption.

Thanks in advance.

Check out my Consultant's Survival Guide
https://youtube.com/watch?v=zYi8KhP9SUk
17 REPLIES 17

I'm not sure what the parameters are, but these are all accessible methods of GlideSysAttachment.


Maybe something in here can help?



exists(...)


setTableName(...)


writeInvisible(...)


toString(...)


wait(...)


getAsStream(...)


write(...)


renameAttachment(...)


getBytes(...)


getClass(...)


getTableSysID(...)


hashCode(...)


getSysID(...)


notify(...)


getFileName(...)


getBytesUnsafe(...)


read(...)


setInputStream(...)


writeFromRequest(...)


getParameters(...)


streamData(...)


getErrorFileName(...)


equals(...)


changeEncryptionContext(...)


setContentType(...)


writeParts(...)


getTableName(...)


processRequest(...)


setFileName(...)


setTableSysID(...)


readByName(...)


getAttachmentsForExtensions(...)


getAttachments(...)


delete(...)


getInputStream(...)


deleteAll(...)


getSizeBytes(...)


loadParameters(...)


getParameter(...)


getAllAttachments(...)


readToFile(...)


getDBImageAttachmentRecord(...)


getFileDescriptor(...)


getContentType(...)


setStreamMonitor(...)


deleteAllAttachments(...)


deleteAttachment(...)


addEncryptionContexts(...)


notifyAll(...)


get(...)


getErrorMessage(...)



ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

This is great.   Where did you find this list?   I find very little info about glidesysattachment as far as usage goes.


Check out my Consultant's Survival Guide
https://youtube.com/watch?v=zYi8KhP9SUk

Hi John,



There is some info here:


Useful Attachment Scripts - ServiceNow Wiki


..


Note: This API call changed in the Calgary release:


  • GlideSysAttachment replaces Packages.com.glide.ui.SysAttachment

etc



Best Regards



Tony


Thanks, I seen this out there too but it really doesn't give much on it.


The only use case it describes is GlideSysAttachment.copy.


I am really interested in how to utilize GlideSysAttachment.changeEncryptionContext





Check out my Consultant's Survival Guide
https://youtube.com/watch?v=zYi8KhP9SUk

I've successfully applied an encryption context previously, however I'm not certain if it can be removed completely. Perhaps a null value?


var ga = new GlideSysAttachment();


ga.changeEncryptionContext(tableName, recordSysID, attachmentSysID, encryptionContextID);