aboutsummaryrefslogtreecommitdiff
path: root/src/test/model/pki/cert/ExtensionTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/model/pki/cert/ExtensionTest.java')
-rw-r--r--src/test/model/pki/cert/ExtensionTest.java42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/test/model/pki/cert/ExtensionTest.java b/src/test/model/pki/cert/ExtensionTest.java
index 06561ba..e00cbc5 100644
--- a/src/test/model/pki/cert/ExtensionTest.java
+++ b/src/test/model/pki/cert/ExtensionTest.java
@@ -11,19 +11,19 @@ import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
public class ExtensionTest {
- static final Byte[] EXT_SUBJECT_KEY_ID = new Byte[] {
+ static final Byte[] EXT_SUBJECT_KEY_ID = new Byte[]{
0x30, 0x1D, // SEQUENCE Extension
0x06, 0x03, 0x55, 0x1D, 0x0E, // OID subjectKeyIdentifier
0x04, 0x16, // OCTET STRING
- 0x04, 0x14, -79, -62, -89, -127, 0x63, 0x66,
- 0x4B, 0x72, 0x0A, -35, -3, 0x7D, 0x20, 0x29,
- -67, 0x6B, 0x49, 0x09, 0x61, -64
+ 0x04, 0x14, -79, -62, -89, -127, 0x63, 0x66,
+ 0x4B, 0x72, 0x0A, -35, -3, 0x7D, 0x20, 0x29,
+ -67, 0x6B, 0x49, 0x09, 0x61, -64
};
- static final Byte[] EXT_KEY_USAGE = new Byte[] {
+ static final Byte[] EXT_KEY_USAGE = new Byte[]{
0x30, 0x0E, // SEQUENCE Extension
0x06, 0x03, 0x55, 0x1D, 0x0F, // OID keyUsage
- 0x01, 0x01, -1, // BOOLEAN critical
+ 0x01, 0x01, -1, // BOOLEAN critical
0x04, 0x04, // OCTET STRING
0x03, 0x02, 0x01, -122
};
@@ -33,10 +33,10 @@ public class ExtensionTest {
final Extension ext = new Extension(ASN1Object.TAG_SEQUENCE, null,
new ObjectIdentifier(ObjectIdentifier.TAG, null, ObjectIdentifier.OID_BASIC_CONSTRAINTS),
new Bool(Bool.TAG, null, true),
- new OctetString(OctetString.TAG, null, new Byte[]{ 0x30, 0x03, 0x01, 0x01, -1 }));
+ new OctetString(OctetString.TAG, null, new Byte[]{0x30, 0x03, 0x01, 0x01, -1}));
assertArrayEquals(ObjectIdentifier.OID_BASIC_CONSTRAINTS, ext.getExtnId().getInts());
assertTrue(ext.getCritical().getValue());
- assertArrayEquals(new Byte[]{ 0x30, 0x03, 0x01, 0x01, -1 }, ext.getExtnValue().getBytes());
+ assertArrayEquals(new Byte[]{0x30, 0x03, 0x01, 0x01, -1}, ext.getExtnValue().getBytes());
}
@Test
@@ -44,16 +44,16 @@ public class ExtensionTest {
Extension parsed = new Extension(new BytesReader(EXT_SUBJECT_KEY_ID), false);
assertArrayEquals(ObjectIdentifier.OID_SUBJECT_KEY_IDENTIFIER, parsed.getExtnId().getInts());
assertNull(parsed.getCritical());
- assertArrayEquals(new Byte[] {
- 0x04, 0x14, -79, -62, -89, -127, 0x63, 0x66,
- 0x4B, 0x72, 0x0A, -35, -3, 0x7D, 0x20, 0x29,
- -67, 0x6B, 0x49, 0x09, 0x61, -64
+ assertArrayEquals(new Byte[]{
+ 0x04, 0x14, -79, -62, -89, -127, 0x63, 0x66,
+ 0x4B, 0x72, 0x0A, -35, -3, 0x7D, 0x20, 0x29,
+ -67, 0x6B, 0x49, 0x09, 0x61, -64
}, parsed.getExtnValue().getBytes());
parsed = new Extension(new BytesReader(EXT_KEY_USAGE), false);
assertArrayEquals(ObjectIdentifier.OID_KEY_USAGE, parsed.getExtnId().getInts());
assertTrue(parsed.getCritical().getValue());
- assertArrayEquals(new Byte[] {
+ assertArrayEquals(new Byte[]{
0x03, 0x02, 0x01, -122
}, parsed.getExtnValue().getBytes());
}
@@ -68,7 +68,7 @@ public class ExtensionTest {
assertThrows(ParseException.class, () -> new Extension(new BytesReader(new Byte[]{
0x30, 0x0E, // SEQUENCE Extension
0x07, 0x03, 0x55, 0x1D, 0x0F, // OID keyUsage
- 0x01, 0x01, -1, // BOOLEAN critical
+ 0x01, 0x01, -1, // BOOLEAN critical
0x04, 0x04, // OCTET STRING
0x03, 0x02, 0x01, -122
}), false));
@@ -76,7 +76,7 @@ public class ExtensionTest {
assertThrows(ParseException.class, () -> new Extension(new BytesReader(new Byte[]{
0x30, 0x0E, // SEQUENCE Extension
0x06, 0x03, 0x55, 0x1D, 0x0F, // OID keyUsage
- 0x05, 0x01, -1, // BOOLEAN critical
+ 0x05, 0x01, -1, // BOOLEAN critical
0x04, 0x04, // OCTET STRING
0x03, 0x02, 0x01, -122
}), false));
@@ -84,7 +84,7 @@ public class ExtensionTest {
assertThrows(ParseException.class, () -> new Extension(new BytesReader(new Byte[]{
0x30, 0x0E, // SEQUENCE Extension
0x06, 0x03, 0x55, 0x1D, 0x0F, // OID keyUsage
- 0x01, 0x01, -1, // BOOLEAN critical
+ 0x01, 0x01, -1, // BOOLEAN critical
0x09, 0x04, // OCTET STRING
0x03, 0x02, 0x01, -122
}), false));
@@ -103,15 +103,15 @@ public class ExtensionTest {
assertArrayEquals(EXT_SUBJECT_KEY_ID, new Extension(ASN1Object.TAG_SEQUENCE, null,
new ObjectIdentifier(ObjectIdentifier.TAG, null, ObjectIdentifier.OID_SUBJECT_KEY_IDENTIFIER),
null,
- new OctetString(OctetString.TAG, null, new Byte[] {
- 0x04, 0x14, -79, -62, -89, -127, 0x63, 0x66,
- 0x4B, 0x72, 0x0A, -35, -3, 0x7D, 0x20, 0x29,
- -67, 0x6B, 0x49, 0x09, 0x61, -64
+ new OctetString(OctetString.TAG, null, new Byte[]{
+ 0x04, 0x14, -79, -62, -89, -127, 0x63, 0x66,
+ 0x4B, 0x72, 0x0A, -35, -3, 0x7D, 0x20, 0x29,
+ -67, 0x6B, 0x49, 0x09, 0x61, -64
})).encodeDER());
assertArrayEquals(EXT_KEY_USAGE, new Extension(ASN1Object.TAG_SEQUENCE, null,
new ObjectIdentifier(ObjectIdentifier.TAG, null, ObjectIdentifier.OID_KEY_USAGE),
new Bool(Bool.TAG, null, true),
- new OctetString(OctetString.TAG, null, new Byte[] {
+ new OctetString(OctetString.TAG, null, new Byte[]{
0x03, 0x02, 0x01, -122
})).encodeDER());
}