{"record":{"id":"32f80cda6ff72da7","repo":"getsops/sops","slug":"armor-decoding-failed-s","errorCode":null,"errorMessage":"armor decoding failed: %s","messagePattern":"armor decoding failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgp/keysource.go","lineNumber":433,"sourceCode":"\treturn nil, fmt.Errorf(\"could not decrypt data key with PGP key: %w\", errs)\n}\n\n// decryptWithOpenPGP attempts to obtain the data key from the EncryptedKey\n// using OpenPGP and returns the result.\n//\n// Note: the current development of OpenPGP vs GnuPG has moved in separate\n// directions. This means that e.g. GnuPG >=2.1 works with a .kbx format which\n// can not be read by OpenPGP. Given the further assumptions around the\n// placement of the files, and the generic fallback Decrypt uses, this raises\n// the question of how widely utilized this method still is.\nfunc (key *MasterKey) decryptWithOpenPGP() ([]byte, error) {\n\tring, err := key.getSecRing()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"could not load secring: %s\", err)\n\t}\n\tblock, err := armor.Decode(strings.NewReader(key.EncryptedKey))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"armor decoding failed: %s\", err)\n\t}\n\tmd, err := openpgp.ReadMessage(block.Body, ring, key.passphrasePrompt(), nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"reading PGP message failed: %s\", err)\n\t}\n\tif b, err := io.ReadAll(md.UnverifiedBody); err == nil {\n\t\treturn b, nil\n\t}\n\treturn nil, fmt.Errorf(\"the key could not be decrypted with any of the PGP entries\")\n}\n\n// decryptWithGnuPG attempts to obtain the data key from the EncryptedKey using\n// GnuPG and returns the result. If DisableAgent is configured on the MasterKey,\n// the GnuPG agent is not enabled. When the decryption command fails, it returns\n// the error from stdout.\nfunc (key *MasterKey) decryptWithGnuPG(ctx context.Context) ([]byte, error) {\n\targs := []string{\n\t\t\"-d\",","sourceCodeStart":415,"sourceCodeEnd":451,"githubUrl":"https://github.com/getsops/sops/blob/13442bb98183887d7a9ac09ec8ab0564673a59d8/pgp/keysource.go#L415-L451","documentation":"Error \"armor decoding failed: %s\" thrown in getsops/sops.","triggerScenarios":"Thrown at pgp/keysource.go:433 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"13442bb98183887d7a9ac09ec8ab0564673a59d8","analyzedAt":"2026-09-01T03:53:00.447Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}