⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 x509crlentryobject.java

📁 java 文件下载器。可自定义
💻 JAVA
字号:
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   X509CRLEntryObject.java

package org.bouncycastle.jce.provider;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.math.BigInteger;
import java.security.cert.CRLException;
import java.security.cert.X509CRLEntry;
import java.util.*;
import org.bouncycastle.asn1.*;
import org.bouncycastle.asn1.x509.*;

public class X509CRLEntryObject extends X509CRLEntry
{

	private org.bouncycastle.asn1.x509.TBSCertList.CRLEntry c;

	public X509CRLEntryObject(org.bouncycastle.asn1.x509.TBSCertList.CRLEntry c)
	{
		this.c = c;
	}

	public boolean hasUnsupportedCriticalExtension()
	{
		Set extns = getCriticalExtensionOIDs();
		return extns != null && !extns.isEmpty();
	}

	private Set getExtensionOIDs(boolean critical)
	{
		X509Extensions extensions = c.getExtensions();
		if (extensions != null)
		{
			HashSet set = new HashSet();
			Enumeration e = extensions.oids();
			do
			{
				if (!e.hasMoreElements())
					break;
				DERObjectIdentifier oid = (DERObjectIdentifier)e.nextElement();
				X509Extension ext = extensions.getExtension(oid);
				if (critical == ext.isCritical())
					set.add(oid.getId());
			} while (true);
			return set;
		} else
		{
			return null;
		}
	}

	public Set getCriticalExtensionOIDs()
	{
		return getExtensionOIDs(true);
	}

	public Set getNonCriticalExtensionOIDs()
	{
		return getExtensionOIDs(false);
	}

	public byte[] getExtensionValue(String oid)
	{
		X509Extensions exts = c.getExtensions();
		if (exts != null)
		{
			X509Extension ext = exts.getExtension(new DERObjectIdentifier(oid));
			if (ext != null)
				return ext.getValue().getOctets();
		}
		return null;
	}

	public byte[] getEncoded()
		throws CRLException
	{
		ByteArrayOutputStream bOut;
		DEROutputStream dOut;
		bOut = new ByteArrayOutputStream();
		dOut = new DEROutputStream(bOut);
		dOut.writeObject(c);
		return bOut.toByteArray();
		IOException e;
		e;
		throw new CRLException(e.toString());
	}

	public BigInteger getSerialNumber()
	{
		return c.getUserCertificate().getValue();
	}

	public Date getRevocationDate()
	{
		return c.getRevocationDate().getDate();
	}

	public boolean hasExtensions()
	{
		return c.getExtensions() != null;
	}

	public String toString()
	{
		StringBuffer buf = new StringBuffer();
		String nl = System.getProperty("line.separator");
		buf.append((new StringBuilder()).append("      userCertificate: ").append(getSerialNumber()).append(nl).toString());
		buf.append((new StringBuilder()).append("       revocationDate: ").append(getRevocationDate()).append(nl).toString());
		X509Extensions extensions = c.getExtensions();
		if (extensions != null)
		{
			Enumeration e = extensions.oids();
			if (e.hasMoreElements())
			{
				buf.append((new StringBuilder()).append("   crlEntryExtensions:").append(nl).toString());
				X509Extension ext;
				for (; e.hasMoreElements(); buf.append(ext))
				{
					DERObjectIdentifier oid = (DERObjectIdentifier)e.nextElement();
					ext = extensions.getExtension(oid);
				}

			}
		}
		return buf.toString();
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -