You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got this error while developing a digital signing application. I downgraded to version 0.6.0 and the error was gone but the signing result was not as I expected.
importioimportpkcs11frompkcs11importMechanism, Attributefrompkcs11importKeyTypefrompypdfimportPdfReader, PdfWriterfrompkcs11.typesimportPrivateKeyimportbase64# Path to your PKCS#11 libraryPKCS11_LIB='/usr/lib/viettel-ca_v6.so'# Load the PKCS#11 librarylib=pkcs11.lib(PKCS11_LIB)
# Open the first available slotslot=lib.get_slots(token_present=True)[0]
token=slot.get_token()
withtoken.open(user_pin='12345678') assession:
certificates=session.get_objects({pkcs11.Attribute.CLASS: pkcs11.ObjectClass.CERTIFICATE})
certs= [cforcincertificates]
cert=certs[-1]
der_cert=cert[pkcs11.Attribute.VALUE]
private_key= [keyforkeyinsession.get_objects(KeyType.RSA) ifisinstance(key, PrivateKey)][1]
signature=private_key.sign('v2', mechanism=Mechanism.RSA_PKCS)
Hello.
I got this error while developing a digital signing application. I downgraded to version
0.6.0
and the error was gone but the signing result was not as I expected.PIP:
My Code:
OS: Ubuntu 20.04, 16GB RAM
The text was updated successfully, but these errors were encountered: