org.spongycastle.asn1.esf.CompleteRevocationRefs Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scprov-jdk15 Show documentation
Show all versions of scprov-jdk15 Show documentation
Spongy Castle is a package-rename (org.bouncycastle.* to org.spongycastle.*) of Bouncy Castle intended for Android.
Android ships with a stripped-down version of Bouncy Castle - this causes classloader collisions if you try to add
an alternative (updated/complete) Bouncy Castle jar.
This jar contains JCE provider and lightweight API for the Bouncy Castle Cryptography APIs for JDK 1.5.
package org.spongycastle.asn1.esf;
import java.util.Enumeration;
import org.spongycastle.asn1.ASN1Encodable;
import org.spongycastle.asn1.ASN1Sequence;
import org.spongycastle.asn1.DERObject;
import org.spongycastle.asn1.DERSequence;
/**
*
* CompleteRevocationRefs ::= SEQUENCE OF CrlOcspRef
*
*/
public class CompleteRevocationRefs
extends ASN1Encodable
{
private ASN1Sequence crlOcspRefs;
public static CompleteRevocationRefs getInstance(Object obj)
{
if (obj instanceof CompleteRevocationRefs)
{
return (CompleteRevocationRefs)obj;
}
else if (obj != null)
{
return new CompleteRevocationRefs(ASN1Sequence.getInstance(obj));
}
throw new IllegalArgumentException("null value in getInstance");
}
private CompleteRevocationRefs(ASN1Sequence seq)
{
Enumeration seqEnum = seq.getObjects();
while (seqEnum.hasMoreElements())
{
CrlOcspRef.getInstance(seqEnum.nextElement());
}
this.crlOcspRefs = seq;
}
public CompleteRevocationRefs(CrlOcspRef[] crlOcspRefs)
{
this.crlOcspRefs = new DERSequence(crlOcspRefs);
}
public CrlOcspRef[] getCrlOcspRefs()
{
CrlOcspRef[] result = new CrlOcspRef[this.crlOcspRefs.size()];
for (int idx = 0; idx < result.length; idx++)
{
result[idx] = CrlOcspRef.getInstance(this.crlOcspRefs
.getObjectAt(idx));
}
return result;
}
public DERObject toASN1Object()
{
return this.crlOcspRefs;
}
}