diff options
Diffstat (limited to 'pki/base/util/src/netscape/security/x509/EDIPartyName.java')
-rw-r--r-- | pki/base/util/src/netscape/security/x509/EDIPartyName.java | 52 |
1 files changed, 27 insertions, 25 deletions
diff --git a/pki/base/util/src/netscape/security/x509/EDIPartyName.java b/pki/base/util/src/netscape/security/x509/EDIPartyName.java index 92f713ca2..4325e15b0 100644 --- a/pki/base/util/src/netscape/security/x509/EDIPartyName.java +++ b/pki/base/util/src/netscape/security/x509/EDIPartyName.java @@ -24,14 +24,15 @@ import netscape.security.util.DerOutputStream; import netscape.security.util.DerValue; /** - * This class defines the EDIPartyName of the GeneralName choice. - * The ASN.1 syntax for this is: + * This class defines the EDIPartyName of the GeneralName choice. The ASN.1 + * syntax for this is: + * * <pre> * EDIPartyName ::= SEQUENCE { * nameAssigner [0] DirectoryString OPTIONAL, * partyName [1] DirectoryString } * </pre> - * + * * @author Hemma Prafullchandra * @version 1.2 * @see GeneralName @@ -53,7 +54,7 @@ public class EDIPartyName implements GeneralNameInterface { /** * Create the EDIPartyName object from the specified names. - * + * * @param assignerName the name of the assigner * @param partyName the name of the EDI party. */ @@ -64,7 +65,7 @@ public class EDIPartyName implements GeneralNameInterface { /** * Create the EDIPartyName object from the specified name. - * + * * @param partyName the name of the EDI party. */ public EDIPartyName(String partyName) { @@ -73,10 +74,10 @@ public class EDIPartyName implements GeneralNameInterface { /** * Create the EDIPartyName object from the passed encoded Der value. - * + * * @param derValue the encoded DER EDIPartyName. * @exception IOException on error. - */ + */ public EDIPartyName(DerValue derValue) throws IOException { DerInputStream in = new DerInputStream(derValue.toByteArray()); DerValue[] seq = in.getSequence(2); @@ -87,20 +88,20 @@ public class EDIPartyName implements GeneralNameInterface { for (int i = 0; i < len; i++) { DerValue opt = seq[i]; - if (opt.isContextSpecific((byte)TAG_ASSIGNER) && - !opt.isConstructed()) { + if (opt.isContextSpecific((byte) TAG_ASSIGNER) + && !opt.isConstructed()) { if (assigner != null) throw new IOException("Duplicate nameAssigner found in" - + " EDIPartyName"); - opt = opt.data.getDerValue(); + + " EDIPartyName"); + opt = opt.data.getDerValue(); assigner = opt.getAsString(); } - if (opt.isContextSpecific((byte)TAG_PARTYNAME) && - !opt.isConstructed()) { + if (opt.isContextSpecific((byte) TAG_PARTYNAME) + && !opt.isConstructed()) { if (party != null) throw new IOException("Duplicate partyName found in" - + " EDIPartyName"); - opt = opt.data.getDerValue(); + + " EDIPartyName"); + opt = opt.data.getDerValue(); party = opt.getAsString(); } } @@ -115,7 +116,7 @@ public class EDIPartyName implements GeneralNameInterface { /** * Encode the EDI party name into the DerOutputStream. - * + * * @param out the DER stream to encode the EDIPartyName to. * @exception IOException on encoding errors. */ @@ -127,16 +128,17 @@ public class EDIPartyName implements GeneralNameInterface { DerOutputStream tmp2 = new DerOutputStream(); // XXX - shd check is chars fit into PrintableString tmp2.putPrintableString(assigner); - tagged.write(DerValue.createTag(DerValue.TAG_CONTEXT, - false, TAG_ASSIGNER), tmp2); + tagged.write(DerValue.createTag(DerValue.TAG_CONTEXT, false, + TAG_ASSIGNER), tmp2); } if (party == null) - throw new IOException("Cannot have null partyName"); + throw new IOException("Cannot have null partyName"); // XXX - shd check is chars fit into PrintableString tmp.putPrintableString(party); - tagged.write(DerValue.createTag(DerValue.TAG_CONTEXT, - false, TAG_PARTYNAME), tmp); + tagged.write( + DerValue.createTag(DerValue.TAG_CONTEXT, false, TAG_PARTYNAME), + tmp); out.write(DerValue.tag_Sequence, tagged); } @@ -145,9 +147,9 @@ public class EDIPartyName implements GeneralNameInterface { * Return the printable string. */ public String toString() { - return ("EDIPartyName: " + - ((assigner == null) ? "" : - (" nameAssigner = " + assigner + ",")) - + " partyName = " + party); + return ("EDIPartyName: " + + ((assigner == null) ? "" + : (" nameAssigner = " + assigner + ",")) + + " partyName = " + party); } } |