Package org.gudy.bouncycastle.asn1.x509
Class Target
java.lang.Object
org.gudy.bouncycastle.asn1.ASN1Encodable
org.gudy.bouncycastle.asn1.x509.Target
- All Implemented Interfaces:
ASN1Choice
,DEREncodable
Target structure used in target information extension for attribute
certificates from RFC 3281.
Target ::= CHOICE { targetName [0] GeneralName, targetGroup [1] GeneralName, targetCert [2] TargetCert }
The targetCert field is currently not supported and must not be used according to RFC 3281.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
private GeneralName
private GeneralName
Fields inherited from class org.gudy.bouncycastle.asn1.ASN1Encodable
BER, DER
-
Constructor Summary
ConstructorsModifierConstructorDescriptionTarget
(int type, GeneralName name) Constructor from given details.private
Target
(ASN1TaggedObject tagObj) Constructor from ASN1TaggedObject. -
Method Summary
Modifier and TypeMethodDescriptionstatic Target
getInstance
(Object obj) Creates an instance of a Target from the given object.Produce an object suitable for an ASN1OutputStream.Methods inherited from class org.gudy.bouncycastle.asn1.ASN1Encodable
equals, getDEREncoded, getDERObject, getEncoded, getEncoded, hashCode
-
Field Details
-
targetName
public static final int targetName- See Also:
-
targetGroup
public static final int targetGroup- See Also:
-
targName
-
targGroup
-
-
Constructor Details
-
Target
Constructor from ASN1TaggedObject.- Parameters:
tagObj
- The tagged object.- Throws:
IllegalArgumentException
- if the encoding is wrong.
-
Target
Constructor from given details.Exactly one of the parameters must be not
null
.- Parameters:
type
- the choice type to apply to the name.name
- the general name.- Throws:
IllegalArgumentException
- if type is invalid.
-
-
Method Details
-
getInstance
Creates an instance of a Target from the given object.obj
can be a Target or aASN1TaggedObject
- Parameters:
obj
- The object.- Returns:
- A Target instance.
- Throws:
IllegalArgumentException
- if the given object cannot be interpreted as Target.
-
getTargetGroup
- Returns:
- Returns the targetGroup.
-
getTargetName
- Returns:
- Returns the targetName.
-
toASN1Object
Produce an object suitable for an ASN1OutputStream. Returns:Target ::= CHOICE { targetName [0] GeneralName, targetGroup [1] GeneralName, targetCert [2] TargetCert }
- Specified by:
toASN1Object
in classASN1Encodable
- Returns:
- a DERObject
-