当前位置: 首页>>代码示例>>Java>>正文


Java TBSCertList.CRLEntry方法代码示例

本文整理汇总了Java中org.bouncycastle.asn1.x509.TBSCertList.CRLEntry方法的典型用法代码示例。如果您正苦于以下问题:Java TBSCertList.CRLEntry方法的具体用法?Java TBSCertList.CRLEntry怎么用?Java TBSCertList.CRLEntry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.bouncycastle.asn1.x509.TBSCertList的用法示例。


在下文中一共展示了TBSCertList.CRLEntry方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getRevokedCertificate

import org.bouncycastle.asn1.x509.TBSCertList; //导入方法依赖的package包/类
public X509CRLEntryHolder getRevokedCertificate(BigInteger serialNumber)
{
    GeneralNames currentCA = issuerName;
    for (Enumeration en = x509CRL.getRevokedCertificateEnumeration(); en.hasMoreElements();)
    {
        TBSCertList.CRLEntry entry = (TBSCertList.CRLEntry)en.nextElement();

        if (entry.getUserCertificate().getValue().equals(serialNumber))
        {
            return new X509CRLEntryHolder(entry, isIndirect, currentCA);
        }

        if (isIndirect && entry.hasExtensions())
        {
            Extension currentCaName = entry.getExtensions().getExtension(Extension.certificateIssuer);

            if (currentCaName != null)
            {
                currentCA = GeneralNames.getInstance(currentCaName.getParsedValue());
            }
        }
    }

    return null;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:26,代码来源:X509CRLHolder.java

示例2: getRevokedCertificates

import org.bouncycastle.asn1.x509.TBSCertList; //导入方法依赖的package包/类
/**
 * Return a collection of X509CRLEntryHolder objects, giving the details of the
 * revoked certificates that appear on this CRL.
 *
 * @return the revoked certificates as a collection of X509CRLEntryHolder objects.
 */
public Collection getRevokedCertificates()
{
    TBSCertList.CRLEntry[] entries = x509CRL.getRevokedCertificates();
    List l = new ArrayList(entries.length);
    GeneralNames currentCA = issuerName;

    for (Enumeration en = x509CRL.getRevokedCertificateEnumeration(); en.hasMoreElements();)
    {
        TBSCertList.CRLEntry entry = (TBSCertList.CRLEntry)en.nextElement();
        X509CRLEntryHolder crlEntry = new X509CRLEntryHolder(entry, isIndirect, currentCA);

        l.add(crlEntry);

        currentCA = crlEntry.getCertificateIssuer();
    }

    return l;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:25,代码来源:X509CRLHolder.java

示例3: loadCRLEntries

import org.bouncycastle.asn1.x509.TBSCertList; //导入方法依赖的package包/类
private Set loadCRLEntries()
{
    Set entrySet = new HashSet();
    Enumeration certs = c.getRevokedCertificateEnumeration();

    X500Name previousCertificateIssuer = null; // the issuer
    while (certs.hasMoreElements())
    {
        TBSCertList.CRLEntry entry = (TBSCertList.CRLEntry)certs.nextElement();
        X509CRLEntryObject crlEntry = new X509CRLEntryObject(entry, isIndirect, previousCertificateIssuer);
        entrySet.add(crlEntry);
        if (isIndirect && entry.hasExtensions())
        {
            Extension currentCaName = entry.getExtensions().getExtension(Extension.certificateIssuer);

            if (currentCaName != null)
            {
                previousCertificateIssuer = X500Name.getInstance(GeneralNames.getInstance(currentCaName.getParsedValue()).getNames()[0].getName());
            }
        }
    }

    return entrySet;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:25,代码来源:X509CRLObject.java

示例4: getRevokedCertificate

import org.bouncycastle.asn1.x509.TBSCertList; //导入方法依赖的package包/类
public X509CRLEntry getRevokedCertificate(BigInteger serialNumber)
{
	TBSCertList.CRLEntry[] certs = c.getRevokedCertificates();

	if ( certs != null )
	{
		for ( int i = 0; i < certs.length; i++ )
		{
			if ( certs[i].getUserCertificate().getValue().equals(serialNumber) ) {
				return new X509CRLEntryObject(certs[i]);
			}
		}
	}

	return null;
}
 
开发者ID:thangbn,项目名称:Direct-File-Downloader,代码行数:17,代码来源:X509CRLObject.java

示例5: getRevokedCertificates

import org.bouncycastle.asn1.x509.TBSCertList; //导入方法依赖的package包/类
public Set getRevokedCertificates()
{
	TBSCertList.CRLEntry[] certs = c.getRevokedCertificates();

	if ( certs != null )
	{
		HashSet set = new HashSet();
		for ( int i = 0; i < certs.length; i++ )
		{
			set.add(new X509CRLEntryObject(certs[i]));

		}

		return set;
	}

	return null;
}
 
开发者ID:thangbn,项目名称:Direct-File-Downloader,代码行数:19,代码来源:X509CRLObject.java

示例6: isRevoked

import org.bouncycastle.asn1.x509.TBSCertList; //导入方法依赖的package包/类
/**
    * Checks whether the given certificate is on this CRL.
    *
    * @param cert the certificate to check for.
    * @return true if the given certificate is on this CRL,
    * false otherwise.
    */
   public boolean isRevoked(Certificate cert)
{
	if ( !cert.getType().equals("X.509") )
	{
		throw new RuntimeException("X.509 CRL used with non X.509 Cert");
	}

	TBSCertList.CRLEntry[] certs = c.getRevokedCertificates();

	if ( certs != null )
	{
		BigInteger serial = ((X509Certificate)cert).getSerialNumber();

		for ( int i = 0; i < certs.length; i++ )
		{
			if ( certs[i].getUserCertificate().getValue().equals(serial) )
			{
				return true;
			}
		}
	}

	return false;
}
 
开发者ID:thangbn,项目名称:Direct-File-Downloader,代码行数:32,代码来源:X509CRLObject.java

示例7: loadCRLEntries

import org.bouncycastle.asn1.x509.TBSCertList; //导入方法依赖的package包/类
private Set loadCRLEntries()
{
    Set entrySet = new HashSet();
    Enumeration certs = c.getRevokedCertificateEnumeration();

    X500Name previousCertificateIssuer = c.getIssuer();
    while (certs.hasMoreElements())
    {
        TBSCertList.CRLEntry entry = (TBSCertList.CRLEntry)certs.nextElement();
        X509CRLEntryObject crlEntry = new X509CRLEntryObject(entry, isIndirect, previousCertificateIssuer);
        entrySet.add(crlEntry);
        if (isIndirect && entry.hasExtensions())
        {
            Extension currentCaName = entry.getExtensions().getExtension(Extension.certificateIssuer);

            if (currentCaName != null)
            {
                previousCertificateIssuer = X500Name.getInstance(GeneralNames.getInstance(currentCaName.getParsedValue()).getNames()[0].getName());
            }
        }
    }

    return entrySet;
}
 
开发者ID:mlundblad,项目名称:bc-java,代码行数:25,代码来源:X509CRLObject.java

示例8: X509CRLEntryHolder

import org.bouncycastle.asn1.x509.TBSCertList; //导入方法依赖的package包/类
X509CRLEntryHolder(TBSCertList.CRLEntry entry, boolean isIndirect, GeneralNames previousCA)
{
    this.entry = entry;
    this.ca = previousCA;

    if (isIndirect && entry.hasExtensions())
    {
        Extension currentCaName = entry.getExtensions().getExtension(Extension.certificateIssuer);

        if (currentCaName != null)
        {
            ca = GeneralNames.getInstance(currentCaName.getParsedValue());
        }
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:16,代码来源:X509CRLEntryHolder.java

示例9: getRevokedCertificate

import org.bouncycastle.asn1.x509.TBSCertList; //导入方法依赖的package包/类
public X509CRLEntry getRevokedCertificate(BigInteger serialNumber)
{
    Enumeration certs = c.getRevokedCertificateEnumeration();

    X500Name previousCertificateIssuer = null; // the issuer
    while (certs.hasMoreElements())
    {
        TBSCertList.CRLEntry entry = (TBSCertList.CRLEntry)certs.nextElement();

        if (serialNumber.equals(entry.getUserCertificate().getValue()))
        {
            return new X509CRLEntryObject(entry, isIndirect, previousCertificateIssuer);
        }

        if (isIndirect && entry.hasExtensions())
        {
            Extension currentCaName = entry.getExtensions().getExtension(Extension.certificateIssuer);

            if (currentCaName != null)
            {
                previousCertificateIssuer = X500Name.getInstance(GeneralNames.getInstance(currentCaName.getParsedValue()).getNames()[0].getName());
            }
        }
    }

    return null;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:28,代码来源:X509CRLObject.java

示例10: getRevokedCertificate

import org.bouncycastle.asn1.x509.TBSCertList; //导入方法依赖的package包/类
public X509CRLEntry getRevokedCertificate(BigInteger serialNumber)
{
    Enumeration certs = c.getRevokedCertificateEnumeration();

    X500Name previousCertificateIssuer = c.getIssuer();
    while (certs.hasMoreElements())
    {
        TBSCertList.CRLEntry entry = (TBSCertList.CRLEntry)certs.nextElement();

        if (serialNumber.equals(entry.getUserCertificate().getValue()))
        {
            return new X509CRLEntryObject(entry, isIndirect, previousCertificateIssuer);
        }

        if (isIndirect && entry.hasExtensions())
        {
            Extension currentCaName = entry.getExtensions().getExtension(Extension.certificateIssuer);

            if (currentCaName != null)
            {
                previousCertificateIssuer = X500Name.getInstance(GeneralNames.getInstance(currentCaName.getParsedValue()).getNames()[0].getName());
            }
        }
    }

    return null;
}
 
开发者ID:mlundblad,项目名称:bc-java,代码行数:28,代码来源:X509CRLObject.java

示例11: isRevoked

import org.bouncycastle.asn1.x509.TBSCertList; //导入方法依赖的package包/类
/**
 * Checks whether the given certificate is on this CRL.
 *
 * @param cert the certificate to check for.
 * @return true if the given certificate is on this CRL,
 * false otherwise.
 */
public boolean isRevoked(Certificate cert)
{
    if (!cert.getType().equals("X.509"))
    {
        throw new RuntimeException("X.509 CRL used with non X.509 Cert");
    }

    TBSCertList.CRLEntry[] certs = c.getRevokedCertificates();

    X500Name caName = c.getIssuer();

    if (certs != null)
    {
        BigInteger serial = ((X509Certificate)cert).getSerialNumber();

        for (int i = 0; i < certs.length; i++)
        {
            if (isIndirect && certs[i].hasExtensions())
            {
                Extension currentCaName = certs[i].getExtensions().getExtension(Extension.certificateIssuer);

                if (currentCaName != null)
                {
                    caName = X500Name.getInstance(GeneralNames.getInstance(currentCaName.getParsedValue()).getNames()[0].getName());
                }
            }

            if (certs[i].getUserCertificate().getValue().equals(serial))
            {
                X500Name issuer;

                if (cert instanceof  X509Certificate)
                {
                    issuer = X500Name.getInstance(((X509Certificate)cert).getIssuerX500Principal().getEncoded());
                }
                else
                {
                    try
                    {
                        issuer = org.bouncycastle.asn1.x509.Certificate.getInstance(cert.getEncoded()).getIssuer();
                    }
                    catch (CertificateEncodingException e)
                    {
                        throw new RuntimeException("Cannot process certificate");
                    }
                }

                if (!caName.equals(issuer))
                {
                    return false;
                }

                return true;
            }
        }
    }

    return false;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:67,代码来源:X509CRLObject.java

示例12: X509CRLEntryObject

import org.bouncycastle.asn1.x509.TBSCertList; //导入方法依赖的package包/类
public X509CRLEntryObject(TBSCertList.CRLEntry c)
{
    this.c = c;
    this.certificateIssuer = null;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:6,代码来源:X509CRLEntryObject.java

示例13: X509CRLEntryObject

import org.bouncycastle.asn1.x509.TBSCertList; //导入方法依赖的package包/类
public X509CRLEntryObject(
	TBSCertList.CRLEntry c)
{
	this.c = c;
}
 
开发者ID:thangbn,项目名称:Direct-File-Downloader,代码行数:6,代码来源:X509CRLEntryObject.java

示例14: isRevoked

import org.bouncycastle.asn1.x509.TBSCertList; //导入方法依赖的package包/类
/**
 * Checks whether the given certificate is on this CRL.
 *
 * @param cert the certificate to check for.
 * @return true if the given certificate is on this CRL,
 * false otherwise.
 */
public boolean isRevoked(Certificate cert)
{
    if (!cert.getType().equals("X.509"))
    {
        throw new RuntimeException("X.509 CRL used with non X.509 Cert");
    }

    Enumeration certs = c.getRevokedCertificateEnumeration();

    X500Name caName = c.getIssuer();

    if (certs != null)
    {
        BigInteger serial = ((X509Certificate)cert).getSerialNumber();

        while (certs.hasMoreElements())
        {
            TBSCertList.CRLEntry entry = TBSCertList.CRLEntry.getInstance(certs.nextElement());

            if (isIndirect && entry.hasExtensions())
            {
                Extension currentCaName = entry.getExtensions().getExtension(Extension.certificateIssuer);

                if (currentCaName != null)
                {
                    caName = X500Name.getInstance(GeneralNames.getInstance(currentCaName.getParsedValue()).getNames()[0].getName());
                }
            }

            if (entry.getUserCertificate().getValue().equals(serial))
            {
                X500Name issuer;

                if (cert instanceof  X509Certificate)
                {
                    issuer = X500Name.getInstance(((X509Certificate)cert).getIssuerX500Principal().getEncoded());
                }
                else
                {
                    try
                    {
                        issuer = org.bouncycastle.asn1.x509.Certificate.getInstance(cert.getEncoded()).getIssuer();
                    }
                    catch (CertificateEncodingException e)
                    {
                        throw new RuntimeException("Cannot process certificate");
                    }
                }

                if (!caName.equals(issuer))
                {
                    return false;
                }

                return true;
            }
        }
    }

    return false;
}
 
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:69,代码来源:X509CRLObject.java

示例15: X509CRLEntryObject

import org.bouncycastle.asn1.x509.TBSCertList; //导入方法依赖的package包/类
protected X509CRLEntryObject(TBSCertList.CRLEntry c)
{
    this.c = c;
    this.certificateIssuer = null;
}
 
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:6,代码来源:X509CRLEntryObject.java


注:本文中的org.bouncycastle.asn1.x509.TBSCertList.CRLEntry方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。