com.rsa.certj.cert.attributes

Class CountryOfResidence

java.lang.Object
  |
  +--com.rsa.certj.cert.attributes.X501Attribute
        |
        +--com.rsa.certj.cert.attributes.CountryOfResidence
All Implemented Interfaces:
Cloneable, Serializable

public class CountryOfResidence
extends X501Attribute
implements Cloneable, Serializable

This class holds, encodes, and decodes the countryOfResidence attribute, which is defined in PKCS #9 v2. The countryOfResidence attribute specifies the claimed country of residence of the subject with which the attribute is associated. It consists of a two-letter acronym that represents a country.

The PKCS #9 v2.0 definition is as follows:

 countryOfResidence ATTRIBUTE ::= {
	WITH SYNTAX PrintableString (SIZE(2) ^ CONSTRAINED BY { 
                 -- Must be a two-letter country acronym
                    in accordance with ISO/IEC 3166 --})
	EQUALITY MATCHING RULE caseIgnoreMatch
	ID pkcs-9-at-countryOfResidence
 }

Attributes of this type do not have to be be single-valued, as it is possible to be a resident of several countries.

Copyright © RSA Security Inc., 2002. All rights reserved.

See Also

Serialized Form

Fields inherited from class com.rsa.certj.cert.attributes.X501Attribute
CHALLENGE_PASSWORD, CONTENT_TYPE, COUNTRY_OF_CITIZENSHIP, COUNTRY_OF_RESIDENCE, CRS_DUAL_STATUS, CRS_FAILURE_INFO, CRS_MESSAGE_TYPE, CRS_PKI_STATUS, CRS_RECIPIENT_NONCE, CRS_SENDER_NONCE, CRS_TRANSACTION_ID, CRS_VERSION, DATE_OF_BIRTH, FRIENDLY_NAME, GENDER, LOCAL_KEY_ID, MESSAGE_DIGEST, NON_STANDARD, PLACE_OF_BIRTH, POSTAL_ADDRESS, PSEUDONYM, SIGNING_TIME, SMART_CSP, X509_V3_EXTENSION
 

Constructor Summary

CountryOfResidence()

Constructs an empty countryOfResidence object.

CountryOfResidence(String country)

Constructs a countryOfResidence object and initializes it with the value given.

 

Method Summary

 Object

clone()

Overrides the default clone method to get a deeper clone.

 boolean

equals(Object obj)

Returns true if this object and obj contain the same countryOfResidence; returns false, otherwise.

 String

getCountry()

Gets the value of this attribute, the countryOfResidence.

 void

setCountry(String theCountry)

Sets the value of this attribute, the countryOfResidence, to theCountry.

 
Methods inherited from class com.rsa.certj.cert.attributes.X501Attribute
clearSensitiveData, compareOID, derEncodeAttributeLen, getAttributeType, getAttributeTypeString, getDEREncoding, getDERLen, getInstance, getNextBEROffset, getOID, isAttributeType
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CountryOfResidence

public CountryOfResidence()
Constructs an empty countryOfResidence object.

CountryOfResidence

public CountryOfResidence(String country)
                   throws AttributeException
Constructs a countryOfResidence object and initializes it with the value given.

Parameters

         country  

The country of residence of the subject with which the attribute is associated. It should be two characters long.

Throws

AttributeException - If country is not 2 characters long
Method Detail

setCountry

public void setCountry(String theCountry)
                throws AttributeException
Sets the value of this attribute, the countryOfResidence, to theCountry.

Parameters

         theCountry  

The country of residence of the subject with which the attribute is associated It should be two characters long.

Throws

AttributeException - If theCountry is not 2 characters long

getCountry

public String getCountry()
Gets the value of this attribute, the countryOfResidence.

Returns

The country of residence of the subject with which the attribute is associated.

clone

public Object clone()
             throws CloneNotSupportedException
Overrides the default clone method to get a deeper clone.

Overrides

clone in class X501Attribute

Returns

A new countryOfResidence object, a copy of this object.

Throws

CloneNotSupportedException - If the cloning operation is not successful.

equals

public boolean equals(Object obj)
Returns true if this object and obj contain the same countryOfResidence; returns false, otherwise.

Overrides

equals in class Object

Parameters

         obj  

The instance of the CountryOfResidence object.

Returns

A boolean indicating whether these objects are equal.


RSA BSAFE ® Cert-J 2.1.1 001-047007-211-001-000