org.bouncycastle.asn1.x509

Class Target

Implemented Interfaces:
ASN1Choice, DEREncodable

public class Target
extends ASN1Encodable
implements ASN1Choice

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

static int
targetGroup
static int
targetName

Fields inherited from class org.bouncycastle.asn1.ASN1Encodable

BER, DER

Constructor Summary

Target(int type, GeneralName name)
Constructor from given details.

Method Summary

static Target
getInstance(Object obj)
Creates an instance of a Target from the given object.
GeneralName
getTargetGroup()
GeneralName
getTargetName()
DERObject
toASN1Object()
Produce an object suitable for an ASN1OutputStream.

Methods inherited from class org.bouncycastle.asn1.ASN1Encodable

equals, getDEREncoded, getDERObject, getEncoded, getEncoded, hashCode, toASN1Object

Field Details

targetGroup

public static final int targetGroup
Field Value:
1

targetName

public static final int targetName
Field Value:
0

Constructor Details

Target

public Target(int type,
              GeneralName name)
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.

Method Details

getInstance

public static Target getInstance(Object obj)
Creates an instance of a Target from the given object.

obj can be a Target or a ASN1TaggedObject

Parameters:
obj - The object.
Returns:
A Target instance.

getTargetGroup

public GeneralName getTargetGroup()
Returns:
Returns the targetGroup.

getTargetName

public GeneralName getTargetName()
Returns:
Returns the targetName.

toASN1Object

public DERObject toASN1Object()
Produce an object suitable for an ASN1OutputStream. Returns:
     Target  ::= CHOICE {
       targetName          [0] GeneralName,
       targetGroup         [1] GeneralName,
       targetCert          [2] TargetCert
     }
 
Overrides:
toASN1Object in interface ASN1Encodable
Returns:
a DERObject