issrg.ac
Class AttCertIssuer

java.lang.Object
  extended by issrg.ac.AttCertIssuer
All Implemented Interfaces:
java.lang.Cloneable

public class AttCertIssuer
extends java.lang.Object
implements java.lang.Cloneable

This class represents the AttCertIssuer ASN.1 construct. Set CHOICE value to either GENERALNAMES_CID, or V1FORM_CID (the same as GENERALNAMES_CID), or V2FORM_CID, if you provide both v1form and v2form objects to the constructor.


Field Summary
protected  int CHOICE
           
static int GENERALNAMES_CID
           
protected  GeneralNames v1Form
           
static int V1FORM_CID
           
protected  V2Form v2Form
           
static int V2FORM_CID
           
 
Constructor Summary
protected AttCertIssuer()
           
  AttCertIssuer(ASN1Object ao)
          This constructor builds AttCertIssuer from ASN1Object.
  AttCertIssuer(GeneralNames v1Form, V2Form v2Form)
          This constructor builds an object with the V1Form (GeneralNames) or V2Form specified.
 
Method Summary
 java.lang.Object clone()
           
 void decode(ASN1Object ao)
          This method decodes a given ASN1Object and sets the AttCertIssuer from the content of that object.
 int getChoice()
          Returns the CHOICE setting.
 GeneralNames getV1Form()
          Returns the value for V1 encoding (GeneralNames choice).
 V2Form getV2Form()
          Returns the value for V2 encoding (V2Form choice).
 void setChoice(int choice)
          Sets the CHOICE setting.
 void setV1Form(GeneralNames v1)
          Sets the value for V1 encoding and flips the CHOICE to GENERALNAMES_CID, if the value is non-null, and leaves unchanged if the value is set to null.
 void setV2Form(V2Form v2)
          Sets the value for V2 encoding and flips the CHOICE to V2FORM_CID, if the value is non-null, and leaves unchanged if the value is set to null.
 ASN1Object toASN1Object()
          This method returns the ASN1Object of AttCertIssuer construct.
 java.lang.String toString()
           
 java.lang.String toString(java.lang.String ident)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

GENERALNAMES_CID

public static final int GENERALNAMES_CID
See Also:
Constant Field Values

V1FORM_CID

public static final int V1FORM_CID
See Also:
Constant Field Values

V2FORM_CID

public static final int V2FORM_CID
See Also:
Constant Field Values

CHOICE

protected int CHOICE

v1Form

protected GeneralNames v1Form

v2Form

protected V2Form v2Form
Constructor Detail

AttCertIssuer

protected AttCertIssuer()

AttCertIssuer

public AttCertIssuer(ASN1Object ao)
              throws CodingException
This constructor builds AttCertIssuer from ASN1Object.

Parameters:
ao - - the ASN1Object of AttCertIssuer construct
Throws:
CodingException

AttCertIssuer

public AttCertIssuer(GeneralNames v1Form,
                     V2Form v2Form)
This constructor builds an object with the V1Form (GeneralNames) or V2Form specified. You can specify both of them, and manually flip the CHOICE variable value when you can decide what form of the certificate issuer information you need, so the object would deliver a definite result when encoding. If you don't do that, the V1Form will be used by default, if both values are non-null.

Parameters:
v1Form - is the GeneralNames of the issuer
v2Form - is the V2Form construct, containing the issuer information
Method Detail

getChoice

public int getChoice()
Returns the CHOICE setting.

See Also:
setChoice(int)

setChoice

public void setChoice(int choice)
Sets the CHOICE setting. If it equals to GENERALNAMES_CID, the object will be encoded as GeneralNames construct; if it equals to V2FORM_CID, the object will be encoded as a V2Form. Otherwise a run-time exception will occur at encoding time.

Note that the CHOICE is set automatically after decoding a BER and if you pass at least one non-null parameter to the constructor.

Parameters:
the - integer value for CHOICE

getV1Form

public GeneralNames getV1Form()
Returns the value for V1 encoding (GeneralNames choice).


setV1Form

public void setV1Form(GeneralNames v1)
Sets the value for V1 encoding and flips the CHOICE to GENERALNAMES_CID, if the value is non-null, and leaves unchanged if the value is set to null.

Parameters:
v1 - - the GeneralNames of the issuer; can be null

getV2Form

public V2Form getV2Form()
Returns the value for V2 encoding (V2Form choice).


setV2Form

public void setV2Form(V2Form v2)
Sets the value for V2 encoding and flips the CHOICE to V2FORM_CID, if the value is non-null, and leaves unchanged if the value is set to null.

Parameters:
v2 - - the V2Form of the issuer; can be null

toASN1Object

public ASN1Object toASN1Object()
                        throws CodingException
This method returns the ASN1Object of AttCertIssuer construct. The actual value depends on the choice set: if it is GENERALNAMES_CID or V1FORM_CID, a GeneralNames is the result; if it is V2FORM_CID, a V2Form is output and is tagged with [0]; otherwise a CodingException occurs.

Whether the tagging is explicit or implicit, depends on AttributeCertificate.USE_IMPLICIT_ENCODING.

Returns:
ASN1Object of AttCertIssuer
Throws:
CodingException
See Also:
AttributeCertificate.USE_IMPLICIT_ENCODING

decode

public void decode(ASN1Object ao)
            throws CodingException
This method decodes a given ASN1Object and sets the AttCertIssuer from the content of that object. The content depends on whether the ASN1Object has a context-specific tag [0]: if so, V2Form is expected; otherwise V1Form is expected (GeneralNames).

Parameters:
ao - - the ASN1Object of AttCertIssuer
Throws:
CodingException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toString

public java.lang.String toString(java.lang.String ident)

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object