Community articlegetSigningCert method
Added by IBM contributorIBM on July 26, 2013
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

Description

This method retrieves the signing certificate from a signature object.

Method

   public Certificate getSigningCert() throws UWIException;


Parameters

There are no parameters for this method.

Returns

The signing certificate.

Example

The following example gets the signing certificate from a signature object, then iterates through the certificate issuers until it reaches the end of the chain. During the iteration, each certificate is passed to a method that processes them.
   public void processCertChain(Signature theSig)
   {
   Certificate theCert, issuerCert;
   IntHolder theStatus;
 
      /* Get the signing certificate from the signature. */
 
      theCert = theSig.getSigningCert();
 
      /* Loop through the certificate chain, passing each certificate to the 
         ProcessCert function. The loop ends when the issuer certificate is 
         null. */
   
      while (theCert != null)
      {
   
         /* Pass the certificate to the processCert method.  Note that 
            this is not an API method, but rather a method you would 
            write to process the certificate in some way. */
 
         ProcessCert(theCert);
 
         /* Get the issuer certificate from theCert. */
 
         issuerCert = theCert.getIssuer(theStatus);
      
         /* Check to ensure the method exited with the correct status. */
 
         if (theStatus.value != SecurityUserStatusType.SUSTATUS_OK)
         {
            throw new UWIException("getBlob exited with the wrong status.");
         }
   
         /* Assign theCert to equal the issuerCert for next iteration of the 
            loop. */
 
         theCert.release();
         theCert = issuerCert;
      }
      return(OK);
   }


Parent topic:
Signature class