-
-
Save marcodebe/6138525 to your computer and use it in GitHub Desktop.
| from zeep import Client | |
| import sys | |
| import os | |
| # WSDL = 'https://arss.arubapec.it/ArubaSignService/ArubaSignService?wsdl' | |
| # Se il servizio ATP è installato sul proprio server mio.server.example.org: | |
| WSDL = 'https://mio.server.example.org/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( | |
| certID="AS0", | |
| 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) | |
| outputfile = open(output, 'wb') | |
| outputfile.write(response.binaryoutput) |
ciao. ho visto che in realtà andrebbe aggiunto anche questo parametro: certID='AS0', prima del gruppo identity.
Non mi è chiaro però se sia necessaria una abilitazione specifica per poter utilizzare questo servizio. con la firma aziendale ottengo sempre questo response:
response: {
'binaryoutput': None,
'description': 'Domain Not Allowed',
'dstPath': None,
'return_code': '0030',
'status': 'KO',
'stream': None
}
ciao. ho visto che in realtà andrebbe aggiunto anche questo parametro: certID='AS0'
Giusto, ho corretto.
Non mi è chiaro però se sia necessaria una abilitazione specifica per poter utilizzare questo servizio. con la firma aziendale ottengo sempre questo response: response: { 'binaryoutput': None, 'description': 'Domain Not Allowed', 'dstPath': None, 'return_code': '0030', 'status': 'KO', 'stream': None }
Il WSDL deve puntare al server aziendale dove è installato ATP.
Questa è l'unica cosa utile che si trova nel web riguardo Aruba. Grazie!