Enum ASN1Class

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<ASN1Class>

    public enum ASN1Class
    extends java.lang.Enum<ASN1Class>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private byte byteValue  
      static java.util.List<ASN1Class> VALUES  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ASN1Class​(byte classValue)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static ASN1Class fromDERValue​(int value)
      The first byte in DER encoding is made of following fields
      static ASN1Class fromName​(java.lang.String s)  
      static ASN1Class fromTypeValue​(int value)  
      byte getClassValue()  
      static ASN1Class valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static ASN1Class[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • UNIVERSAL

        public static final ASN1Class UNIVERSAL
      • APPLICATION

        public static final ASN1Class APPLICATION
      • CONTEXT

        public static final ASN1Class CONTEXT
      • PRIVATE

        public static final ASN1Class PRIVATE
    • Field Detail

      • VALUES

        public static final java.util.List<ASN1Class> VALUES
      • byteValue

        private final byte byteValue
    • Constructor Detail

      • ASN1Class

        private ASN1Class​(byte classValue)
    • Method Detail

      • values

        public static ASN1Class[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (ASN1Class c : ASN1Class.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ASN1Class valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getClassValue

        public byte getClassValue()
      • fromName

        public static ASN1Class fromName​(java.lang.String s)
      • fromDERValue

        public static ASN1Class fromDERValue​(int value)

        The first byte in DER encoding is made of following fields

        -------------------------------------------------
        |Bit 8|Bit 7|Bit 6|Bit 5|Bit 4|Bit 3|Bit 2|Bit 1|
        -------------------------------------------------
        |  Class    | CF  |        Type                 |
        -------------------------------------------------
         
        Parameters:
        value - The original DER encoded byte
        Returns:
        The ASN1Class value - null if no match found
        See Also:
        fromTypeValue(int)
      • fromTypeValue

        public static ASN1Class fromTypeValue​(int value)
        Parameters:
        value - The "pure" value - unshifted and with no extras
        Returns:
        The ASN1Class value - null if no match found