View Javadoc
1 /* 2 * Title: S/MIME Project 3 * Description: S/MIME email transport capabilities. 4 * @Author Vladimir Radisic 5 * @Version 2.0.1 6 */ 7 8 9 package org.webdocwf.util.smime.der; 10 11 12 import java.math.BigInteger; 13 import org.webdocwf.util.smime.exception.SMIMEException; 14 15 16 /*** 17 * DERInteger is primitive type of DER encoded object which represents integer 18 * value in ASN.1 notation. 19 */ 20 public class DERInteger extends DERObject { 21 22 /*** 23 * Construction with the given integer value. This constructor is limited with 24 * dimension of Java type - long (from -9223372036854775808 to 9223372036854775807) 25 * @param integer0 data (long type) 26 * @exception SMIMEException thrown in super class constructor or in super class 27 * addContent method. 28 */ 29 public DERInteger(long integer0) throws SMIMEException { 30 super(2); // CMS version is Tag Type Integer (2) 31 super.addContent(new BigInteger(new Long(integer0).toString()).toByteArray()); 32 } 33 34 /*** 35 * Construction with the given BigInteger type of data. This constructor is 36 * used for integer numbers greater that long Java type can provide 37 * @param integer0 data (BigInteger type) 38 * @exception SMIMEException thrown in super class constructor or in super class 39 * addContent method. 40 */ 41 public DERInteger(BigInteger integer0) throws SMIMEException { 42 super(2); // CMS version is Tag Type Integer (2) 43 super.addContent(integer0.toByteArray()); 44 } 45 46 } 47

This page was automatically generated by Maven