Community articlegetIssuer method
Added by IBM contributorIBM on May 2, 2012
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

No abstract provided.


This method extracts the issuer certificate from the certificate provided.


   public Certificate getIssuer(
      IntHolder theStatus
      ) throws UWIException;


Table 1. Method parameters
theStatusIntHolderA holder that is set with the status of the operation. This will be one of the following:
SecurityUserStatusType.SUSTATUS_OK — The operation was successful.
SecurityUserStatusType.SUSTATUS_ CANCELLED— the operation was cancelled by the user.
SecurityUserStatusType.SUSTATUS_INPUT_ REQUIRED — the operation required user input, but could not receive it (for example, it was run on a server with no user).


The issuer certificate.


When you are finished with a Certificate object and the HardGCFlag is false, you must call the object's release method. This will allow the memory that it occupied to be collected during normal JVM garbage collection. It is safe to call release when the HardGCFlag is true. See setHardGCFlag method of the DTK class for more information.


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. */
         /* 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 = issuerCert;

Parent topic:
Certificate class