Class ASN1Integer

    • Constructor Detail

      • ASN1Integer

        public ASN1Integer()
        Constructs ASN.1 Integer type The constructor is provided for inheritance purposes when there is a need to create a custom ASN.1 Integer type. To get a default implementation it is recommended to use getInstance() method.
    • Method Detail

      • getInstance

        public static ASN1Integer getInstance()
        Returns ASN.1 Integer type default implementation The default implementation works with encoding that is represented as byte array in two's-complement notation.
        Returns:
        ASN.1 Integer type default implementation
      • toIntValue

        public static int toIntValue​(Object decoded)
        Converts decoded ASN.1 Integer to int value. If the object represents an integer value larger than 32 bits, the high bits will be lost.
        Parameters:
        decoded - a decoded object corresponding to this type
        Returns:
        decoded int value.
      • toBigIntegerValue

        public static BigInteger toBigIntegerValue​(Object decoded)
        Converts decoded ASN.1 Integer to a BigInteger.
        Parameters:
        decoded - a decoded object corresponding to this type
        Returns:
        decoded BigInteger value.
      • fromIntValue

        public static Object fromIntValue​(int value)
        Converts primitive int value to a form most suitable for encoding.
        Parameters:
        value - primitive value to be encoded
        Returns:
        object suitable for encoding