We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d3320b0 commit 7f244bfCopy full SHA for 7f244bf
samples/sandbox/signatures/fips.py
@@ -21,6 +21,7 @@
21
from itextpy.util import disposing
22
23
from pathlib import Path
24
+import sys
25
26
from utils import PemFileHelper
27
@@ -39,7 +40,13 @@
39
40
41
42
def manipulate_pdf(dest):
- CryptoServicesRegistrar.SetApprovedOnlyMode(True)
43
+ try:
44
+ CryptoServicesRegistrar.SetApprovedOnlyMode(True)
45
+ except AttributeError:
46
+ print('signatures/fips.py sample requires '
47
+ 'itext.bouncy-castle-fips-adapter, '
48
+ 'skipping...', file=sys.stderr)
49
+ return
50
chain = PemFileHelper.read_first_chain(SIGN_CERT_PATH)
51
private_key = PemFileHelper.read_first_key(SIGN_CERT_PATH, PASSWORD)
52
pk = PrivateKeySignature(private_key, DigestAlgorithms.SHA3_512)
0 commit comments