本文整理匯總了Java中org.bouncycastle.asn1.ASN1Sequence.getObjects方法的典型用法代碼示例。如果您正苦於以下問題:Java ASN1Sequence.getObjects方法的具體用法?Java ASN1Sequence.getObjects怎麽用?Java ASN1Sequence.getObjects使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.bouncycastle.asn1.ASN1Sequence
的用法示例。
在下文中一共展示了ASN1Sequence.getObjects方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: AuthorityKeyIdentifier
import org.bouncycastle.asn1.ASN1Sequence; //導入方法依賴的package包/類
protected AuthorityKeyIdentifier(
ASN1Sequence seq)
{
Enumeration e = seq.getObjects();
while (e.hasMoreElements())
{
ASN1TaggedObject o = DERTaggedObject.getInstance(e.nextElement());
switch (o.getTagNo())
{
case 0:
this.keyidentifier = ASN1OctetString.getInstance(o, false);
break;
case 1:
this.certissuer = GeneralNames.getInstance(o, false);
break;
case 2:
this.certserno = ASN1Integer.getInstance(o, false);
break;
default:
throw new IllegalArgumentException("illegal tag");
}
}
}
示例2: PKIMessage
import org.bouncycastle.asn1.ASN1Sequence; //導入方法依賴的package包/類
private PKIMessage(ASN1Sequence seq)
{
Enumeration en = seq.getObjects();
header = PKIHeader.getInstance(en.nextElement());
body = PKIBody.getInstance(en.nextElement());
while (en.hasMoreElements())
{
ASN1TaggedObject tObj = (ASN1TaggedObject)en.nextElement();
if (tObj.getTagNo() == 0)
{
protection = DERBitString.getInstance(tObj, true);
}
else
{
extraCerts = ASN1Sequence.getInstance(tObj, true);
}
}
}
示例3: parseDG1
import org.bouncycastle.asn1.ASN1Sequence; //導入方法依賴的package包/類
private void parseDG1(byte[] DG1) {
try (ASN1InputStream bIn = new ASN1InputStream(DG1)) {
org.bouncycastle.asn1.DERApplicationSpecific app = (DERApplicationSpecific) bIn.readObject();
ASN1Sequence seq = (ASN1Sequence) app.getObject(BERTags.SEQUENCE);
Enumeration secEnum = seq.getObjects();
while (secEnum.hasMoreElements()) {
ASN1Primitive seqObj = (ASN1Primitive) secEnum.nextElement();
byte[] data = seqObj.getEncoded();
if (data[0]== 0x41) {
Log.d("type approval number", ByteUtils.bytesToHex(data));
this.set5F01(Bytes.allButFirst(data, 1));
} else if (data[0] == 0x42) {
byte[] input = Arrays.copyOfRange(data, 3, data.length);
parse5F02(input);
} else if (data[0] == 0x7F) {
parse7F63(data);
}
}
} catch (IOException e) {
Log.e(getClass().getName(), e.getMessage(), e);
}
}
示例4: CrlID
import org.bouncycastle.asn1.ASN1Sequence; //導入方法依賴的package包/類
private CrlID(
ASN1Sequence seq)
{
Enumeration e = seq.getObjects();
while (e.hasMoreElements())
{
ASN1TaggedObject o = (ASN1TaggedObject)e.nextElement();
switch (o.getTagNo())
{
case 0:
crlUrl = DERIA5String.getInstance(o, true);
break;
case 1:
crlNum = ASN1Integer.getInstance(o, true);
break;
case 2:
crlTime = DERGeneralizedTime.getInstance(o, true);
break;
default:
throw new IllegalArgumentException(
"unknown tag number: " + o.getTagNo());
}
}
}
示例5: parseDG11
import org.bouncycastle.asn1.ASN1Sequence; //導入方法依賴的package包/類
private void parseDG11(byte[] DG11) {
try (ASN1InputStream bIn = new ASN1InputStream(DG11)) {
DERApplicationSpecific app = (DERApplicationSpecific) bIn.readObject();
ASN1Sequence seq = (ASN1Sequence) app.getObject(BERTags.SEQUENCE);
Enumeration secEnum = seq.getObjects();
while (secEnum.hasMoreElements()) {
ASN1Primitive seqObj = (ASN1Primitive) secEnum.nextElement();
byte[] data = seqObj.getEncoded();
if (data[0]== 0x7F) {
parseDG11(data);
} else if (data[0] == (byte) 0x80) {
this.setBSN(Arrays.copyOfRange(data, 2, data.length));
}
}
} catch (IOException e) {
Log.e(getClass().getName(), e.getMessage(), e);
}
}
示例6: ExtendedKeyUsage
import org.bouncycastle.asn1.ASN1Sequence; //導入方法依賴的package包/類
private ExtendedKeyUsage(
ASN1Sequence seq)
{
this.seq = seq;
Enumeration e = seq.getObjects();
while (e.hasMoreElements())
{
ASN1Encodable o = (ASN1Encodable)e.nextElement();
if (!(o.toASN1Primitive() instanceof ASN1ObjectIdentifier))
{
throw new IllegalArgumentException("Only ASN1ObjectIdentifiers allowed in ExtendedKeyUsage.");
}
this.usageTable.put(o, o);
}
}
示例7: KeyRecRepContent
import org.bouncycastle.asn1.ASN1Sequence; //導入方法依賴的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());
}
}
}
示例8: RSAPrivateKey
import org.bouncycastle.asn1.ASN1Sequence; //導入方法依賴的package包/類
private RSAPrivateKey(
ASN1Sequence seq)
{
Enumeration e = seq.getObjects();
BigInteger v = ((ASN1Integer)e.nextElement()).getValue();
if (v.intValue() != 0 && v.intValue() != 1)
{
throw new IllegalArgumentException("wrong version for RSA private key");
}
version = v;
modulus = ((ASN1Integer)e.nextElement()).getValue();
publicExponent = ((ASN1Integer)e.nextElement()).getValue();
privateExponent = ((ASN1Integer)e.nextElement()).getValue();
prime1 = ((ASN1Integer)e.nextElement()).getValue();
prime2 = ((ASN1Integer)e.nextElement()).getValue();
exponent1 = ((ASN1Integer)e.nextElement()).getValue();
exponent2 = ((ASN1Integer)e.nextElement()).getValue();
coefficient = ((ASN1Integer)e.nextElement()).getValue();
if (e.hasMoreElements())
{
otherPrimeInfos = (ASN1Sequence)e.nextElement();
}
}
示例9: SignerLocation
import org.bouncycastle.asn1.ASN1Sequence; //導入方法依賴的package包/類
private SignerLocation(
ASN1Sequence seq)
{
Enumeration e = seq.getObjects();
while (e.hasMoreElements())
{
DERTaggedObject o = (DERTaggedObject)e.nextElement();
switch (o.getTagNo())
{
case 0:
DirectoryString countryNameDirectoryString = DirectoryString.getInstance(o, true);
this.countryName = new DERUTF8String(countryNameDirectoryString.getString());
break;
case 1:
DirectoryString localityNameDirectoryString = DirectoryString.getInstance(o, true);
this.localityName = new DERUTF8String(localityNameDirectoryString.getString());
break;
case 2:
if (o.isExplicit())
{
this.postalAddress = ASN1Sequence.getInstance(o, true);
}
else // handle erroneous implicitly tagged sequences
{
this.postalAddress = ASN1Sequence.getInstance(o, false);
}
if (postalAddress != null && postalAddress.size() > 6)
{
throw new IllegalArgumentException("postal address must contain less than 6 strings");
}
break;
default:
throw new IllegalArgumentException("illegal tag");
}
}
}
示例10: GOST3410ParamSetParameters
import org.bouncycastle.asn1.ASN1Sequence; //導入方法依賴的package包/類
public GOST3410ParamSetParameters(
ASN1Sequence seq)
{
Enumeration e = seq.getObjects();
keySize = ((ASN1Integer)e.nextElement()).getValue().intValue();
p = (ASN1Integer)e.nextElement();
q = (ASN1Integer)e.nextElement();
a = (ASN1Integer)e.nextElement();
}
示例11: QCStatement
import org.bouncycastle.asn1.ASN1Sequence; //導入方法依賴的package包/類
private QCStatement(
ASN1Sequence seq)
{
Enumeration e = seq.getObjects();
// qcStatementId
qcStatementId = ASN1ObjectIdentifier.getInstance(e.nextElement());
// qcstatementInfo
if (e.hasMoreElements())
{
qcStatementInfo = (ASN1Encodable) e.nextElement();
}
}
示例12: TimeStampResp
import org.bouncycastle.asn1.ASN1Sequence; //導入方法依賴的package包/類
private TimeStampResp(ASN1Sequence seq)
{
Enumeration e = seq.getObjects();
// status
pkiStatusInfo = PKIStatusInfo.getInstance(e.nextElement());
if (e.hasMoreElements())
{
timeStampToken = ContentInfo.getInstance(e.nextElement());
}
}
示例13: X500Name
import org.bouncycastle.asn1.ASN1Sequence; //導入方法依賴的package包/類
private X500Name(
X500NameStyle style,
ASN1Sequence seq)
{
this.style = style;
this.rdns = new RDN[seq.size()];
int index = 0;
for (Enumeration e = seq.getObjects(); e.hasMoreElements();)
{
rdns[index++] = RDN.getInstance(e.nextElement());
}
}
示例14: getQualifierSet
import org.bouncycastle.asn1.ASN1Sequence; //導入方法依賴的package包/類
protected static final Set getQualifierSet(ASN1Sequence qualifiers)
throws CertPathValidatorException
{
Set pq = new HashSet();
if (qualifiers == null)
{
return pq;
}
ByteArrayOutputStream bOut = new ByteArrayOutputStream();
ASN1OutputStream aOut = new ASN1OutputStream(bOut);
Enumeration e = qualifiers.getObjects();
while (e.hasMoreElements())
{
try
{
aOut.writeObject((ASN1Encodable)e.nextElement());
pq.add(new PolicyQualifierInfo(bOut.toByteArray()));
}
catch (IOException ex)
{
throw new ExtCertPathValidatorException("Policy qualifier info cannot be decoded.", ex);
}
bOut.reset();
}
return pq;
}
示例15: ProcurationSyntax
import org.bouncycastle.asn1.ASN1Sequence; //導入方法依賴的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());
}
}
}