public class X509Formatter
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
EKU |
private static java.util.Map<java.lang.String,java.lang.String> |
EXT_USAGES |
private FormatMode |
mode |
private static java.lang.String[] |
USAGES |
Constructor and Description |
---|
X509Formatter(FormatMode mode)
Creates a new X509Formatter object
|
Modifier and Type | Method and Description |
---|---|
private void |
appendAltNames(java.lang.StringBuilder sb,
java.lang.String info,
java.lang.String sep,
java.util.Collection<java.util.List<?>> altNames) |
java.lang.String |
format(java.security.cert.X509Certificate cert)
Produces a human readable text representation of the provided certificate.
|
java.lang.String |
format(java.security.cert.X509Certificate[] certChain)
Produces a human readable text representation of the provided certificate chain.
|
java.lang.String |
format(java.security.cert.X509Certificate[] certChain,
boolean preamble)
Produces a human readable text representation of the provided certificate chain.
|
private final FormatMode mode
private static final java.lang.String[] USAGES
private static final java.lang.String EKU
private static final java.util.Map<java.lang.String,java.lang.String> EXT_USAGES
public X509Formatter(FormatMode mode)
mode
- the formatting mode that will be used by this object.public java.lang.String format(java.security.cert.X509Certificate cert)
cert
- input certificateprivate void appendAltNames(java.lang.StringBuilder sb, java.lang.String info, java.lang.String sep, java.util.Collection<java.util.List<?>> altNames)
public java.lang.String format(java.security.cert.X509Certificate[] certChain)
certChain
- input certificatespublic java.lang.String format(java.security.cert.X509Certificate[] certChain, boolean preamble)
certChain
- input certificatespreamble
- whether to print a first line with an information on
the number of elements.