예제 #1
0
  /** return the issuer of the given CRL as an X509PrincipalObject. */
  public static X509Principal getIssuerX509Principal(X509CRL crl) throws CRLException {
    try {
      TBSCertList tbsCertList =
          TBSCertList.getInstance(ASN1Object.fromByteArray(crl.getTBSCertList()));

      return new X509Principal(tbsCertList.getIssuer());
    } catch (IOException e) {
      throw new CRLException(e.toString());
    }
  }
예제 #2
0
 /**
  * Return an interned X509CRLImpl for the given certificate. For more information, see
  * intern(X509Certificate).
  */
 public static synchronized X509CRLImpl intern(X509CRL c) throws CRLException {
   if (c == null) {
     return null;
   }
   boolean isImpl = c instanceof X509CRLImpl;
   byte[] encoding;
   if (isImpl) {
     encoding = ((X509CRLImpl) c).getEncodedInternal();
   } else {
     encoding = c.getEncoded();
   }
   X509CRLImpl newC = getFromCache(crlCache, encoding);
   if (newC != null) {
     return newC;
   }
   if (isImpl) {
     newC = (X509CRLImpl) c;
   } else {
     newC = new X509CRLImpl(encoding);
     encoding = newC.getEncodedInternal();
   }
   addToCache(crlCache, encoding, newC);
   return newC;
 }