diff options
author | Yuuta Liang <yuutaw@students.cs.ubc.ca> | 2023-10-14 05:35:17 +0800 |
---|---|---|
committer | Yuuta Liang <yuutaw@students.cs.ubc.ca> | 2023-10-14 05:35:17 +0800 |
commit | 28fa18278c1f3a87722d5e8b78f581526a30bb38 (patch) | |
tree | 2f23f6e2e222a78f40809ec37e8b28a29cba3d3c /src/main/model/asn1/ASN1Length.java | |
parent | 0bcc057e741af3fbc108f42b75f9d42f48f6a51e (diff) | |
download | jca-28fa18278c1f3a87722d5e8b78f581526a30bb38.tar jca-28fa18278c1f3a87722d5e8b78f581526a30bb38.tar.gz jca-28fa18278c1f3a87722d5e8b78f581526a30bb38.tar.bz2 jca-28fa18278c1f3a87722d5e8b78f581526a30bb38.zip |
Fix lint
Signed-off-by: Yuuta Liang <yuutaw@students.cs.ubc.ca>
Diffstat (limited to 'src/main/model/asn1/ASN1Length.java')
-rw-r--r-- | src/main/model/asn1/ASN1Length.java | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/main/model/asn1/ASN1Length.java b/src/main/model/asn1/ASN1Length.java index e85689c..913b35a 100644 --- a/src/main/model/asn1/ASN1Length.java +++ b/src/main/model/asn1/ASN1Length.java @@ -4,8 +4,6 @@ import model.asn1.exceptions.ParseException; import model.asn1.parsing.BytesReader; import ui.Utils; -import java.util.Arrays; - /** * Represents the Length part in DER encoding. It appears after Tag and before Value. It represents the length of the * encoded Value in bytes. @@ -31,11 +29,11 @@ public class ASN1Length implements Encodable { /** * EFFECTS: Parse the length from the given DER input. - * Throws {@link ParseException} if the input is invalid: - * - Indefinite length - * - Not enough bytes - * - Initial byte 0b11111111 (See X.690$8.1.3.5) - * - Value too long (compliant to RFC but unsupported by this program): multibyte and # of bytes > 3 + * Throws {@link ParseException} if the input is invalid: + * - Indefinite length + * - Not enough bytes + * - Initial byte 0b11111111 (See X.690$8.1.3.5) + * - Value too long (compliant to RFC but unsupported by this program): multibyte and # of bytes > 3 * MODIFIES: reader (bytes are read, at least one byte, at most 5 bytes) */ public ASN1Length(BytesReader reader) throws ParseException { @@ -78,7 +76,7 @@ public class ASN1Length implements Encodable { // DER prefers the shortest form. if (length <= 127) { // Possible in a single byte. - return new Byte[]{ (byte) length }; + return new Byte[]{(byte) length}; } else { // Big-endian encoding of the length. DER uses big-endian. final Byte[] lengthBytes = Utils.valToByte(length); |