MCPcopy Index your code
hub / github.com/mailvelope/mailvelope / getMessageType

Function getMessageType

src/content-scripts/main.js:283–295  ·  view source on GitHub ↗
(armored)

Source from the content-addressed store, hash-verified

281}
282
283export function getMessageType(armored) {
284 if (/(BEGIN|END)\sPGP\sMESSAGE/.test(armored)) {
285 return PGP_MESSAGE;
286 } else if (/BEGIN\sPGP\sSIGNED\sMESSAGE/.test(armored)) {
287 return PGP_SIGNATURE;
288 } else if (/END\sPGP\sSIGNATURE/.test(armored)) {
289 return PGP_SIGNATURE;
290 } else if (/(BEGIN|END)\sPGP\sPRIVATE\sKEY\sBLOCK/.test(armored)) {
291 return PGP_PRIVATE_KEY;
292 } else if (/(BEGIN|END)\sPGP\sPUBLIC\sKEY\sBLOCK/.test(armored)) {
293 return PGP_PUBLIC_KEY;
294 }
295}
296
297function attachExtractFrame(ranges) {
298 // check status of PGP ranges

Callers 5

displayContainerFunction · 0.90
importPublicKeyFunction · 0.90
processOptionsMethod · 0.90
findPGPRangesFunction · 0.85
attachExtractFrameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected