Getting information about a particular signing set

Use getSigningSetDetails to retrieve information about a particular signing set.

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");

SigningSetDetailsRequestType signingSetDetails = new SigningSetDetailsRequestType();
signingSetDetails.setAuthToken(authToken);
signingSetDetails.setSigningSetID(1004);
signingSetDetails.setReturnApplication(true);
signingSetDetails.setReturnCertificateChain(true);

SigningSetDetailsResponseType response;
try {
    SigningProxy request = new SigningProxy();
    response = request.getSigningSetDetails(signingSetDetails);
    
    //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!");
        String[] ssCerts = response.getCertificateInfo().getSigningCertificates();
        SigningSet signingSet = response.getSigningSet();
        if(ssCerts!=null){
            System.out.println("Signing Certificate");
            System.out.println("--------------------");
            for (int i = 0; i < ssCerts.length; i++) {
                System.out.println(ssCerts[i]);
            }                    
        }

        System.out.println("Application Name: " +  
          signingSet.getApplicationName());
        System.out.println("Application Version: " +  
          signingSet.getApplicationVersion());
        System.out.println("Signed Application: " +  
          signingSet.getSignedApplication());
        System.out.println("Signed Errorcode: " +  
          signingSet.getSigningErrorCode());
        System.out.println("Signing Service Name: " +  
          signingSet.getSigningServiceName());
        System.out.println("Status: " +  
          signingSet.getSigningSetStatus());
        System.out.println("Test house status: " + signingSet.getTestHouseStatus());
        System.out.println("Unsigned Application: " + signingSet.getUnsignedApplication());
        System.out.println("Publisher ID: " + signingSet.getPublisherID());
        System.out.println("Creation date: " + signingSet.getCreationDate().toString());
    } 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";
SigningSetDetailsRequestType signingSetDetails = new SigningSetDetailsRequestType();
signingSetDetails.authToken = authToken;
signingSetDetails.signingSetID = 1004;
signingSetDetails.returnApplication = true;
signingSetDetails.returnCertificateChain = true;

SigningSetDetailsResponseType response;

try
{
    response = signingService.getSigningSetDetails(signingSetDetails);

    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 the signing set details
        Console.WriteLine("Success!");
        String[] ssCerts = response.certificateInfo.signingCertificates;
        SigningSet signingSet = response.signingSet;
        if (ssCerts != null)
        {
            Console.WriteLine("Signing Certificate");
            Console.WriteLine("--------------------");
            for (int i = 0; i < ssCerts.Length; i++)
            {
                Console.WriteLine(ssCerts[i]);
            }
        }
        Console.WriteLine("Application Name: " + signingSet.applicationName);
        Console.WriteLine("Application Version: " + signingSet.applicationVersion);
        Console.WriteLine("Signed Application: " + signingSet.signedApplication);
        Console.WriteLine("Signed Errorcode: " + signingSet.signingErrorCode);
        Console.WriteLine("Signing Service Name: " + signingSet.signingServiceName);
        Console.WriteLine("Status: " + signingSet.signingSetStatus);
        Console.WriteLine("Test house status: " + signingSet.testHouseStatus);
        Console.WriteLine("Unsigned Application: " + signingSet.unsignedApplication);
        Console.WriteLine("Publisher ID: " + signingSet.publisherID);
        Console.WriteLine("Creation date: " + signingSet.creationDate.ToString());
    }
    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.