public class QcEuLimitValue extends QCStatementInfo
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 Profiles for Trust Service Providers issuing certificates, Part 5, Extension for Qualified Certificates profile (ETSI EN 319 412-5, formerly ETSI TS 101 862) 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);
QCStatementInfo
,
QCStatement
,
QCStatements
Modifier and Type | Field and Description |
---|---|
static ObjectID |
statementID
The statement id for this QcEuLimitValue statement info.
|
Constructor and Description |
---|
QcEuLimitValue()
Default constructor.
|
QcEuLimitValue(int iso4217CurrencyCode,
int amount,
int exponent)
Creates QcEuLimitValue statement for given currency code, amount and exponent
|
QcEuLimitValue(java.lang.String iso4217CurrencyCode,
int amount,
int exponent)
Creates QcEuLimitValue statement for given currency code, amount and exponent
|
Modifier and Type | Method and Description |
---|---|
void |
decode(ASN1Object obj)
Decodes the QcEuLimitValue.
|
int |
getAmount()
Gets the amount.
|
java.lang.Object |
getCurrency()
Gets the currency.
|
int |
getExponent()
Gets the exponent.
|
ObjectID |
getStatementID()
Returns the statement ID identifying this
QcEuLimitValue
statement info. |
java.math.BigInteger |
getValue()
Gets the value.
|
ASN1Object |
toASN1Object()
Returns an ASN.1 representation of this QcEuLimitValue.
|
java.lang.String |
toString()
Returns a string representation of the statement info
|
getName
public static final ObjectID statementID
public QcEuLimitValue()
public QcEuLimitValue(int iso4217CurrencyCode, int amount, int exponent) throws java.lang.IllegalArgumentException
iso4217CurrencyCode
- the currency code as integer between 1..999amount
- 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)java.lang.IllegalArgumentException
- if the currency is not between 1..999public QcEuLimitValue(java.lang.String iso4217CurrencyCode, int amount, int exponent) throws java.lang.IllegalArgumentException
iso4217CurrencyCode
- the currency code as String of 3 charactersamount
- 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)java.lang.IllegalArgumentException
- if the currency code is null or of length different from 3public ObjectID getStatementID()
QcEuLimitValue
statement info.
The corresponding OID string is "0.4.0.1862.1.2".getStatementID
in class QCStatementInfo
QcEuLimitValue
statement infopublic java.lang.Object getCurrency()
public int getAmount()
public int getExponent()
public java.math.BigInteger getValue()
public void decode(ASN1Object obj) throws CodingException
decode
in class QCStatementInfo
obj
- the QcEuLimitValue as ASN1ObjectCodingException
- if the ASN1Object cannot be parsedpublic ASN1Object toASN1Object()
toASN1Object
in class QCStatementInfo
public java.lang.String toString()
toString
in class QCStatementInfo