Package org.gudy.bouncycastle.asn1.x509
Class TargetInformation
- java.lang.Object
-
- org.gudy.bouncycastle.asn1.ASN1Encodable
-
- org.gudy.bouncycastle.asn1.x509.TargetInformation
-
- All Implemented Interfaces:
DEREncodable
public class TargetInformation extends ASN1Encodable
Target information extension for attributes certificates according to RFC 3281.SEQUENCE OF Targets
-
-
Field Summary
Fields Modifier and Type Field Description private ASN1Sequence
targets
-
Fields inherited from class org.gudy.bouncycastle.asn1.ASN1Encodable
BER, DER
-
-
Constructor Summary
Constructors Modifier Constructor Description private
TargetInformation(ASN1Sequence seq)
Constructor from a ASN1Sequence.TargetInformation(Target[] targets)
According to RFC 3281 only one targets element must be produced.TargetInformation(Targets targets)
Constructs a target information from a single targets element.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TargetInformation
getInstance(java.lang.Object obj)
Creates an instance of a TargetInformation from the given object.Targets[]
getTargetsObjects()
Returns the targets in this target information extension.DERObject
toASN1Object()
Produce an object suitable for an ASN1OutputStream.-
Methods inherited from class org.gudy.bouncycastle.asn1.ASN1Encodable
equals, getDEREncoded, getDERObject, getEncoded, getEncoded, hashCode
-
-
-
-
Field Detail
-
targets
private ASN1Sequence targets
-
-
Constructor Detail
-
TargetInformation
private TargetInformation(ASN1Sequence seq)
Constructor from a ASN1Sequence.- Parameters:
seq
- The ASN1Sequence.- Throws:
java.lang.IllegalArgumentException
- if the sequence does not contain correctly encoded Targets elements.
-
TargetInformation
public TargetInformation(Targets targets)
Constructs a target information from a single targets element. According to RFC 3281 only one targets element must be produced.- Parameters:
targets
- A Targets instance.
-
-
Method Detail
-
getInstance
public static TargetInformation getInstance(java.lang.Object obj)
Creates an instance of a TargetInformation from the given object.obj
can be a TargetInformation or aASN1Sequence
- Parameters:
obj
- The object.- Returns:
- A TargetInformation instance.
- Throws:
java.lang.IllegalArgumentException
- if the given object cannot be interpreted as TargetInformation.
-
getTargetsObjects
public Targets[] getTargetsObjects()
Returns the targets in this target information extension.- Returns:
- Returns the targets.
-
toASN1Object
public DERObject toASN1Object()
Produce an object suitable for an ASN1OutputStream. Returns:SEQUENCE OF Targets
According to RFC 3281 only one targets element must be produced. If multiple targets are given in the constructor they are merged into one targets element. If this was produced from a
ASN1Sequence
the encoding is kept.- Specified by:
toASN1Object
in classASN1Encodable
- Returns:
- a DERObject
-
-