List of usage examples for org.bouncycastle.asn1.isismtt.x509 MonetaryLimit getInstance
public static MonetaryLimit getInstance(Object obj)
From source file:net.sf.keystore_explorer.crypto.x509.X509Ext.java
License:Open Source License
private String getMonetaryLimitStringValue(byte[] octets) { // @formatter:off /*/*from www . j a v a2s . c o m*/ MonetaryLimitSyntax ::= SEQUENCE { currency PrintableString (SIZE(3)), amount INTEGER, exponent INTEGER } */ // @formatter:on StringBuilder sb = new StringBuilder(); MonetaryLimit monetaryLimit = MonetaryLimit.getInstance(octets); String currency = monetaryLimit.getCurrency(); BigInteger amount = monetaryLimit.getAmount(); BigInteger exponent = monetaryLimit.getExponent(); if (currency != null) { sb.append(MessageFormat.format(res.getString("MonetaryLimit.Currency"), currency)); sb.append(NEWLINE); } if (amount != null) { sb.append(MessageFormat.format(res.getString("MonetaryLimit.Amount"), amount.toString())); sb.append(NEWLINE); } if (exponent != null) { sb.append(MessageFormat.format(res.getString("MonetaryLimit.Exponent"), exponent.toString())); sb.append(NEWLINE); } return sb.toString(); }