iaik.x509.extensions.qualified.structures.etsi
Class QcEuLimitValue

java.lang.Object
  |
  +--iaik.x509.extensions.qualified.structures.QCStatementInfo
        |
        +--iaik.x509.extensions.qualified.structures.etsi.QcEuLimitValue

public class QcEuLimitValue
extends QCStatementInfo

This class implements the ETSI QcEuLimitValue QCStatementInfo.

The QcEuLimitValue statement info is associated with a specific statement identifier, derived from:

     id-etsi-qcs  OBJECT IDENTIFIER  ::=
             { itu-t(0) identified-organization(4) etsi(0) id-qc-profile(1862) 1 }

     id-etsi-qcs-QcLimitValue OBJECT IDENTIFIER ::= { id-etsi-qcs 2 }
 

which corresponds to the OID string "0.4.0.1862.1.2".

The ETSI Qualified Certificate Profile (TS 101 862 V1.2.1) specifies the QcEuLimitValue statement info for indicating the limits on the value of transactions for which the qualified certificate can be used.

ASN.1 definition:

 QcEuLimitValue ::= MonetaryValue

 MonetaryValue::= SEQUENCE {
    currency Iso4217CurrencyCode,
    amount INTEGER,
    exponent INTEGER}
    -- value = amount * 10^exponent

 Iso4217CurrencyCode ::= CHOICE {
   alphabetic PrintableString (SIZE 3), -- Recommended
   numeric INTEGER (1..999) }
   -- Alphabetic or numeric currency code as defined in ISO 4217
   -- It is recommended that the Alphabetic form is used
 

Supply currency, amount and exponent when creating a QcEuLimitValue object. Subsequently create a QCStatement object for the QcEuLimitValue and add the QCStatement to a QCStatements certificate extension. To, for instance, limit transactions to 10000 EURO, set amount to 1 and exponent to 4.:

 String currency = "EUR";
 int amount = 1;
 int exponent = 4;
 // create the QcEuLimitValue:
 QcEuLimitValue limit = 
   new QcEuLimitValue(currency, amount, exponent);
 // create a QCStatement for the QcEuLimitValue
 QCStatement[] qcStatements = ...;
 qcStatements[0] = new QCStatement(limit);
 // add any further QCStatements
 ...
 // create a QCStatements extension from the QCStatements:
 QCStatements qcStatementsExt = new QCStatements(qcStatements);
 
For adding a QCStatements extension object to a QualifiedCertificate, use the addExtension or setQCStatements method of the QualifiedCertificate class:

 QualifiedCertificate cert = new QualifiedCertificate();
   ...
 cert.setQCStatements(qcStatementsExt);
 

Version:
File Revision 6
See Also:
QCStatementInfo, QCStatement, QCStatements

Field Summary
static ObjectID statementID
          The statement id for this QcEuLimitValue statement info.
 
Constructor Summary
QcEuLimitValue()
          Default constructor.
QcEuLimitValue(int iso4217CurrencyCode, int amount, int exponent)
          Creates QcEuLimitValue statement for given currency code, amount and exponent
QcEuLimitValue(String iso4217CurrencyCode, int amount, int exponent)
          Creates QcEuLimitValue statement for given currency code, amount and exponent
 
Method Summary
 void decode(ASN1Object obj)
          Decodes the QcEuLimitValue.
 int getAmount()
          Gets the amount.
 Object getCurrency()
          Gets the currency.
 int getExponent()
          Gets the exponent.
 ObjectID getStatementID()
          Returns the statement ID identifying this QcEuLimitValue statement info.
 BigInteger getValue()
          Gets the value.
 ASN1Object toASN1Object()
          Returns an ASN.1 representation of this QcEuLimitValue.
 String toString()
          Returns a string representation of the statement info
 
Methods inherited from class iaik.x509.extensions.qualified.structures.QCStatementInfo
getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

statementID

public static final ObjectID statementID
The statement id for this QcEuLimitValue statement info. The corresponding OID string is "0.4.0.1862.1.1".
Constructor Detail

QcEuLimitValue

public QcEuLimitValue()
Default constructor. Only used for dynamic object creation. Shall not be called by an application.

QcEuLimitValue

public QcEuLimitValue(int iso4217CurrencyCode,
                      int amount,
                      int exponent)
               throws IllegalArgumentException
Creates QcEuLimitValue statement for given currency code, amount and exponent
Parameters:
iso4217CurrencyCode - the currency code as integer between 1..999
amount - the amount from which to calculate the value of (amount * 10^exponent)
exponent - the exponent from which to calculate the value of (amount * 10^exponent)
Throws:
IllegalArgumentException - if the currency is not between 1..999

QcEuLimitValue

public QcEuLimitValue(String iso4217CurrencyCode,
                      int amount,
                      int exponent)
               throws IllegalArgumentException
Creates QcEuLimitValue statement for given currency code, amount and exponent
Parameters:
iso4217CurrencyCode - the currency code as String of 3 characters
amount - the amount from which to calculate the value of (amount * 10^exponent)
exponent - the exponent from which to calculate the value of (amount * 10^exponent)
Throws:
IllegalArgumentException - if the currency code is null or of length different from 3
Method Detail

getStatementID

public ObjectID getStatementID()
Returns the statement ID identifying this QcEuLimitValue statement info. The corresponding OID string is "0.4.0.1862.1.2".
Overrides:
getStatementID in class QCStatementInfo
Returns:
the statementID identifying this QcEuLimitValue statement info

getCurrency

public Object getCurrency()
Gets the currency.
Returns:
the currency, either as BigInteger (1..999) or as String of 3 characters

getAmount

public int getAmount()
Gets the amount.
Returns:
the amount

getExponent

public int getExponent()
Gets the exponent.
Returns:
the exponent

getValue

public BigInteger getValue()
Gets the value.
Returns:
the value calculated from (amount * 10^exponent)

decode

public void decode(ASN1Object obj)
            throws CodingException
Decodes the QcEuLimitValue.
Overrides:
decode in class QCStatementInfo
Parameters:
the - QcEuLimitValue as ASN1Object

toASN1Object

public ASN1Object toASN1Object()
Returns an ASN.1 representation of this QcEuLimitValue.
Overrides:
toASN1Object in class QCStatementInfo
Returns:
this QcEuLimitValue as ASN1Object

toString

public String toString()
Returns a string representation of the statement info
Overrides:
toString in class QCStatementInfo
Returns:
a string representation of the statement info

This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note).

IAIK-JCE 3.1 with IAIK-JCE CC Core 3.1, (c) 1997-2004 IAIK