@@ 2,7 2,6 @@ from flask import Blueprint, render_template, request, redirect, session, abort
from flask_login import current_user
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
-import pgpy
from srht.database import db
from srht.flask import loginrequired
@@ 60,16 59,7 @@ def secrets_POST():
secret = Secret(current_user, secret_type)
- if secret_type == SecretType.pgp_key:
- try:
- key, _ = pgpy.PGPKey.from_blob(_secret)
- if key.is_protected:
- valid.error("PGP key cannot be passphrase protected.",
- field="secret")
- except Exception as ex:
- valid.error("Invalid PGP key.",
- field="secret")
- elif secret_type == SecretType.plaintext_file:
+ if secret_type == SecretType.plaintext_file:
file_path = valid.require("file-path", friendly_name="Path")
file_mode = valid.require("file-mode", friendly_name="Mode")
if not valid.ok: