本文整理汇总了Java中org.bouncycastle.asn1.ASN1TaggedObject.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java ASN1TaggedObject.getInstance方法的具体用法?Java ASN1TaggedObject.getInstance怎么用?Java ASN1TaggedObject.getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bouncycastle.asn1.ASN1TaggedObject
的用法示例。
在下文中一共展示了ASN1TaggedObject.getInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: DistributionPoint
import org.bouncycastle.asn1.ASN1TaggedObject; //导入方法依赖的package包/类
public DistributionPoint(
ASN1Sequence seq)
{
for (int i = 0; i != seq.size(); i++)
{
ASN1TaggedObject t = ASN1TaggedObject.getInstance(seq.getObjectAt(i));
switch (t.getTagNo())
{
case 0:
distributionPoint = DistributionPointName.getInstance(t, true);
break;
case 1:
reasons = new ReasonFlags(DERBitString.getInstance(t, false));
break;
case 2:
cRLIssuer = GeneralNames.getInstance(t, false);
}
}
}
示例2: RoleSyntax
import org.bouncycastle.asn1.ASN1TaggedObject; //导入方法依赖的package包/类
/**
* Constructor that builds an instance of <code>RoleSyntax</code> by
* extracting the encoded elements from the <code>ASN1Sequence</code>
* object supplied.
* @param seq an instance of <code>ASN1Sequence</code> that holds
* the encoded elements used to build this <code>RoleSyntax</code>.
*/
private RoleSyntax(
ASN1Sequence seq)
{
if (seq.size() < 1 || seq.size() > 2)
{
throw new IllegalArgumentException("Bad sequence size: "
+ seq.size());
}
for (int i = 0; i != seq.size(); i++)
{
ASN1TaggedObject taggedObject = ASN1TaggedObject.getInstance(seq.getObjectAt(i));
switch (taggedObject.getTagNo())
{
case 0:
roleAuthority = GeneralNames.getInstance(taggedObject, false);
break;
case 1:
roleName = GeneralName.getInstance(taggedObject, true);
break;
default:
throw new IllegalArgumentException("Unknown tag in RoleSyntax");
}
}
}
示例3: getInstance
import org.bouncycastle.asn1.ASN1TaggedObject; //导入方法依赖的package包/类
public static Holder getInstance(Object obj)
{
if (obj instanceof Holder)
{
return (Holder)obj;
}
else if (obj instanceof ASN1TaggedObject)
{
return new Holder(ASN1TaggedObject.getInstance(obj));
}
else if (obj != null)
{
return new Holder(ASN1Sequence.getInstance(obj));
}
return null;
}
示例4: NameConstraints
import org.bouncycastle.asn1.ASN1TaggedObject; //导入方法依赖的package包/类
private NameConstraints(ASN1Sequence seq)
{
Enumeration e = seq.getObjects();
while (e.hasMoreElements())
{
ASN1TaggedObject o = ASN1TaggedObject.getInstance(e.nextElement());
switch (o.getTagNo())
{
case 0:
permitted = createArray(ASN1Sequence.getInstance(o, false));
break;
case 1:
excluded = createArray(ASN1Sequence.getInstance(o, false));
break;
}
}
}
示例5: RevRepContent
import org.bouncycastle.asn1.ASN1TaggedObject; //导入方法依赖的package包/类
private RevRepContent(ASN1Sequence seq)
{
Enumeration en = seq.getObjects();
status = ASN1Sequence.getInstance(en.nextElement());
while (en.hasMoreElements())
{
ASN1TaggedObject tObj = ASN1TaggedObject.getInstance(en.nextElement());
if (tObj.getTagNo() == 0)
{
revCerts = ASN1Sequence.getInstance(tObj, true);
}
else
{
crls = ASN1Sequence.getInstance(tObj, true);
}
}
}
示例6: KeyRecRepContent
import org.bouncycastle.asn1.ASN1TaggedObject; //导入方法依赖的package包/类
private KeyRecRepContent(ASN1Sequence seq)
{
Enumeration en = seq.getObjects();
status = PKIStatusInfo.getInstance(en.nextElement());
while (en.hasMoreElements())
{
ASN1TaggedObject tObj = ASN1TaggedObject.getInstance(en.nextElement());
switch (tObj.getTagNo())
{
case 0:
newSigCert = CMPCertificate.getInstance(tObj.getObject());
break;
case 1:
caCerts = ASN1Sequence.getInstance(tObj.getObject());
break;
case 2:
keyPairHist = ASN1Sequence.getInstance(tObj.getObject());
break;
default:
throw new IllegalArgumentException("unknown tag number: " + tObj.getTagNo());
}
}
}
示例7: CertifiedKeyPair
import org.bouncycastle.asn1.ASN1TaggedObject; //导入方法依赖的package包/类
private CertifiedKeyPair(ASN1Sequence seq)
{
certOrEncCert = CertOrEncCert.getInstance(seq.getObjectAt(0));
if (seq.size() >= 2)
{
if (seq.size() == 2)
{
ASN1TaggedObject tagged = ASN1TaggedObject.getInstance(seq.getObjectAt(1));
if (tagged.getTagNo() == 0)
{
privateKey = EncryptedValue.getInstance(tagged.getObject());
}
else
{
publicationInfo = PKIPublicationInfo.getInstance(tagged.getObject());
}
}
else
{
privateKey = EncryptedValue.getInstance(ASN1TaggedObject.getInstance(seq.getObjectAt(1)));
publicationInfo = PKIPublicationInfo.getInstance(ASN1TaggedObject.getInstance(seq.getObjectAt(2)));
}
}
}
示例8: CertificatePair
import org.bouncycastle.asn1.ASN1TaggedObject; //导入方法依赖的package包/类
/**
* Constructor from ASN1Sequence.
* <p/>
* The sequence is of type CertificatePair:
* <p/>
* <pre>
* CertificatePair ::= SEQUENCE {
* forward [0] Certificate OPTIONAL,
* reverse [1] Certificate OPTIONAL,
* -- at least one of the pair shall be present -- }
* </pre>
*
* @param seq The ASN.1 sequence.
*/
private CertificatePair(ASN1Sequence seq)
{
if (seq.size() != 1 && seq.size() != 2)
{
throw new IllegalArgumentException("Bad sequence size: "
+ seq.size());
}
Enumeration e = seq.getObjects();
while (e.hasMoreElements())
{
ASN1TaggedObject o = ASN1TaggedObject.getInstance(e.nextElement());
if (o.getTagNo() == 0)
{
forward = Certificate.getInstance(o, true);
}
else if (o.getTagNo() == 1)
{
reverse = Certificate.getInstance(o, true);
}
else
{
throw new IllegalArgumentException("Bad tag number: "
+ o.getTagNo());
}
}
}
示例9: V2Form
import org.bouncycastle.asn1.ASN1TaggedObject; //导入方法依赖的package包/类
/**
* @deprecated use getInstance().
*/
public V2Form(
ASN1Sequence seq)
{
if (seq.size() > 3)
{
throw new IllegalArgumentException("Bad sequence size: " + seq.size());
}
int index = 0;
if (!(seq.getObjectAt(0) instanceof ASN1TaggedObject))
{
index++;
this.issuerName = GeneralNames.getInstance(seq.getObjectAt(0));
}
for (int i = index; i != seq.size(); i++)
{
ASN1TaggedObject o = ASN1TaggedObject.getInstance(seq.getObjectAt(i));
if (o.getTagNo() == 0)
{
baseCertificateID = IssuerSerial.getInstance(o, false);
}
else if (o.getTagNo() == 1)
{
objectDigestInfo = ObjectDigestInfo.getInstance(o, false);
}
else
{
throw new IllegalArgumentException("Bad tag number: "
+ o.getTagNo());
}
}
}
示例10: PersonalData
import org.bouncycastle.asn1.ASN1TaggedObject; //导入方法依赖的package包/类
/**
* Constructor from ASN1Sequence.
* <p/>
* The sequence is of type NameOrPseudonym:
* <p/>
* <pre>
* PersonalData ::= SEQUENCE {
* nameOrPseudonym NameOrPseudonym,
* nameDistinguisher [0] INTEGER OPTIONAL,
* dateOfBirth [1] GeneralizedTime OPTIONAL,
* placeOfBirth [2] DirectoryString OPTIONAL,
* gender [3] PrintableString OPTIONAL,
* postalAddress [4] DirectoryString OPTIONAL
* }
* </pre>
*
* @param seq The ASN.1 sequence.
*/
private PersonalData(ASN1Sequence seq)
{
if (seq.size() < 1)
{
throw new IllegalArgumentException("Bad sequence size: "
+ seq.size());
}
Enumeration e = seq.getObjects();
nameOrPseudonym = NameOrPseudonym.getInstance(e.nextElement());
while (e.hasMoreElements())
{
ASN1TaggedObject o = ASN1TaggedObject.getInstance(e.nextElement());
int tag = o.getTagNo();
switch (tag)
{
case 0:
nameDistinguisher = ASN1Integer.getInstance(o, false).getValue();
break;
case 1:
dateOfBirth = ASN1GeneralizedTime.getInstance(o, false);
break;
case 2:
placeOfBirth = DirectoryString.getInstance(o, true);
break;
case 3:
gender = DERPrintableString.getInstance(o, false).getString();
break;
case 4:
postalAddress = DirectoryString.getInstance(o, true);
break;
default:
throw new IllegalArgumentException("Bad tag number: " + o.getTagNo());
}
}
}
示例11: IssuingDistributionPoint
import org.bouncycastle.asn1.ASN1TaggedObject; //导入方法依赖的package包/类
/**
* Constructor from ASN1Sequence
*/
private IssuingDistributionPoint(
ASN1Sequence seq)
{
this.seq = seq;
for (int i = 0; i != seq.size(); i++)
{
ASN1TaggedObject o = ASN1TaggedObject.getInstance(seq.getObjectAt(i));
switch (o.getTagNo())
{
case 0:
// CHOICE so explicit
distributionPoint = DistributionPointName.getInstance(o, true);
break;
case 1:
onlyContainsUserCerts = ASN1Boolean.getInstance(o, false).isTrue();
break;
case 2:
onlyContainsCACerts = ASN1Boolean.getInstance(o, false).isTrue();
break;
case 3:
onlySomeReasons = new ReasonFlags(ReasonFlags.getInstance(o, false));
break;
case 4:
indirectCRL = ASN1Boolean.getInstance(o, false).isTrue();
break;
case 5:
onlyContainsAttributeCerts = ASN1Boolean.getInstance(o, false).isTrue();
break;
default:
throw new IllegalArgumentException(
"unknown tag in IssuingDistributionPoint");
}
}
}
示例12: getOtherRevocationInfo
import org.bouncycastle.asn1.ASN1TaggedObject; //导入方法依赖的package包/类
Store getOtherRevocationInfo(ASN1ObjectIdentifier otherRevocationInfoFormat, ASN1Set crlSet)
{
if (crlSet != null)
{
List crlList = new ArrayList(crlSet.size());
for (Enumeration en = crlSet.getObjects(); en.hasMoreElements();)
{
ASN1Primitive obj = ((ASN1Encodable)en.nextElement()).toASN1Primitive();
if (obj instanceof ASN1TaggedObject)
{
ASN1TaggedObject tObj = ASN1TaggedObject.getInstance(obj);
if (tObj.getTagNo() == 1)
{
OtherRevocationInfoFormat other = OtherRevocationInfoFormat.getInstance(tObj, false);
if (otherRevocationInfoFormat.equals(other.getInfoFormat()))
{
crlList.add(other.getInfo());
}
}
}
}
return new CollectionStore(crlList);
}
return new CollectionStore(new ArrayList());
}
示例13: Holder
import org.bouncycastle.asn1.ASN1TaggedObject; //导入方法依赖的package包/类
/**
* Constructor for a holder for an V2 attribute certificate.
*
* @param seq The ASN.1 sequence.
*/
private Holder(ASN1Sequence seq)
{
if (seq.size() > 3)
{
throw new IllegalArgumentException("Bad sequence size: "
+ seq.size());
}
for (int i = 0; i != seq.size(); i++)
{
ASN1TaggedObject tObj = ASN1TaggedObject.getInstance(seq
.getObjectAt(i));
switch (tObj.getTagNo())
{
case 0:
baseCertificateID = IssuerSerial.getInstance(tObj, false);
break;
case 1:
entityName = GeneralNames.getInstance(tObj, false);
break;
case 2:
objectDigestInfo = ObjectDigestInfo.getInstance(tObj, false);
break;
default:
throw new IllegalArgumentException("unknown tag in Holder");
}
}
version = 1;
}
示例14: ProcurationSyntax
import org.bouncycastle.asn1.ASN1TaggedObject; //导入方法依赖的package包/类
/**
* Constructor from ASN1Sequence.
* <p/>
* The sequence is of type ProcurationSyntax:
* <p/>
* <pre>
* ProcurationSyntax ::= SEQUENCE {
* country [1] EXPLICIT PrintableString(SIZE(2)) OPTIONAL,
* typeOfSubstitution [2] EXPLICIT DirectoryString (SIZE(1..128)) OPTIONAL,
* signingFor [3] EXPLICIT SigningFor
* }
* <p/>
* SigningFor ::= CHOICE
* {
* thirdPerson GeneralName,
* certRef IssuerSerial
* }
* </pre>
*
* @param seq The ASN.1 sequence.
*/
private ProcurationSyntax(ASN1Sequence seq)
{
if (seq.size() < 1 || seq.size() > 3)
{
throw new IllegalArgumentException("Bad sequence size: " + seq.size());
}
Enumeration e = seq.getObjects();
while (e.hasMoreElements())
{
ASN1TaggedObject o = ASN1TaggedObject.getInstance(e.nextElement());
switch (o.getTagNo())
{
case 1:
country = DERPrintableString.getInstance(o, true).getString();
break;
case 2:
typeOfSubstitution = DirectoryString.getInstance(o, true);
break;
case 3:
ASN1Encodable signingFor = o.getObject();
if (signingFor instanceof ASN1TaggedObject)
{
thirdPerson = GeneralName.getInstance(signingFor);
}
else
{
certRef = IssuerSerial.getInstance(signingFor);
}
break;
default:
throw new IllegalArgumentException("Bad tag number: " + o.getTagNo());
}
}
}
示例15: SignerAttribute
import org.bouncycastle.asn1.ASN1TaggedObject; //导入方法依赖的package包/类
private SignerAttribute(
ASN1Sequence seq)
{
int index = 0;
values = new Object[seq.size()];
for (Enumeration e = seq.getObjects(); e.hasMoreElements();)
{
ASN1TaggedObject taggedObject = ASN1TaggedObject.getInstance(e.nextElement());
if (taggedObject.getTagNo() == 0)
{
ASN1Sequence attrs = ASN1Sequence.getInstance(taggedObject, true);
Attribute[] attributes = new Attribute[attrs.size()];
for (int i = 0; i != attributes.length; i++)
{
attributes[i] = Attribute.getInstance(attrs.getObjectAt(i));
}
values[index] = attributes;
}
else if (taggedObject.getTagNo() == 1)
{
values[index] = AttributeCertificate.getInstance(ASN1Sequence.getInstance(taggedObject, true));
}
else
{
throw new IllegalArgumentException("illegal tag: " + taggedObject.getTagNo());
}
index++;
}
}