aboutsummaryrefslogtreecommitdiff
path: root/src/main/model/csr
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/model/csr')
-rw-r--r--src/main/model/csr/Attribute.java16
-rw-r--r--src/main/model/csr/Attributes.java4
-rw-r--r--src/main/model/csr/CertificationRequest.java16
-rw-r--r--src/main/model/csr/CertificationRequestInfo.java18
-rw-r--r--src/main/model/csr/Values.java4
5 files changed, 29 insertions, 29 deletions
diff --git a/src/main/model/csr/Attribute.java b/src/main/model/csr/Attribute.java
index 2fa319b..2daa000 100644
--- a/src/main/model/csr/Attribute.java
+++ b/src/main/model/csr/Attribute.java
@@ -18,7 +18,7 @@ import java.util.stream.Stream;
* values SET SIZE(1..MAX) OF ATTRIBUTE.&Type({IOSet}{@type})
* }
* </pre>
- *
+ * <p>
* Represents a key - values pair in the CSR attribute.
*/
public class Attribute extends ASN1Object {
@@ -38,7 +38,7 @@ public class Attribute extends ASN1Object {
* REQUIRES: The values must match the type. Type tag should be UNIVERSAL OID, and values should be SET OF.
*/
public Attribute(Tag tag, Tag parentTag,
- ObjectIdentifier type, Values values) {
+ ObjectIdentifier type, Values values) {
super(tag, parentTag);
this.type = type;
this.values = values;
@@ -46,11 +46,11 @@ public class Attribute extends ASN1Object {
/**
* EFFECTS: Parse input DER. Value is not checked against the type.
- * Throws {@link ASN1Object} if invalid:
- * - Any fields missing (info, algorithm, signature)
- * - Any fields having an incorrect tag (as seen in the ASN.1 definition)
- * - Any fields with encoding instructions that violate implicit / explicit encoding rules
- * - Other issues found during parsing the object, like early EOF (see {@link ASN1Object})
+ * Throws {@link ASN1Object} if invalid:
+ * - Any fields missing (info, algorithm, signature)
+ * - Any fields having an incorrect tag (as seen in the ASN.1 definition)
+ * - Any fields with encoding instructions that violate implicit / explicit encoding rules
+ * - Other issues found during parsing the object, like early EOF (see {@link ASN1Object})
* MODIFIES: this, encoded
*/
public Attribute(BytesReader encoded, boolean hasParentTag) throws ParseException {
@@ -68,7 +68,7 @@ public class Attribute extends ASN1Object {
@Override
public Byte[] encodeValueDER() {
return Stream.of(Arrays.asList(type.encodeDER()),
- Arrays.asList(values.encodeDER()))
+ Arrays.asList(values.encodeDER()))
.flatMap(Collection::stream)
.toArray(Byte[]::new);
}
diff --git a/src/main/model/csr/Attributes.java b/src/main/model/csr/Attributes.java
index 6819e71..302741d 100644
--- a/src/main/model/csr/Attributes.java
+++ b/src/main/model/csr/Attributes.java
@@ -31,13 +31,13 @@ public class Attributes extends ASN1Object {
/**
* EFFECT: Parse the list from input DER bytes. For details on parsing, refer to {@link ASN1Object}.
- * Throws {@link ParseException} for invalid input.
+ * Throws {@link ParseException} for invalid input.
* MODIFIES: this, encoded
*/
public Attributes(BytesReader encoded, boolean hasParentTag) throws ParseException {
super(encoded, hasParentTag);
final List<Attribute> list = new ArrayList<>();
- for (int i = 0; i < getLength();) {
+ for (int i = 0; i < getLength(); ) {
int index = encoded.getIndex();
final Attribute attribute = new Attribute(encoded, false);
attribute.getTag().enforce(TAG_SEQUENCE);
diff --git a/src/main/model/csr/CertificationRequest.java b/src/main/model/csr/CertificationRequest.java
index c08997c..64203f9 100644
--- a/src/main/model/csr/CertificationRequest.java
+++ b/src/main/model/csr/CertificationRequest.java
@@ -20,7 +20,7 @@ import java.util.stream.Stream;
* signature BIT STRING
* }
* </pre>
- *
+ * <p>
* A CSR is used to request a certificate from a CA, using a public key. The client encodes a CSR with
* its subject name, public key, and attributes, and sign that with their private key. The private key
* must match the public key encoded in the CSR. This is to prove to the CA that the client has the private
@@ -65,11 +65,11 @@ public class CertificationRequest extends ASN1Object {
/**
* EFFECTS: Parse input DER CSR, without verifying the signature.
- * Throws {@link ParseException} if the input is invalid:
- * - Any fields missing (info, algorithm, signature)
- * - Any fields having an incorrect tag (as seen in the ASN.1 definition)
- * - Any fields with encoding instructions that violate implicit / explicit encoding rules
- * - Other issues found during parsing the object, like early EOF (see {@link ASN1Object})
+ * Throws {@link ParseException} if the input is invalid:
+ * - Any fields missing (info, algorithm, signature)
+ * - Any fields having an incorrect tag (as seen in the ASN.1 definition)
+ * - Any fields with encoding instructions that violate implicit / explicit encoding rules
+ * - Other issues found during parsing the object, like early EOF (see {@link ASN1Object})
* MODIFIES: this, encoded
*/
public CertificationRequest(BytesReader encoded, boolean hasParentTag) throws ParseException {
@@ -90,8 +90,8 @@ public class CertificationRequest extends ASN1Object {
@Override
public Byte[] encodeValueDER() {
return Stream.of(Arrays.asList(certificationRequestInfo.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/csr/CertificationRequestInfo.java b/src/main/model/csr/CertificationRequestInfo.java
index 425dba9..8f68ac8 100644
--- a/src/main/model/csr/CertificationRequestInfo.java
+++ b/src/main/model/csr/CertificationRequestInfo.java
@@ -28,7 +28,7 @@ import java.util.stream.Stream;
* }
*
* </pre>
- *
+ * <p>
* It represents all information of a CSR (version, subject, public key, attributes).
* It will be signed, and the signature is in {@link CertificationRequest}.
*/
@@ -71,11 +71,11 @@ public class CertificationRequestInfo extends ASN1Object {
/**
* EFFECTS: Parse the object with the given DER input.
- * Throws {@link ParseException} if the input is invalid:
- * - Any fields missing (version, subject, subjectPKInfo, attributes)
- * - Any fields having an incorrect tag (as seen in the ASN.1 definition)
- * - Any fields with encoding instructions that violate implicit / explicit encoding rules
- * - Other issues found during parsing the object, like early EOF (see {@link ASN1Object})
+ * Throws {@link ParseException} if the input is invalid:
+ * - Any fields missing (version, subject, subjectPKInfo, attributes)
+ * - Any fields having an incorrect tag (as seen in the ASN.1 definition)
+ * - Any fields with encoding instructions that violate implicit / explicit encoding rules
+ * - Other issues found during parsing the object, like early EOF (see {@link ASN1Object})
* MODIFIES: this, encoded
*/
public CertificationRequestInfo(BytesReader encoded, boolean hasParentTag) throws ParseException {
@@ -102,9 +102,9 @@ public class CertificationRequestInfo extends ASN1Object {
@Override
public Byte[] encodeValueDER() {
return Stream.of(Arrays.asList(version.encodeDER()),
- Arrays.asList(subject.encodeDER()),
- Arrays.asList(subjectPKInfo.encodeDER()),
- Arrays.asList(attributes.encodeDER()))
+ Arrays.asList(subject.encodeDER()),
+ Arrays.asList(subjectPKInfo.encodeDER()),
+ Arrays.asList(attributes.encodeDER()))
.flatMap(Collection::stream)
.toArray(Byte[]::new);
}
diff --git a/src/main/model/csr/Values.java b/src/main/model/csr/Values.java
index 5c1e212..f461686 100644
--- a/src/main/model/csr/Values.java
+++ b/src/main/model/csr/Values.java
@@ -36,13 +36,13 @@ public class Values extends ASN1Object {
/**
* EFFECT: Parse the list from input DER bytes. For details on parsing, refer to {@link ASN1Object}.
- * Throws {@link ParseException} for invalid input.
+ * Throws {@link ParseException} for invalid input.
* MODIFIES: this, encoded
*/
public Values(BytesReader encoded, boolean hasParentTag) throws ParseException {
super(encoded, hasParentTag);
final List<ASN1Object> list = new ArrayList<>();
- for (int i = 0; i < getLength();) {
+ for (int i = 0; i < getLength(); ) {
int index = encoded.getIndex();
final ASN1Object value = ASN1Object.parse(encoded, false);
list.add(value);