Package com.oss.util

Class ASN1ObjidIriFormat

java.lang.Object
com.oss.util.ASN1ObjidIriFormat

public class ASN1ObjidIriFormat extends Object
This utility class for checking values of the OID-IRI and RELATIVE-OID-IRI ASN1 types.
Since:
ASN.1/Java 4.3
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    checkOidIri(String iri, boolean relative)
    Parses the input string and checks that it has a valid IRI format.
    static boolean
    checkRelativeOidIri(String iri, int currentPos, int length)
    Parses the input string and checks that it has a valid Relative-OID-IRI format.
    static boolean
    checkThirdArc(String iri, int currentPos, int length)
    Checks that the third arc is in the range [1..26] or ['A'-'Z']
    static int
    rootNode(String iri, int start, int end)
    Helper method that parses the first node of the OID-IRI
    static int
    secondNode(String iri, int root, int start, int end)
    Helper method that parses the second node of the OID-IRI value
    static int
    toCodePoint(char high, char low)
    Converts the input high and low surrogates to the surrogate code point.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ASN1ObjidIriFormat

      public ASN1ObjidIriFormat()
  • Method Details

    • rootNode

      public static int rootNode(String iri, int start, int end) throws com.oss.util.BadOidIriFormatException
      Helper method that parses the first node of the OID-IRI
      Parameters:
      iri - String representation of the OID-IRI
      start - offset to the start of the node
      end - end of the node
      Returns:
      numeric value corresponding to the node
      Throws:
      com.oss.util.BadOidIriFormatException - if unknown node name.
    • secondNode

      public static int secondNode(String iri, int root, int start, int end) throws com.oss.util.BadOidIriFormatException
      Helper method that parses the second node of the OID-IRI value
      Parameters:
      iri - string that contains the value of the OID-IRI
      root - value of the first (root) node of the OID-IRI value
      start - offset to the start of the node
      end - end of the node
      Returns:
      numeric value corresponding to the node
      Throws:
      com.oss.util.BadOidIriFormatException - if unknown node name.
    • checkOidIri

      public static boolean checkOidIri(String iri, boolean relative) throws com.oss.util.BadOidIriFormatException
      Parses the input string and checks that it has a valid IRI format.
      Parameters:
      iri - string value
      relative - indicates that the string represents the value of RELATIVE-OBJECT-IRI type rather than OID-IRI type
      Returns:
      true if the string has a valid IRI format.
      Throws:
      com.oss.util.BadOidIriFormatException - if the string has invalid format
    • checkRelativeOidIri

      public static boolean checkRelativeOidIri(String iri, int currentPos, int length) throws com.oss.util.BadOidIriFormatException
      Parses the input string and checks that it has a valid Relative-OID-IRI format.
      Parameters:
      iri - string value
      currentPos - offset to the start of the node
      length - length of the string
      Returns:
      true if the string has a valid Relative-OID-IRI format.
      Throws:
      com.oss.util.BadOidIriFormatException - if the string has invalid format
    • checkThirdArc

      public static boolean checkThirdArc(String iri, int currentPos, int length) throws com.oss.util.BadOidIriFormatException
      Checks that the third arc is in the range [1..26] or ['A'-'Z']
      Parameters:
      iri - string that contains the value of the OID-IRI
      currentPos - offset to the start of the node
      length - length of the string
      Returns:
      true if the arc is valid
      Throws:
      com.oss.util.BadOidIriFormatException - if unknown node name.
    • toCodePoint

      public static int toCodePoint(char high, char low)
      Converts the input high and low surrogates to the surrogate code point.
      Parameters:
      high - high surrogate character
      low - low surrogate character
      Returns:
      surrogate code point