class CertInformationHelper
{
    private static final Logger LOG = LogManager.getLogger(CertInformationHelper.class);

    private CertInformationHelper()
    {
    }

    /**
     * Gets the SHA-1-Hash has of given byte[]-content.
     * 
     * @param content to be hashed
     * @return SHA-1 hash String
     */
    protected static String getSha1Hash(byte[] content)
    {
        try
        {
            MessageDigest md = MessageDigest.getInstance("SHA-1");
            return Hex.getString(md.digest(content));
        }
        catch (NoSuchAlgorithmException e)
        {
            LOG.error("No SHA-1 Algorithm found", e);
        }
        return null;
    }

    /**
     * Extracts authority information access extension values from the given data. The Data
     * structure has to be implemented as described in RFC 2459, 4.2.2.1.
     *
     * @param extensionValue byte[] of the extension value.
     * @param certInfo where to put the found values
     * @throws IOException when there is a problem with the extensionValue
     */
    protected static void getAuthorityInfoExtensionValue(byte[] extensionValue,
            CertSignatureInformation certInfo) throws IOException
    {
        ASN1Sequence asn1Seq = (ASN1Sequence) JcaX509ExtensionUtils.parseExtensionValue(extensionValue);
        Enumeration<?> objects = asn1Seq.getObjects();
        while (objects.hasMoreElements())
        {
            // AccessDescription
            ASN1Sequence obj = (ASN1Sequence) objects.nextElement();
            ASN1Encodable oid = obj.getObjectAt(0);
            // accessLocation
            ASN1TaggedObject location = (ASN1TaggedObject) obj.getObjectAt(1);

            if (X509ObjectIdentifiers.id_ad_ocsp.equals(oid)
                    && location.getTagNo() == GeneralName.uniformResourceIdentifier)
            {
                ASN1OctetString url = (ASN1OctetString) location.getBaseObject();
                certInfo.setOcspUrl(new String(url.getOctets()));
            }
            else if (X509ObjectIdentifiers.id_ad_caIssuers.equals(oid))
            {
                ASN1OctetString uri = (ASN1OctetString) location.getBaseObject();
                certInfo.setIssuerUrl(new String(uri.getOctets()));
            }
        }
    }

    /**
     * Gets the first CRL URL from given extension value. Structure has to be
     * built as in 4.2.1.14 CRL Distribution Points of RFC 2459.
     *
     * @param extensionValue to get the extension value from
     * @return first CRL- URL or null
     * @throws IOException when there is a problem with the extensionValue
     */
    protected static String getCrlUrlFromExtensionValue(byte[] extensionValue) throws IOException
    {
        ASN1Sequence asn1Seq = (ASN1Sequence) JcaX509ExtensionUtils.parseExtensionValue(extensionValue);
        Enumeration<?> objects = asn1Seq.getObjects();

        while (objects.hasMoreElements())
        {
            Object obj = objects.nextElement();
            if (obj instanceof ASN1Sequence)
            {
                String url = extractCrlUrlFromSequence((ASN1Sequence) obj);
                if (url != null)
                {
                    return url;
                }
            }
        }
        return null;
    }

    private static String extractCrlUrlFromSequence(ASN1Sequence sequence)
    {<FILL_FUNCTION_BODY>}
}

        ASN1TaggedObject taggedObject = (ASN1TaggedObject) sequence.getObjectAt(0);
        taggedObject = (ASN1TaggedObject) taggedObject.getBaseObject();
        if (taggedObject.getBaseObject() instanceof ASN1TaggedObject)
        {
            taggedObject = (ASN1TaggedObject) taggedObject.getBaseObject();
        }
        else if (taggedObject.getBaseObject() instanceof ASN1Sequence)
        {
            // multiple URLs (we take the first)
            ASN1Sequence seq = (ASN1Sequence) taggedObject.getBaseObject();
            if (seq.getObjectAt(0) instanceof ASN1TaggedObject)
            {
                taggedObject = (ASN1TaggedObject) seq.getObjectAt(0);
            }
            else
            {
                return null;
            }
        }
        else
        {
            return null;
        }
        if (taggedObject.getBaseObject() instanceof ASN1OctetString)
        {
            ASN1OctetString uri = (ASN1OctetString) taggedObject.getBaseObject();
            String url = new String(uri.getOctets());

            // return first http(s)-Url for crl
            if (url.startsWith("http"))
            {
                return url;
            }
        }
        // else happens with http://blogs.adobe.com/security/SampleSignedPDFDocument.pdf
        return null;
    
<no_super_class>