
org.spongycastle.asn1.cmc.BodyPartPath Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of core Show documentation
Show all versions of core Show documentation
Spongy Castle is a package-rename (org.bouncycastle.* to org.spongycastle.*) of Bouncy Castle
intended for the Android platform. Android unfortunately ships with a stripped-down version of
Bouncy Castle, which prevents easy upgrades - Spongy Castle overcomes this and provides a full,
up-to-date version of the Bouncy Castle cryptographic libs.
The newest version!
package org.spongycastle.asn1.cmc;
import org.spongycastle.asn1.ASN1Object;
import org.spongycastle.asn1.ASN1Primitive;
import org.spongycastle.asn1.ASN1Sequence;
import org.spongycastle.asn1.ASN1TaggedObject;
import org.spongycastle.asn1.DERSequence;
/**
*
* BodyPartPath ::= SEQUENCE SIZE (1..MAX) OF BodyPartID
*
*/
public class BodyPartPath
extends ASN1Object
{
private final BodyPartID[] bodyPartIDs;
public static BodyPartPath getInstance(
Object obj)
{
if (obj instanceof BodyPartPath)
{
return (BodyPartPath)obj;
}
if (obj != null)
{
return new BodyPartPath(ASN1Sequence.getInstance(obj));
}
return null;
}
public static BodyPartPath getInstance(
ASN1TaggedObject obj,
boolean explicit)
{
return getInstance(ASN1Sequence.getInstance(obj, explicit));
}
/**
* Construct a BodyPartPath object containing one BodyPartID.
*
* @param bodyPartID the BodyPartID to be contained.
*/
public BodyPartPath(
BodyPartID bodyPartID)
{
this.bodyPartIDs = new BodyPartID[] { bodyPartID };
}
public BodyPartPath(
BodyPartID[] bodyPartIDs)
{
this.bodyPartIDs = Utils.clone(bodyPartIDs);
}
private BodyPartPath(
ASN1Sequence seq)
{
this.bodyPartIDs = Utils.toBodyPartIDArray(seq);
}
public BodyPartID[] getBodyPartIDs()
{
return Utils.clone(bodyPartIDs);
}
public ASN1Primitive toASN1Primitive()
{
return new DERSequence(bodyPartIDs);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy