Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/28.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 使用Python从PDF文件检索数字签名信息_Linux_Python 2.7_Digital Signature - Fatal编程技术网

Linux 使用Python从PDF文件检索数字签名信息

Linux 使用Python从PDF文件检索数字签名信息,linux,python-2.7,digital-signature,Linux,Python 2.7,Digital Signature,我正在寻找如何使用Python 2.7检索PDF中的数字签名信息(签名者详细信息、签名日期、颁发者等)的方向。我是否需要使用像django endesive这样的签名模块(不是endesive,因为我认为它是安全的),或者我可以在读取文件时检索它 目前,用户通过外部程序在本地添加签名,然后通过应用程序将文件上载到服务器,并使用pycrypto对其进行加密 可以在加密之前读取文件的过程中检索这些信息吗?我该怎么做 下面是我用来加密文件的代码: encryptor = AES.new(key, AE

我正在寻找如何使用Python 2.7检索PDF中的数字签名信息(签名者详细信息、签名日期、颁发者等)的方向。我是否需要使用像django endesive这样的签名模块(不是endesive,因为我认为它是安全的),或者我可以在读取文件时检索它

目前,用户通过外部程序在本地添加签名,然后通过应用程序将文件上载到服务器,并使用pycrypto对其进行加密

可以在加密之前读取文件的过程中检索这些信息吗?我该怎么做

下面是我用来加密文件的代码:

encryptor = AES.new(key, AES.MODE_CBC, IV)

with open(filename, "rb") as infile:
  if not os.path.isfile(outFile):
    with open(outFile, "wb") as outfile:
      outfile.write(filesize)
      outfile.write(IV)
      while True:
       chunk = infile.read(chunksize)
       if len(chunk) == 0:
         break
       elif len(chunk)%16 !=0:
         chunk += ' ' * (16 - (len(chunk)%16))

       outfile.write(encryptor.encrypt(chunk))

这正是我要寻找的,我检查了PyPDF2等python PDF库并阅读了AdobeAcrobat SDK文档,但仍然一无所获。我想这是一种方式,但我无法获得这些信息。这正是我要寻找的,我检查了PyPDF2等python PDF库并阅读了AdobeAcrobat SDK文档但我还是一无所获。我想可爱是一种方式,但我无法获得这些信息。