Package com.oss.util
Class ASN1ObjidIriFormat
java.lang.Object
com.oss.util.ASN1ObjidIriFormat
This utility class for checking values of the OID-IRI and
RELATIVE-OID-IRI ASN1 types.
- Since:
- ASN.1/Java 4.3
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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
Helper method that parses the first node of the OID-IRIstatic int
secondNode
(String iri, int root, int start, int end) Helper method that parses the second node of the OID-IRI valuestatic int
toCodePoint
(char high, char low) Converts the input high and low surrogates to the surrogate code point.
-
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-IRIstart
- offset to the start of the nodeend
- 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-IRIroot
- value of the first (root) node of the OID-IRI valuestart
- offset to the start of the nodeend
- 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 valuerelative
- indicates that the string represents the value ofRELATIVE-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 valuecurrentPos
- offset to the start of the nodelength
- 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-IRIcurrentPos
- offset to the start of the nodelength
- 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 characterlow
- low surrogate character- Returns:
- surrogate code point
-