data.add(subjectRow);
Vector publicKeyRow = new Vector();
publicKeyRow.add(new JLabel("Public Key", CertViewer.attributeIcon, SwingConstants.LEFT));
PublicKey pubKey = cert.getPublicKey();
String publicKeyString = pubKey.getAlgorithm();
if (pubKey instanceof RSAPublicKey)
publicKeyString = publicKeyString + " (" + ((RSAPublicKey) pubKey).getModulus().bitLength() + " Bits)";
else if (pubKey instanceof DSAPublicKey)
publicKeyString = publicKeyString + " (" + ((DSAPublicKey) pubKey).getY().bitLength() + " Bits)";
publicKeyRow.add(publicKeyString);
/*
if (pubKey instanceof RSAPublicKey)
briefDetails.put(publicKeyString, CBUtility.bytes2HexSplit(((RSAPublicKey)pubKey).getModulus().toByteArray(), 4, 36));
else
briefDetails.put(publicKeyString, StaticUtil.bytes2Hex(pubKey.getEncoded(), 4, 36));
*/
data.add(publicKeyRow);
}
if (viewMode == 0 || viewMode == 2)
{
Set nonCritSet = cert.getNonCriticalExtensionOIDs();
if (nonCritSet != null && !nonCritSet.isEmpty())
{
for (Iterator i = nonCritSet.iterator(); i.hasNext();)
{
String oid = (String)i.next();
Vector nonCritRow = new Vector();
String extname = getNameFromOID(oid);
nonCritRow.add(new JLabel(extname, CertViewer.extensionIcon, SwingConstants.LEFT));
addExtDetails(nonCritRow,
printext(extname, cert.getExtensionValue(oid)).toString());
data.add(nonCritRow);
}
}
}
if (viewMode == 0 || viewMode == 2 || viewMode == 3)
{
Set critSet = cert.getCriticalExtensionOIDs();
if (critSet != null && !critSet.isEmpty())
{
for (Iterator i = critSet.iterator(); i.hasNext();)
{
String oid = (String)i.next();
Vector critRow = new Vector();
String extname = getNameFromOID(oid);
critRow.add(new JLabel(extname, CertViewer.criticalExtensionIcon, SwingConstants.LEFT));
addExtDetails(critRow,
printext(extname, cert.getExtensionValue(oid)).toString());
data.add(critRow);
}