<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p><br>
</p>
<p>OtherName.java @93,97<br>
</p>
<pre class="moz-quote-pre" wrap="">PR: <a class="moz-txt-link-freetext" href="https://git.openjdk.java.net/jdk/pull/7167">https://git.openjdk.java.net/jdk/pull/7167</a>
</pre>
<p>
<blockquote type="cite"><font face="monospace"> if
(derValue1.isContextSpecific((byte) 0) &&
derValue1.isConstructed()) {<br>
nameValue = derValue1.data.toByteArray();<br>
} else {<br>
throw new IOException("value is not [0]");<br>
}</font></blockquote>
That exception string isn't correct (the value is usually not just
the tag), nor very descriptive. How about instead:</p>
<p> <font face="monospace">throw new IOException
("value is not EXPLICTly tagged [0]");</font></p>
<p>Also, the derValue1.data should be parseable into a DerValue
itself. Should that be checked here as well and an error thrown if
invalid? I.e., add this after nameValue = ...<br>
</p>
<blockquote>
<p><font face="monospace">try {<br>
new DerValue (nameValue);<br>
} catch (IOException ex) {<br>
throw new IOException ("Body of OtherName is not a valid
BER or DER value", ex);<br>
}</font></p>
<p><font face="monospace"><br>
</font></p>
</blockquote>
<p>Thanks - Mike</p>
<p><br>
</p>
</body>
</html>