本文整理汇总了Java中org.bouncycastle.asn1.ASN1Sequence.size方法的典型用法代码示例。如果您正苦于以下问题:Java ASN1Sequence.size方法的具体用法?Java ASN1Sequence.size怎么用?Java ASN1Sequence.size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bouncycastle.asn1.ASN1Sequence
的用法示例。
在下文中一共展示了ASN1Sequence.size方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: MacData
import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
private MacData(
ASN1Sequence seq)
{
this.digInfo = DigestInfo.getInstance(seq.getObjectAt(0));
this.salt = ((ASN1OctetString)seq.getObjectAt(1)).getOctets();
if (seq.size() == 3)
{
this.iterationCount = ((ASN1Integer)seq.getObjectAt(2)).getValue();
}
else
{
this.iterationCount = ONE;
}
}
示例2: OtherSigningCertificate
import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
/**
* constructeurs
*/
private OtherSigningCertificate(ASN1Sequence seq)
{
if (seq.size() < 1 || seq.size() > 2)
{
throw new IllegalArgumentException("Bad sequence size: "
+ seq.size());
}
this.certs = ASN1Sequence.getInstance(seq.getObjectAt(0));
if (seq.size() > 1)
{
this.policies = ASN1Sequence.getInstance(seq.getObjectAt(1));
}
}
示例3: OtherRevRefs
import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
private OtherRevRefs(ASN1Sequence seq)
{
if (seq.size() != 2)
{
throw new IllegalArgumentException("Bad sequence size: "
+ seq.size());
}
this.otherRevRefType = new ASN1ObjectIdentifier(((ASN1ObjectIdentifier)seq.getObjectAt(0)).getId());
try
{
this.otherRevRefs = ASN1Primitive.fromByteArray(seq.getObjectAt(1)
.toASN1Primitive().getEncoded(ASN1Encoding.DER));
}
catch (IOException e)
{
throw new IllegalStateException();
}
}
示例4: Asn1NewKeyControl
import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
private Asn1NewKeyControl(ASN1Sequence seq) throws BadAsn1ObjectException {
control = new P11NewKeyControl();
final int size = seq.size();
for (int i = 0; i < size; i++) {
ASN1Encodable obj = seq.getObjectAt(i);
if (obj instanceof ASN1TaggedObject) {
continue;
}
ASN1TaggedObject tagObj = (ASN1TaggedObject) obj;
int tagNo = tagObj.getTagNo();
if (tagNo == 0) {
boolean bv = ((ASN1Boolean) tagObj.getObject()).isTrue();
control.setExtractable(bv);
}
}
}
示例5: EncKeyWithID
import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
private EncKeyWithID(ASN1Sequence seq)
{
this.privKeyInfo = PrivateKeyInfo.getInstance(seq.getObjectAt(0));
if (seq.size() > 1)
{
if (!(seq.getObjectAt(1) instanceof DERUTF8String))
{
this.identifier = GeneralName.getInstance(seq.getObjectAt(1));
}
else
{
this.identifier = (ASN1Encodable)seq.getObjectAt(1);
}
}
else
{
this.identifier = null;
}
}
示例6: SignaturePolicyId
import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
private SignaturePolicyId(
ASN1Sequence seq)
{
if (seq.size() != 2 && seq.size() != 3)
{
throw new IllegalArgumentException("Bad sequence size: " + seq.size());
}
sigPolicyId = ASN1ObjectIdentifier.getInstance(seq.getObjectAt(0));
sigPolicyHash = OtherHashAlgAndValue.getInstance(seq.getObjectAt(1));
if (seq.size() == 3)
{
sigPolicyQualifiers = SigPolicyQualifiers.getInstance(seq.getObjectAt(2));
}
}
示例7: AttributeCertificateInfo
import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
private AttributeCertificateInfo(
ASN1Sequence seq)
{
if (seq.size() < 7 || seq.size() > 9)
{
throw new IllegalArgumentException("Bad sequence size: " + seq.size());
}
this.version = ASN1Integer.getInstance(seq.getObjectAt(0));
this.holder = Holder.getInstance(seq.getObjectAt(1));
this.issuer = AttCertIssuer.getInstance(seq.getObjectAt(2));
this.signature = AlgorithmIdentifier.getInstance(seq.getObjectAt(3));
this.serialNumber = ASN1Integer.getInstance(seq.getObjectAt(4));
this.attrCertValidityPeriod = AttCertValidityPeriod.getInstance(seq.getObjectAt(5));
this.attributes = ASN1Sequence.getInstance(seq.getObjectAt(6));
for (int i = 7; i < seq.size(); i++)
{
ASN1Encodable obj = (ASN1Encodable)seq.getObjectAt(i);
if (obj instanceof DERBitString)
{
this.issuerUniqueID = DERBitString.getInstance(seq.getObjectAt(i));
}
else if (obj instanceof ASN1Sequence || obj instanceof Extensions)
{
this.extensions = Extensions.getInstance(seq.getObjectAt(i));
}
}
}
示例8: OriginatorInfo
import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
private OriginatorInfo(
ASN1Sequence seq)
{
switch (seq.size())
{
case 0: // empty
break;
case 1:
ASN1TaggedObject o = (ASN1TaggedObject)seq.getObjectAt(0);
switch (o.getTagNo())
{
case 0 :
certs = ASN1Set.getInstance(o, false);
break;
case 1 :
crls = ASN1Set.getInstance(o, false);
break;
default:
throw new IllegalArgumentException("Bad tag in OriginatorInfo: " + o.getTagNo());
}
break;
case 2:
certs = ASN1Set.getInstance((ASN1TaggedObject)seq.getObjectAt(0), false);
crls = ASN1Set.getInstance((ASN1TaggedObject)seq.getObjectAt(1), false);
break;
default:
throw new IllegalArgumentException("OriginatorInfo too big");
}
}
示例9: fromSequence
import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
private static PolicyInformation[] fromSequence(ASN1Sequence seq)
{
PolicyInformation[] tmp = new PolicyInformation[seq.size()];
for (int i = 0; i != tmp.length; i++)
{
tmp[i] = PolicyInformation.getInstance(seq.getObjectAt(i));
}
return tmp;
}
示例10: Challenge
import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
private Challenge(ASN1Sequence seq)
{
int index = 0;
if (seq.size() == 3)
{
owf = AlgorithmIdentifier.getInstance(seq.getObjectAt(index++));
}
witness = ASN1OctetString.getInstance(seq.getObjectAt(index++));
challenge = ASN1OctetString.getInstance(seq.getObjectAt(index));
}
示例11: sequenceToASN1IntegerArray
import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
private static ASN1Integer[] sequenceToASN1IntegerArray(ASN1Sequence seq)
{
ASN1Integer[] result = new ASN1Integer[seq.size()];
for (int i = 0; i != result.length; i++)
{
result[i] = ASN1Integer.getInstance(seq.getObjectAt(i));
}
return result;
}
示例12: Holder
import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的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;
}
示例13: AttCertValidityPeriod
import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
private AttCertValidityPeriod(
ASN1Sequence seq)
{
if (seq.size() != 2)
{
throw new IllegalArgumentException("Bad sequence size: "
+ seq.size());
}
notBeforeTime = ASN1GeneralizedTime.getInstance(seq.getObjectAt(0));
notAfterTime = ASN1GeneralizedTime.getInstance(seq.getObjectAt(1));
}
示例14: Asn1GenRSAKeypairParams
import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
private Asn1GenRSAKeypairParams(ASN1Sequence seq) throws BadAsn1ObjectException {
Asn1Util.requireRange(seq, 4, 5);
final int size = seq.size();
int idx = 0;
slotId = Asn1P11SlotIdentifier.getInstance(seq.getObjectAt(idx++)).slotId();
label = Asn1Util.getUtf8String(seq.getObjectAt(idx++));
control = Asn1NewKeyControl.getInstance(seq.getObjectAt(idx++)).control();
keysize = Asn1Util.getInteger(seq.getObjectAt(idx++)).intValue();
ParamUtil.requireMin("keysize", keysize, 1);
publicExponent = (size > 4) ? Asn1Util.getInteger(seq.getObjectAt(idx++)) : null;
}
示例15: CrlIdentifier
import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
private CrlIdentifier(ASN1Sequence seq)
{
if (seq.size() < 2 || seq.size() > 3)
{
throw new IllegalArgumentException();
}
this.crlIssuer = X500Name.getInstance(seq.getObjectAt(0));
this.crlIssuedTime = ASN1UTCTime.getInstance(seq.getObjectAt(1));
if (seq.size() > 2)
{
this.crlNumber = ASN1Integer.getInstance(seq.getObjectAt(2));
}
}