Getting information about a particular signing service

Use getSigningServiceDetails to get a line of signing service IDs associated with your workgroup.

Java
//add your client certificate
System.setProperty("javax.net.ssl.keyStoreType", "PKCS12");
System.setProperty("javax.net.ssl.keyStore", "C:\\\\Program Files\\\\Java\\\\jdk1.8.0_25\\\\bin\\\\sas_keystore.p12");
System.setProperty("javax.net.ssl.keyStorePassword", "yourPassword");

//specify your partner code, username, and password
AuthToken authToken = new AuthToken();
authToken.setPartnerCode("partner code");
authToken.setUserName("user name");
authToken.setPassword("password");

SigningServiceDetailsRequestType signingServiceDetails = 
  new SigningServiceDetailsRequestType();
signingServiceDetails.setAuthToken(authToken);
signingServiceDetails.setSigningServiceID(12);


SigningServiceDetailsResponseType response;
try {
    SigningProxy request = new SigningProxy();
    response = request.getSigningServiceDetails(signingServiceDetails);
    
    //get the result code
    System.out.println("Result code: \\t" + response.getResult().getResultCode());
    
    //if the request is successful with or without warnings
    if (response.getResult().getResultCode() >= 0) {
        try {
            //list errors, if present
            Error[] error = response.getResult().getErrors();
            for (Error err : error) {
                if (!err.getErrorMessage().isEmpty()) {
                    System.err.println("Warning: " + err.getErrorMessage() + " Field: " + err.getErrorField());
                }
            }
        }
        catch (Exception e) {}
        
        //Print success message, other details
        System.out.println("Success!");
        System.out.println("Signing Service Name: " +  
          response.getSigningService().getSigningServiceName());
        System.out.println("Signing Service Platform: " + response.getSigningService().getSigningServicePlatform());
        System.out.println("Signing Service Testing Req: " + response.getSigningService().getSigningServiceTestingReq());
        System.out.println("Signing Service Type: " + response.getSigningService().getSigningServiceType());
        System.out.println("Certificate Friendly Name: " + response.getSigningService().getSigningCertificateInfo().getPreferredCertificateFriendlyName());
        System.out.println("Hash Algorithm: " + response.getSigningService().getTimestampServiceDetails().getHashAlgorithm());
        System.out.println("Timestamp Type: " + response.getSigningService().getTimestampServiceDetails().getTimestampType());
    } else {
        //if the request failed, list any errors
        try {
            //list errors, if present
            Error[] error = response.getResult().getErrors();
            for (Error err : error) {
                if (!err.getErrorMessage().isEmpty()) {
                    System.err.println("Warning: " + err.getErrorMessage() + " Field: " + err.getErrorField());
                }
            }
        }
        catch (Exception e) {
            System.out.println("Error while reading request details");
        }
    }
}
catch (Exception e) {}
C#
//create the service object
SigningService signingService = new SigningService();

//add client cert for two-factor-authentication
string clientCertPath = "C:\\\\Users\\\\Administrator\\\\Desktop\\\\sas_pfx.pfx";
string clientCertPassword = "yourPassword";
X509Certificate2 clientCert = new X509Certificate2(clientCertPath, clientCertPassword);
signingService.ClientCertificates.Add(clientCert);

//add your username, password, and partnercode
AuthToken authToken = new AuthToken();
authToken.partnerCode = "partner code";
authToken.userName = "username";
authToken.password = "password";
SigningServiceDetailsRequestType signingServiceDetails = 
  new SigningServiceDetailsRequestType();
signingServiceDetails.authToken = authToken;
signingServiceDetails.signingServiceID = 1545;

SigningServiceDetailsResponseType response;

try
{
    response = signingService.getSigningServiceDetails(signingServiceDetails);

    Console.WriteLine("Result code: " + response.result.resultCode);

    if (response.result.resultCode >= 0)
    {
        try
        {
            Error[] errors = response.result.errors;
            foreach (Error error in errors)
            {
                if (error.errorMessage.Length > 0)
                {
                    Console.WriteLine("Warning: " + error.errorMessage + " Field: " + error.errorField);
                }
            }
        }
        catch (Exception e) { }

        //Print signing service details
        Console.WriteLine("Success!");
        Console.WriteLine("Signing Service Name: " + response.signingService.signingServiceName);
        Console.WriteLine("Signing Service Platform: " + response.signingService.signingServicePlatform);
        Console.WriteLine("Signing Service Testing Req: " + response.signingService.signingServiceTestingReq);
        Console.WriteLine("Signing Service Type: " + response.signingService.signingServiceType1);
        Console.WriteLine("Certificate Friendly Name: " + response.signingService.signingCertificateInfo.preferredCertificateFriendlyName);
        Console.WriteLine("Hash Algorithm: " + response.signingService.timestampServiceDetails.hashAlgorithm);
        Console.WriteLine("Timestamp Type: " +  
          response.signingService.timestampServiceDetails.timestampType);
    }
    else
    {
        try
        {
            //list errors, if present
            Error[] errors = response.result.errors;
            foreach (Error error in errors)
            {
                if (error.errorMessage.Length > 0)
                {
                    Console.WriteLine("Warning: " + error.errorMessage + " Field: " + error.errorField);
                }
            }
        }
        catch (Exception e)
        {
            Console.WriteLine("Error while reading request details: " + e.InnerException.Message);
        }
    }
}
catch (Exception e) { }

We use cookies to ensure that we give you the best experience on our website. By using this site, you agree to the Terms of Service.