Last active June 30, 2025 15:40
-
-
Save marcodebe/6138525 to your computer and use it in GitHub Desktop.
Revisions
-
marcodebe revised this gist
Nov 30, 2024 . No changes.There are no files selected for viewing
-
marcodebe revised this gist
Nov 30, 2024 . No changes.There are no files selected for viewing
-
marcodebe revised this gist
Nov 25, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import sys import os WSDL = 'https://arss.arubapec.it/ArubaSignService/ArubaSignService?wsdl' document = sys.argv[1] otp = sys.argv[2] -
marcodebe revised this gist
Apr 23, 2019 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,13 +12,13 @@ sign_request = factory.signRequestV2( requiredmark=True, transport='BYNARYNET', binaryinput=open(document, 'rb').read(), identity=factory.auth( user='username', userPWD=3141592653, typeHSM='cosign', typeOtpAuth='frAzienda', otpPwd=otp )) response = client.service.pdfsignatureV2(SignRequestV2=sign_request) -
marcodebe renamed this gist
Apr 23, 2019 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
marcodebe revised this gist
Apr 23, 2019 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,12 @@ from zeep import Client import sys import os WSDL = 'https://firmaautomatica.aruba.it/ArubaSignService/ArubaSignService?WSDL' document = sys.argv[1] otp = sys.argv[2] output = '.signed'.join(os.path.splitext(document)) client = Client(WSDL) factory = client.type_factory('ns0') sign_request = factory.signRequestV2( @@ -18,5 +22,5 @@ sign_request = factory.signRequestV2( )) response = client.service.pdfsignatureV2(SignRequestV2=sign_request) outputfile = open(output, 'wb') outputfile.write(response.binaryoutput) -
marcodebe revised this gist
Apr 23, 2019 . 1 changed file with 20 additions and 42 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,44 +1,22 @@ from zeep import Client import sys WSDL = 'https://firmaautomatica.aruba.it/ArubaSignService/ArubaSignService?WSDL' client = Client(WSDL) factory = client.type_factory('ns0') sign_request = factory.signRequestV2( requiredmark=True, transport='BYNARYNET', binaryinput=open(sys.argv[1], 'rb').read(), identity=factory.auth( user='username', userPWD=3141592653, typeHSM='cosign', typeOtpAuth='frAzienda', otpPwd=sys.argv[2] )) response = client.service.pdfsignatureV2(SignRequestV2=sign_request) outputfile = open('output.pdf', 'wb') outputfile.write(response.binaryoutput) -
marcodebe revised this gist
Mar 28, 2014 . 1 changed file with 4 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -27,13 +27,11 @@ def pades(data): request.certID = 'FOO' request.binaryinput = data.encode('base64') request.transport.value = 'BYNARYNET' # With timestamp request.requiredmark = True response = client.service.pdfsignatureV2(request) if response.status == "OK": return response.binaryoutput.decode('base64') -
marcodebe revised this gist
Aug 2, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -24,7 +24,7 @@ def pades(data): request = client.factory.create('SignRequestV2') request.identity = identity request.certID = 'FOO' request.binaryinput = data.encode('base64') request.transport.value = 'BYNARYNET' -
marcodebe revised this gist
Aug 2, 2013 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,7 +18,7 @@ identity.otpPwd = sys.argv[1] def pades(data): """ Sign the document. :param data: PDF to be signed :returns: PDF signed """" @@ -40,7 +40,7 @@ def pades(data): def main(): signme = open('input.pdf', 'r') outputfile = open('output.pdf', 'w') outputfile.write(pades(signme.read())) outputfile.close() -
marcodebe revised this gist
Aug 2, 2013 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,6 +16,11 @@ identity.otpPwd = sys.argv[1] def pades(data): """ Sign the document. :param data: base64 of PDF to be signed :returns: PDF signed """" request = client.factory.create('SignRequestV2') request.identity = identity -
marcodebe revised this gist
Aug 2, 2013 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -36,7 +36,6 @@ def pades(data): def main(): encodeme = open('input.pdf', 'r') outputfile = open('output.pdf', 'w') outputfile.write(pades(encodeme.read())) outputfile.close() -
marcodebe revised this gist
Aug 2, 2013 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,6 +11,7 @@ identity.typeOtpAuth = 'firma' identity.user = 'username' identity.userPWD = 'password' # Get the OTP from stdin identity.otpPwd = sys.argv[1] -
marcodebe created this gist
Aug 2, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,41 @@ from suds.client import Client from hashlib import sha256 import sys url = 'https://firmaautomatica.aruba.it/ArubaSignService/ArubaSignService?WSDL' client = Client(url) identity = client.factory.create('identity') identity.typeHSM = 'COSIGN' identity.typeOtpAuth = 'firma' identity.user = 'username' identity.userPWD = 'password' identity.otpPwd = sys.argv[1] def pades(data): request = client.factory.create('SignRequestV2') request.identity = identity request.certID = 'AS0' request.binaryinput = data.encode('base64') request.transport.value = 'BYNARYNET' app = client.factory.create('pdfSignApparence') app.location = "Bogliasco - Genova" app.reason = "No reason" app.page = 1 response = client.service.pdfsignatureV2(request, app) if response.status == "OK": return response.binaryoutput.decode('base64') def main(): encodeme = open('input.pdf', 'r') outputfile = open('output.pdf', 'w') outputfile.write(pades(encodeme.read())) outputfile.close()