Skip to content

Instantly share code, notes, and snippets.

@marcodebe
Last active November 7, 2025 20:42
Show Gist options
  • Select an option

  • Save marcodebe/6138525 to your computer and use it in GitHub Desktop.

Select an option

Save marcodebe/6138525 to your computer and use it in GitHub Desktop.
Example of remote sign using Aruba services. The example creates a signed PDF document.
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)
@svetj
Copy link

svetj commented Nov 7, 2025

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
}

@marcodebe
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment