📄 distributionpoint.java
字号:
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi
// Source File Name: DistributionPoint.java
package jit.asn1.x509;
import jit.asn1.*;
// Referenced classes of package jit.asn1.x509:
// ReasonFlags, DistributionPointName, GeneralName, GeneralNames
public class DistributionPoint extends ASN1Encodable
{
DistributionPointName distributionPointName;
ReasonFlags reasons;
GeneralName cRLIssuer;
public static DistributionPoint getInstance(ASN1TaggedObject obj, boolean explicit)
{
return getInstance(ASN1Sequence.getInstance(obj, explicit));
}
public static DistributionPoint getInstance(Object obj)
{
if(obj == null || (obj instanceof DistributionPoint))
return (DistributionPoint)obj;
if(obj instanceof ASN1Sequence)
return new DistributionPoint((ASN1Sequence)obj);
else
throw new IllegalArgumentException("Invalid DistributionPoint: ".concat(String.valueOf(String.valueOf(obj.getClass().getName()))));
}
public DistributionPoint(ASN1Sequence seq)
{
distributionPointName = null;
reasons = null;
cRLIssuer = null;
for(int i = 0; i != seq.size(); i++)
{
ASN1TaggedObject t = (ASN1TaggedObject)seq.getObjectAt(i);
switch(t.getTagNo())
{
case 0: // '\0'
distributionPointName = DistributionPointName.getInstance(t, true);
break;
case 1: // '\001'
reasons = new ReasonFlags(DERBitString.getInstance(t, true));
break;
case 2: // '\002'
cRLIssuer = GeneralName.getInstance(t, true);
break;
}
}
}
public DistributionPoint(DistributionPointName distributionPointName, ReasonFlags reasons, GeneralName cRLIssuer)
{
this.distributionPointName = null;
this.reasons = null;
this.cRLIssuer = null;
this.distributionPointName = distributionPointName;
this.reasons = reasons;
this.cRLIssuer = cRLIssuer;
}
public DistributionPointName getDistributionPointName()
{
return distributionPointName;
}
public GeneralNames getFullName()
{
if(distributionPointName == null)
return null;
else
return distributionPointName.getFullName();
}
public ASN1Set getNameRelative2CRLIssuer()
{
if(distributionPointName == null)
return null;
else
return distributionPointName.getNameRelative2CRLIssuer();
}
public ReasonFlags getReasons()
{
return reasons;
}
public GeneralName getCRLIssuer()
{
return cRLIssuer;
}
public DERObject toASN1Object()
{
ASN1EncodableVector v = new ASN1EncodableVector();
if(distributionPointName != null)
v.add(new DERTaggedObject(0, distributionPointName));
if(reasons != null)
v.add(new DERTaggedObject(1, reasons));
if(cRLIssuer != null)
v.add(new DERTaggedObject(2, cRLIssuer));
return new DERSequence(v);
}
public static DistributionPoint generatDistributionPoint(GeneralName distributionPointName, ReasonFlags reasonFlags, GeneralName crlIssuerName)
{
DERObject part1 = null;
DERObject part2 = null;
DERObject part3 = null;
if(distributionPointName != null)
{
DERTaggedObject tag1 = new DERTaggedObject(0, distributionPointName);
DERTaggedObject tag2 = new DERTaggedObject(0, tag1);
DistributionPointName pointName = new DistributionPointName(tag2);
part1 = pointName.toASN1Object();
}
if(reasonFlags != null)
part2 = new DERTaggedObject(1, reasonFlags);
if(crlIssuerName != null)
{
DERTaggedObject tag = new DERTaggedObject(crlIssuerName.getTagNo(), crlIssuerName.getName());
part3 = new DERTaggedObject(2, tag);
}
DEREncodableVector derV = new DEREncodableVector();
if(part1 != null)
derV.add(part1);
if(part2 != null)
derV.add(part2);
if(part3 != null)
derV.add(part3);
DERSequence derS = new DERSequence(derV);
return new DistributionPoint(derS);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -