private CachedEncoding GetCachedEncoding()
        {
            lock (cacheLock)
            {
                if (null != cachedEncoding)
                {
                    return(cachedEncoding);
                }
            }

            byte[]       encoding  = null;
            CrlException exception = null;

            try
            {
                encoding = c.GetEncoded(Asn1Encodable.Der);
            }
            catch (IOException e)
            {
                exception = new CrlException("Failed to DER-encode CRL", e);
            }

            CachedEncoding temp = new CachedEncoding(encoding, exception);

            lock (cacheLock)
            {
                if (null == cachedEncoding)
                {
                    cachedEncoding = temp;
                }

                return(cachedEncoding);
            }
        }
 internal CachedEncoding(byte[] encoding, CrlException exception)
 {
     this.encoding  = encoding;
     this.exception = exception;
 }