From 28fa18278c1f3a87722d5e8b78f581526a30bb38 Mon Sep 17 00:00:00 2001 From: Yuuta Liang Date: Sat, 14 Oct 2023 05:35:17 +0800 Subject: Fix lint Signed-off-by: Yuuta Liang --- src/main/model/pki/crl/CertificateList.java | 7 ++----- src/main/model/pki/crl/CertificateListContent.java | 14 +++++++------- src/main/model/pki/crl/RevokedCertificate.java | 20 ++++++++++---------- 3 files changed, 19 insertions(+), 22 deletions(-) (limited to 'src/main/model/pki/crl') diff --git a/src/main/model/pki/crl/CertificateList.java b/src/main/model/pki/crl/CertificateList.java index 5142101..8729561 100644 --- a/src/main/model/pki/crl/CertificateList.java +++ b/src/main/model/pki/crl/CertificateList.java @@ -3,10 +3,7 @@ package model.pki.crl; import model.asn1.ASN1Object; import model.asn1.BitString; import model.asn1.Tag; -import model.asn1.exceptions.ParseException; -import model.asn1.parsing.BytesReader; import model.pki.AlgorithmIdentifier; -import model.pki.cert.TbsCertificate; import java.util.Arrays; import java.util.Collection; @@ -56,8 +53,8 @@ public class CertificateList extends ASN1Object { @Override public Byte[] encodeValueDER() { return Stream.of(Arrays.asList(crl.encodeDER()), - Arrays.asList(signatureAlgorithm.encodeDER()), - Arrays.asList(signature.encodeDER())) + Arrays.asList(signatureAlgorithm.encodeDER()), + Arrays.asList(signature.encodeDER())) .flatMap(Collection::stream) .toArray(Byte[]::new); } diff --git a/src/main/model/pki/crl/CertificateListContent.java b/src/main/model/pki/crl/CertificateListContent.java index c7e901d..4cc96fb 100644 --- a/src/main/model/pki/crl/CertificateListContent.java +++ b/src/main/model/pki/crl/CertificateListContent.java @@ -31,7 +31,7 @@ import java.util.stream.Stream; * ..., * crlExtensions [0] Extensions OPTIONAL } * - * + *

* A CRL is a signed object published by the CA that revokes any certificates signed by this CA before their * expiration. Relying-parties should check the CRL from corresponding CDPs to see if the certificate to check is * already revoked. @@ -70,12 +70,12 @@ public class CertificateListContent extends ASN1Object { .flatMap(Arrays::stream) .collect(Collectors.toList()); return Stream.of(Arrays.asList(version.encodeDER()), - Arrays.asList(signature.encodeDER()), - Arrays.asList(issuer.encodeDER()), - Arrays.asList(thisUpdate.encodeDER()), - nextUpdate == null ? Collections.emptyList() : Arrays.asList(nextUpdate.encodeDER()), - Arrays.asList(new Tag(TagClass.UNIVERSAL, true, 0x30).encodeDER()), - Arrays.asList(new ASN1Length(itemsEncoded.size()).encodeDER()), itemsEncoded) + Arrays.asList(signature.encodeDER()), + Arrays.asList(issuer.encodeDER()), + Arrays.asList(thisUpdate.encodeDER()), + nextUpdate == null ? Collections.emptyList() : Arrays.asList(nextUpdate.encodeDER()), + Arrays.asList(new Tag(TagClass.UNIVERSAL, true, 0x30).encodeDER()), + Arrays.asList(new ASN1Length(itemsEncoded.size()).encodeDER()), itemsEncoded) .flatMap(Collection::stream) .toArray(Byte[]::new); } diff --git a/src/main/model/pki/crl/RevokedCertificate.java b/src/main/model/pki/crl/RevokedCertificate.java index 457ecb8..1f0afc1 100644 --- a/src/main/model/pki/crl/RevokedCertificate.java +++ b/src/main/model/pki/crl/RevokedCertificate.java @@ -38,22 +38,22 @@ public class RevokedCertificate extends ASN1Object { @Override public Byte[] encodeValueDER() { final Byte[] r = new OctetString(OctetString.TAG, - null, - new Byte[]{ 0x0A, 0x01, (byte) reason.getVal() }) - .encodeDER(); + null, + new Byte[]{0x0A, 0x01, (byte) reason.getVal()}) + .encodeDER(); final Byte[] oid = new ObjectIdentifier(ObjectIdentifier.TAG, null, ObjectIdentifier.OID_CRL_REASON) .encodeDER(); final Byte[] seqExt = Stream.of(Arrays.asList(TAG_SEQUENCE.encodeDER()), - Arrays.asList(new ASN1Length(r.length + oid.length).encodeDER()), - Arrays.asList(oid), - Arrays.asList(r)) + Arrays.asList(new ASN1Length(r.length + oid.length).encodeDER()), + Arrays.asList(oid), + Arrays.asList(r)) .flatMap(Collection::stream) .toArray(Byte[]::new); return Stream.of(Arrays.asList(serialNumber.encodeDER()), - Arrays.asList(revocationDate.encodeDER()), - Arrays.asList(TAG_SEQUENCE.encodeDER()), - Arrays.asList(new ASN1Length(seqExt.length).encodeDER()), - Arrays.asList(seqExt)) + Arrays.asList(revocationDate.encodeDER()), + Arrays.asList(TAG_SEQUENCE.encodeDER()), + Arrays.asList(new ASN1Length(seqExt.length).encodeDER()), + Arrays.asList(seqExt)) .flatMap(Collection::stream) .toArray(Byte[]::new); } -- cgit v1.2.3