Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.bouncycastle.asn1.x509;

import java.util.Enumeration;

import org.bouncycastle.asn1.ASN1Encodable;
import org.bouncycastle.asn1.ASN1EncodableVector;
import org.bouncycastle.asn1.ASN1Object;
import org.bouncycastle.asn1.ASN1Primitive;
Expand Down Expand Up @@ -87,11 +86,9 @@ private CertificatePair(ASN1Sequence seq)
+ seq.size());
}

Enumeration e = seq.getObjects();

while (e.hasMoreElements())
for (ASN1Encodable element : seq)
{
ASN1TaggedObject o = ASN1TaggedObject.getInstance(e.nextElement());
ASN1TaggedObject o = ASN1TaggedObject.getInstance(element);
if (o.getTagNo() == 0)
{
forward = Certificate.getInstance(o, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class IetfAttrSyntax
public static final int VALUE_OID = 2;
public static final int VALUE_UTF8 = 3;
GeneralNames policyAuthority = null;
Vector values = new Vector();
Vector<ASN1Primitive> values = new Vector<>();
int valueChoice = -1;

public static IetfAttrSyntax getInstance(Object obj)
Expand Down Expand Up @@ -68,9 +68,9 @@ else if (seq.size() == 2)

seq = (ASN1Sequence)seq.getObjectAt(i);

for (Enumeration e = seq.getObjects(); e.hasMoreElements();)
for (ASN1Encodable element : seq)
{
ASN1Primitive obj = (ASN1Primitive)e.nextElement();
ASN1Primitive obj = (ASN1Primitive)element;
int type;

if (obj instanceof ASN1ObjectIdentifier)
Expand Down Expand Up @@ -178,9 +178,9 @@ public ASN1Primitive toASN1Primitive()
{
ASN1EncodableVector v2 = new ASN1EncodableVector(values.size());

for (Enumeration i = values.elements(); i.hasMoreElements();)
for (ASN1Primitive element : values)
{
v2.add((ASN1Encodable)i.nextElement());
v2.add(element);
}

v.add(new DERSequence(v2));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.Enumeration;

import org.bouncycastle.asn1.ASN1Encodable;
import org.bouncycastle.asn1.ASN1EncodableVector;
import org.bouncycastle.asn1.ASN1Object;
import org.bouncycastle.asn1.ASN1Primitive;
Expand Down Expand Up @@ -31,10 +32,9 @@ public static NameConstraints getInstance(Object obj)

private NameConstraints(ASN1Sequence seq)
{
Enumeration e = seq.getObjects();
while (e.hasMoreElements())
for (ASN1Encodable element : seq)
{
ASN1TaggedObject o = ASN1TaggedObject.getInstance(e.nextElement());
ASN1TaggedObject o = ASN1TaggedObject.getInstance(element);
switch (o.getTagNo())
{
case 0:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.bouncycastle.asn1.x509;

import java.util.Enumeration;

import org.bouncycastle.asn1.ASN1Encodable;
import org.bouncycastle.asn1.ASN1EncodableVector;
import org.bouncycastle.asn1.ASN1GeneralizedTime;
import org.bouncycastle.asn1.ASN1Object;
Expand Down Expand Up @@ -40,10 +39,9 @@ public static PrivateKeyUsagePeriod getInstance(Object obj)

private PrivateKeyUsagePeriod(ASN1Sequence seq)
{
Enumeration en = seq.getObjects();
while (en.hasMoreElements())
for (ASN1Encodable element : seq)
{
ASN1TaggedObject tObj = (ASN1TaggedObject)en.nextElement();
ASN1TaggedObject tObj = (ASN1TaggedObject)element;

if (tObj.getTagNo() == 0)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.util.Vector;

import org.bouncycastle.asn1.ASN1Boolean;
import org.bouncycastle.asn1.ASN1Encodable;
import org.bouncycastle.asn1.ASN1EncodableVector;
import org.bouncycastle.asn1.ASN1Object;
import org.bouncycastle.asn1.ASN1ObjectIdentifier;
Expand All @@ -18,6 +19,7 @@
/**
* @deprecated use {@link Extension} and {@link Extensions}
*/
@Deprecated
public class X509Extensions
extends ASN1Object
{
Expand Down Expand Up @@ -253,11 +255,9 @@ public static X509Extensions getInstance(
public X509Extensions(
ASN1Sequence seq)
{
Enumeration e = seq.getObjects();

while (e.hasMoreElements())
for (ASN1Encodable element : seq)
{
ASN1Sequence s = ASN1Sequence.getInstance(e.nextElement());
ASN1Sequence s = ASN1Sequence.getInstance(element);

if (s.size() == 3)
{
Expand Down
Loading