当前位置: 首页>>代码示例>>Python>>正文


Python pdfencrypt.hexText函数代码示例

本文整理汇总了Python中reportlab.lib.pdfencrypt.hexText函数的典型用法代码示例。如果您正苦于以下问题:Python hexText函数的具体用法?Python hexText怎么用?Python hexText使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了hexText函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: testStdEnc

def testStdEnc(
    expectedO, expectedU, expectedKey, strength=40, overrideID="xxxxxxxxxxxxxxxx", userPass="User", ownerPass="Owner"
):
    # do a 40 bit example known to work in Acrobat Reader 4.0
    enc = pdfencrypt.StandardEncryption(userPass, ownerPass, strength=strength)
    enc.setAllPermissions(0)
    enc.canPrint = 1
    enc.prepare(None, overrideID)

    pdfencrypt.equalityCheck(pdfencrypt.hexText(enc.O), expectedO, "%d bit O value" % strength)
    pdfencrypt.equalityCheck(pdfencrypt.hexText(enc.U), expectedU, "%d bit U value" % strength)
    pdfencrypt.equalityCheck(pdfencrypt.hexText(enc.key), expectedKey, "%d bit key value" % strength)
开发者ID:FatihZor,项目名称:infernal-twin,代码行数:12,代码来源:test_lib_pdfencrypt.py

示例2: checkEncryptionKey128Bit

 def checkEncryptionKey128Bit(self):
     userPass = 'userpass'
     ownerHash = unHexText('<68E5704AC779A5F0CD89704406587A52F25BF61CADC56A0F8DB6C4DB0052534D>')
     documentID = 'xxxxxxxxxxxxxxxx'        
     permissions = -4
     encKey = encryptionkey(userPass, ownerHash, permissions, documentID, revision=3)
     assert hexText(encKey) == '<13DDE7585D9BE366C976DDD56AF541D1>'
开发者ID:Jbaumotte,项目名称:web2py,代码行数:7,代码来源:test_crypto_algorithms.py

示例3: checkEncryptionKey40Bit

 def checkEncryptionKey40Bit(self):
     userPass = 'userpass'
     ownerHash = unHexText('<F86213EB0CED81F097947F3B343E34CAC8CA92CE8F6FEE2556FA31EC1FE968AF>')
     documentID = 'xxxxxxxxxxxxxxxx'        
     permissions = -4
     encKey = encryptionkey(userPass, ownerHash, permissions, documentID, revision=2)
     assert hexText(encKey) == '<7EBBD07A88>'
开发者ID:Jbaumotte,项目名称:web2py,代码行数:7,代码来源:test_crypto_algorithms.py

示例4: checkEncryptString128Bit

 def checkEncryptString128Bit(self):
     assert hexText(encodePDF(unHexText('<3C0C5EBE0122D8EB2BDDF8A09FA8E29E>'),
                              9,
                              0,
                              'anonymous')
                    ) == '<27FB3E943FCF61878B>'
开发者ID:Jbaumotte,项目名称:web2py,代码行数:6,代码来源:test_crypto_algorithms.py

示例5: checkUserHash128Bit

 def checkUserHash128Bit(self):
     encKey = unHexText('<13DDE7585D9BE366C976DDD56AF541D1>')
     userHash = computeU(encKey, revision=3, documentId='xxxxxxxxxxxxxxxx')
     assert hexText(userHash) == '<A9AE45CDE827FE0B7D6536267948836A00000000000000000000000000000000>'
开发者ID:Jbaumotte,项目名称:web2py,代码行数:4,代码来源:test_crypto_algorithms.py

示例6: check0wnerHash128Bit

 def check0wnerHash128Bit(self):
     "owner key calculation"
     ownerHash = computeO('userpass','ownerpass', revision=3)
     assert hexText(ownerHash) == '<68E5704AC779A5F0CD89704406587A52F25BF61CADC56A0F8DB6C4DB0052534D>'
开发者ID:Jbaumotte,项目名称:web2py,代码行数:4,代码来源:test_crypto_algorithms.py

示例7: checkEncryptString40Bit

 def checkEncryptString40Bit(self):
     assert hexText(encodePDF(unHexText('<3DC3EBDA71>'), 9, 0, 'anonymous')) == '<57AC33DDEB5775982A>'
开发者ID:Jbaumotte,项目名称:web2py,代码行数:2,代码来源:test_crypto_algorithms.py

示例8: checkUserHash40Bit

 def checkUserHash40Bit(self):
     encKey = unHexText('<7EBBD07A88>')
     userHash = computeU(encKey, revision=2, documentId='xxxxxxxxxxxxxxxx')
     assert hexText(userHash) == '<AA154131D8FA105317F7104D2001A345D78A3DEEFA3D85D032FC9B4B35DA72A0>'
开发者ID:Jbaumotte,项目名称:web2py,代码行数:4,代码来源:test_crypto_algorithms.py

示例9: check0wnerHash40Bit

 def check0wnerHash40Bit(self):
     "owner key calculation"
     ownerHash = computeO('userpass','ownerpass', revision=2)
     assert hexText(ownerHash) == '<F86213EB0CED81F097947F3B343E34CAC8CA92CE8F6FEE2556FA31EC1FE968AF>'
开发者ID:Jbaumotte,项目名称:web2py,代码行数:4,代码来源:test_crypto_algorithms.py


注:本文中的reportlab.lib.pdfencrypt.hexText函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。