本文整理匯總了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));
}
}