Top Fields Constructors Methods
org.bouncycastle.asn1

public Class ASN1RelativeOID

extends ASN1Primitive
Class Inheritance
Imports
java.io.ByteArrayOutputStream, .IOException, java.math.BigInteger, java.util.concurrent.ConcurrentHashMap, .ConcurrentMap, org.bouncycastle.util.Arrays, .Properties

Field Summary

Modifier and TypeField and Description
private final byte[]
private String
private static final long
private static final int
MAX_CONTENTS_LENGTH

Implementation limit on the length of the contents octets for a Relative OID.

private static final int
private static final ConcurrentMap<ASN1ObjectIdentifier.OidHandle, ASN1RelativeOID>
pack-priv static final ASN1UniversalType

Constructor Summary

AccessConstructor and Description
public
ASN1RelativeOID(String identifier)

private
ASN1RelativeOID(byte[] contents, String identifier)

Method Summary

Modifier and TypeMethod and Description
pack-priv boolean
asn1Equals(ASN1Primitive other)

Implements abstract org.bouncycastle.asn1.ASN1Primitive.asn1Equals.

Equality (similarity) comparison for two ASN1Primitive objects.

public ASN1RelativeOID
branch(String branchID)

pack-priv static void
checkContentsLength(int contentsLength)

pack-priv static void
checkIdentifier(String identifier)

pack-priv static ASN1RelativeOID
createPrimitive(byte[] contents, boolean clone)

pack-priv void
encode(ASN1OutputStream out, boolean withTag)

Implements abstract org.bouncycastle.asn1.ASN1Primitive.encode.

pack-priv boolean
encodeConstructed()

Implements abstract org.bouncycastle.asn1.ASN1Primitive.encodeConstructed.

Return true if this objected is a CONSTRUCTED one, false otherwise.

pack-priv int
public static ASN1RelativeOID
fromContents(byte[] contents)

public synchronized String
public static ASN1RelativeOID
public static ASN1RelativeOID
getInstance(ASN1TaggedObject taggedObject, boolean explicit)

public int
hashCode()

Implements abstract org.bouncycastle.asn1.ASN1Primitive.hashCode.

Returns a hash code value for this object.

pack-priv static boolean
isValidContents(byte[] contents)

pack-priv static boolean
isValidIdentifier(String identifier, int from)

pack-priv static String
parseContents(byte[] contents)

pack-priv static byte[]
parseIdentifier(String identifier)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public static ASN1RelativeOID
tryFromID(String identifier)

pack-priv static void
writeField(ByteArrayOutputStream out, long fieldValue)

pack-priv static void
Inherited from org.bouncycastle.asn1.ASN1Primitive:
encodeToencodeToequalsequalsequalsfromByteArraytoASN1PrimitivetoDERObjecttoDLObject

Field Detail

contentsback to summary
private final byte[] contents
identifierback to summary
private String identifier
LONG_LIMITback to summary
private static final long LONG_LIMIT
MAX_CONTENTS_LENGTHback to summary
private static final int MAX_CONTENTS_LENGTH

Implementation limit on the length of the contents octets for a Relative OID.

We adopt the same value used by OpenJDK for Object Identifier. In theory there is no limit on the length of the contents, or the number of subidentifiers, or the length of individual subidentifiers. In practice, supporting arbitrary lengths can lead to issues, e.g. denial-of-service attacks when attempting to convert a parsed value to its (decimal) string form.

MAX_IDENTIFIER_LENGTHback to summary
private static final int MAX_IDENTIFIER_LENGTH
poolback to summary
private static final ConcurrentMap<ASN1ObjectIdentifier.OidHandle, ASN1RelativeOID> pool
TYPEback to summary
pack-priv static final ASN1UniversalType TYPE

Constructor Detail

ASN1RelativeOIDback to summary
public ASN1RelativeOID(String identifier)
ASN1RelativeOIDback to summary
private ASN1RelativeOID(byte[] contents, String identifier)

Method Detail

asn1Equalsback to summary
pack-priv boolean asn1Equals(ASN1Primitive other)

Implements abstract org.bouncycastle.asn1.ASN1Primitive.asn1Equals.

Doc from org.bouncycastle.asn1.ASN1Primitive.asn1Equals.

Equality (similarity) comparison for two ASN1Primitive objects.

branchback to summary
public ASN1RelativeOID branch(String branchID)
checkContentsLengthback to summary
pack-priv static void checkContentsLength(int contentsLength)
checkIdentifierback to summary
pack-priv static void checkIdentifier(String identifier)
createPrimitiveback to summary
pack-priv static ASN1RelativeOID createPrimitive(byte[] contents, boolean clone)
encodeback to summary
pack-priv void encode(ASN1OutputStream out, boolean withTag) throws IOException

Implements abstract org.bouncycastle.asn1.ASN1Primitive.encode.

encodeConstructedback to summary
pack-priv boolean encodeConstructed()

Implements abstract org.bouncycastle.asn1.ASN1Primitive.encodeConstructed.

Doc from org.bouncycastle.asn1.ASN1Primitive.encodeConstructed.

Return true if this objected is a CONSTRUCTED one, false otherwise.

Returns:boolean

true if CONSTRUCTED bit set on object's tag, false otherwise.

encodedLengthback to summary
pack-priv int encodedLength(boolean withTag)

Implements abstract org.bouncycastle.asn1.ASN1Primitive.encodedLength.

fromContentsback to summary
public static ASN1RelativeOID fromContents(byte[] contents)
getIdback to summary
public synchronized String getId()
getInstanceback to summary
public static ASN1RelativeOID getInstance(Object obj)
getInstanceback to summary
public static ASN1RelativeOID getInstance(ASN1TaggedObject taggedObject, boolean explicit)
hashCodeback to summary
public int hashCode()

Implements abstract org.bouncycastle.asn1.ASN1Primitive.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

isValidContentsback to summary
pack-priv static boolean isValidContents(byte[] contents)
isValidIdentifierback to summary
pack-priv static boolean isValidIdentifier(String identifier, int from)
parseContentsback to summary
pack-priv static String parseContents(byte[] contents)
parseIdentifierback to summary
pack-priv static byte[] parseIdentifier(String identifier)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

tryFromIDback to summary
public static ASN1RelativeOID tryFromID(String identifier)
writeFieldback to summary
pack-priv static void writeField(ByteArrayOutputStream out, long fieldValue)
writeFieldback to summary
pack-priv static void writeField(ByteArrayOutputStream out, BigInteger fieldValue)