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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2015 12:59 PM
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.
https://youtube.com/watch?v=zYi8KhP9SUk
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2015 08:18 PM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2015 09:13 AM
This is great. Where did you find this list? I find very little info about glidesysattachment as far as usage goes.
https://youtube.com/watch?v=zYi8KhP9SUk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2015 11:05 AM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2015 11:18 AM
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
https://youtube.com/watch?v=zYi8KhP9SUk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2015 09:08 PM
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);