MonetaryValue ::= SEQUENCE { currency Iso4217CurrencyCode, amount INTEGER, exponent INTEGER } -- value = amount * 10^exponent
Enumeration e = seq.getObjects(); // currency currency = Iso4217CurrencyCode.getInstance(e.nextElement()); // hashAlgorithm amount = DERInteger.getInstance(e.nextElement()); // exponent exponent = DERInteger.getInstance(e.nextElement());
this.currency = currency; this.amount = new DERInteger(amount); this.exponent = new DERInteger(exponent);
return amount.getValue();
return currency;
return exponent.getValue();
if (obj == null || obj instanceof MonetaryValue) { return (MonetaryValue)obj; } if (obj instanceof ASN1Sequence) { return new MonetaryValue(ASN1Sequence.getInstance(obj)); } throw new IllegalArgumentException("unknown object in getInstance");
ASN1EncodableVector seq = new ASN1EncodableVector(); seq.add(currency); seq.add(amount); seq.add(exponent); return new DERSequence(seq);