Mobil Signature Client

Mobile Signature Client API takes place in infra module of ESYA Signature API. The only difference from other signature types is the use of mobile device instead of smartcard for cryptographic signature creation operation. The sample code below, creates a mobile signature at client side. Only the lines with gray color are different from normal signature creation operation.

BaseSignedData bs = new BaseSignedData(); 
bs.addContent(new SignableByteArray("test".getBytes())); 
				
HashMap<String, Object> params = new HashMap<String, Object>(); 
ValidationPolicy policy=  PolicyReader.readValidationPolicy(new FileInputStream(POLICY_FILE)); 
params.put(EParameters.P_CERT_VALIDATION_POLICY, policy);

MSSPClientConnector connector = null; //Create a communication interface for your system.
UserIdentifier user = new PhoneNumberAndOperator("05336564727", Operator.TURKCELL);
ECertificate cert = connector.getCertificates(user)[0];
BaseSigner mobileSigner = new MobileSigner(connector, user, cert, 
		"Doc1234 numaralı dökümanı imzayı onaylıyorum.", 
		Algorithms.SIGNATURE_RSA_SHA1, null);
		
bs.addSigner(ESignatureType.TYPE_BES, cert , mobileSigner, null, params);
//write the contentinfo to file 
AsnIO.dosyayaz(bs.getEncoded(),SIGNATURE_FILE);	

The communication between the client and the server is provided by the interface MSSPClientConnector. The information needed by the server API is sent via this interface. Since the communication technology may change from client to client, here , only an interface is defined. API users must implement this interface according to their own system and communication channels.