Class DERUtils
java.lang.Object
org.jolokia.jvmagent.security.asn1.DERUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic int[]decodeLength(byte[] encoded) Decode length value in the passed byte arraystatic int[]decodeLength(byte[] encoded, int offset) Decode length value in the passed byte array starting fromoffsetstatic byte[]encodeLength(int size) ASN.1 encode length value as length octets according to X.690, 8.1.3 Length octetsstatic DERObjectparse(byte[] encoded) static DERObjectparse(byte[] encoded, int offset)
-
Method Details
-
encodeLength
public static byte[] encodeLength(int size) ASN.1 encode length value as length octets according to X.690, 8.1.3 Length octets
DER rules permit only the definite form without end marker.
intallows encoding lengths up to and including 0x7FFFFFFF and 5 bytes for encoded length is enough to fit such encoded length value.- Parameters:
size-- Returns:
-
decodeLength
public static int[] decodeLength(byte[] encoded) Decode length value in the passed byte array- Parameters:
encoded-- Returns:
- [ the length of the DER value, length of encoded length value ]
-
decodeLength
public static int[] decodeLength(byte[] encoded, int offset) Decode length value in the passed byte array starting fromoffset- Parameters:
encoded-offset-- Returns:
- [ the length of the DER value, length of encoded length value ]
-
parse
-
parse
-