diff options
author | Ade Lee <alee@redhat.com> | 2011-12-08 21:15:59 -0500 |
---|---|---|
committer | Ade Lee <alee@redhat.com> | 2011-12-08 21:15:59 -0500 |
commit | 171aaece4f23709d33d180cf36eb3af5e454b0c9 (patch) | |
tree | 1485f9f0a7bd10de4ff25030db575dbb8dafae74 /pki/base/util/src/netscape/security/x509/GeneralSubtree.java | |
parent | adad2fcee8a29fdb82376fbce07dedb11fccc182 (diff) | |
download | pki-171aaece4f23709d33d180cf36eb3af5e454b0c9.tar.gz pki-171aaece4f23709d33d180cf36eb3af5e454b0c9.tar.xz pki-171aaece4f23709d33d180cf36eb3af5e454b0c9.zip |
Revert "Formatting"
This reverts commit 32150d3ee32f8ac27118af7c792794b538c78a2f.
Diffstat (limited to 'pki/base/util/src/netscape/security/x509/GeneralSubtree.java')
-rw-r--r-- | pki/base/util/src/netscape/security/x509/GeneralSubtree.java | 72 |
1 files changed, 34 insertions, 38 deletions
diff --git a/pki/base/util/src/netscape/security/x509/GeneralSubtree.java b/pki/base/util/src/netscape/security/x509/GeneralSubtree.java index 4182e6121..84ceca96d 100644 --- a/pki/base/util/src/netscape/security/x509/GeneralSubtree.java +++ b/pki/base/util/src/netscape/security/x509/GeneralSubtree.java @@ -26,7 +26,6 @@ import netscape.security.util.PrettyPrintFormat; /** * Represent the GeneralSubtree ASN.1 object, whose syntax is: - * * <pre> * GeneralSubtree ::= SEQUENCE { * base GeneralName, @@ -35,7 +34,6 @@ import netscape.security.util.PrettyPrintFormat; * } * BaseDistance ::= INTEGER (0..MAX) * </pre> - * * @version 1.5 * @author Amit Kapoor * @author Hemma Prafullchandra @@ -43,17 +41,17 @@ import netscape.security.util.PrettyPrintFormat; public class GeneralSubtree { private static final byte TAG_MIN = 0; private static final byte TAG_MAX = 1; - private static final int MIN_DEFAULT = 0; + private static final int MIN_DEFAULT = 0; - private GeneralName name; - private int minimum = MIN_DEFAULT; - private int maximum = -1; + private GeneralName name; + private int minimum = MIN_DEFAULT; + private int maximum = -1; private PrettyPrintFormat pp = new PrettyPrintFormat(":"); /** * The default constructor for the class. - * + * * @param name the GeneralName * @param min the minimum BaseDistance * @param max the maximum BaseDistance @@ -66,7 +64,7 @@ public class GeneralSubtree { /** * Create the object from its DER encoded form. - * + * * @param val the DER encoded from of the same. */ public GeneralSubtree(DerValue val) throws IOException { @@ -83,13 +81,13 @@ public class GeneralSubtree { if (opt.isContextSpecific(TAG_MIN) && !opt.isConstructed()) { opt.resetTag(DerValue.tag_Integer); - minimum = (opt.getInteger()).toInt(); + minimum = (opt.getInteger()).toInt(); } else if (opt.isContextSpecific(TAG_MAX) && !opt.isConstructed()) { opt.resetTag(DerValue.tag_Integer); - maximum = (opt.getInteger()).toInt(); - } else - throw new IOException("Invalid encoding of GeneralSubtree."); + maximum = (opt.getInteger()).toInt(); + } else + throw new IOException("Invalid encoding of GeneralSubtree."); } } @@ -97,33 +95,32 @@ public class GeneralSubtree { * Return a printable string of the GeneralSubtree. */ public String toString() { - String s = "\n GeneralSubtree: [\n" + " GeneralName: " - + ((name == null) ? "" : name.toString()) + "\n Minimum: " - + minimum; - if (maximum == -1) { - s += "\t Maximum: undefined"; - } else - s += "\t Maximum: " + maximum; - s += " ]\n"; + String s = "\n GeneralSubtree: [\n" + + " GeneralName: " + ((name == null) ? "" : name.toString()) + + "\n Minimum: " + minimum; + if (maximum == -1) { + s += "\t Maximum: undefined"; + } else + s += "\t Maximum: " + maximum; + s += " ]\n"; return (s); } public String toPrint(int indent) { - String s = "\n" + pp.indent(indent) + "GeneralSubtree: [\n" - + pp.indent(indent + 2) + "GeneralName: " - + ((name == null) ? "" : name.toString()) + "\n" - + pp.indent(indent + 2) + "Minimum: " + minimum; - if (maximum == -1) { - s += "\n" + pp.indent(indent + 2) + "Maximum: undefined"; - } else - s += "\n" + pp.indent(indent + 2) + "Maximum: " + maximum; - s += "]\n"; + String s = "\n"+pp.indent(indent) + "GeneralSubtree: [\n" + pp.indent(indent+2) + + "GeneralName: " + ((name == null) ? "" : name.toString()) + + "\n"+pp.indent(indent+2) + "Minimum: " + minimum; + if (maximum == -1) { + s += "\n" + pp.indent(indent+2) + "Maximum: undefined"; + } else + s += "\n" + pp.indent(indent+2) + "Maximum: " + maximum; + s += "]\n"; return (s); } /** * Encode the GeneralSubtree. - * + * * @param out the DerOutputStream to encode this object to. */ public void encode(DerOutputStream out) throws IOException { @@ -131,21 +128,20 @@ public class GeneralSubtree { name.encode(seq); - if (minimum != MIN_DEFAULT) { + if (minimum != MIN_DEFAULT) + { DerOutputStream tmp = new DerOutputStream(); tmp.putInteger(new BigInt(minimum)); - seq.writeImplicit( - DerValue.createTag(DerValue.TAG_CONTEXT, false, TAG_MIN), - tmp); + seq.writeImplicit(DerValue.createTag(DerValue.TAG_CONTEXT, + false, TAG_MIN), tmp); } if (maximum != -1) { DerOutputStream tmp = new DerOutputStream(); tmp.putInteger(new BigInt(maximum)); - seq.writeImplicit( - DerValue.createTag(DerValue.TAG_CONTEXT, false, TAG_MAX), - tmp); + seq.writeImplicit(DerValue.createTag(DerValue.TAG_CONTEXT, + false, TAG_MAX), tmp); } - out.write(DerValue.tag_Sequence, seq); + out.write(DerValue.tag_Sequence,seq); } public GeneralName getGeneralName() { |