Class PrintCertificate

  • All Implemented Interfaces:
    Serializable, Encodable

    public class PrintCertificate
    extends X509CertificateHolder
    This extension of the Bouncy castle X509CertificateHolder adds extended printing capabilities for outputting the certificate content to text or html
    Author:
    Stefan Santeson
    See Also:
    Serialized Form
    • Method Detail

      • getExtensionsMap

        public Map<String,​ExtensionInfo> getExtensionsMap()
        Extension info Map. Oid string as key
        Returns:
      • getPublicKey

        public PublicKey getPublicKey()
      • getBasicConstraints

        public int getBasicConstraints()
      • getIssuerX500Principal

        public X500Principal getIssuerX500Principal()
      • getSubjectX500Principal

        public X500Principal getSubjectX500Principal()
      • getExtensionValue

        public byte[] getExtensionValue​(String oid)
      • getSubjectKeyInfo

        public byte[] getSubjectKeyInfo()
      • toString

        public String toString​(boolean verbose)
        Generates a printout of the current certificate
        Parameters:
        verbose - set to true to print out explicit key parameter and signature values
        Returns:
        Print string
      • toString

        public String toString​(boolean monospace,
                               boolean verbose)
        Generates a printout of the current certificate
        Parameters:
        verbose - set to true to print out explicit key parameter and signature values
        Returns:
        Print string
      • toString

        public String toString​(boolean monospace,
                               boolean verbose,
                               boolean decode)
        Generates a printout of the current certificate
        Parameters:
        monospace - indicates that the print is done using monospace characters
        verbose - set to true to print out explicit key parameter and
        decode - set to true to decode name parameters signature values
        Returns:
        Print string
      • toOriginalString

        public String toOriginalString()
        Provides the original certificate print format provided by the X509Certificate class
        Returns:
        Print string
      • toHtml

        public String toHtml​(String heading,
                             CertTableClasses tableClasses,
                             boolean verbose,
                             boolean decodeSubject)
        Generates HTML print of the current certificate
        Parameters:
        heading - A heading to add to the print. Null if none.
        tableClasses - The html classes to be added to print table elements
        verbose - Set to true to display explicit values of key parameters and signature value
        decodeSubject - set to true to decode subject and issuer attributes for friendly display. False for the traditional one line X500 name print.
        Returns:
        html print
      • toHtml

        public String toHtml​(String heading,
                             boolean verbose,
                             boolean decodeSubject)
        Generates HTML print of the current certificate using default table classes.
        Parameters:
        heading - A heading to add to the print. Null if none.
        verbose - Set to true to display explicit values of key parameters and signature value
        decodeSubject -
        Returns:
        html print
      • toHtml

        public String toHtml​(boolean verbose)
        Generates HTML print of the current certificate using default table classes.
        Parameters:
        verbose - Set to true to display explicit values of key parameters and signature value
        Returns:
        html print
      • toHtml

        public String toHtml()
        Generates HTML print of the current certificate using default table classes.
        Returns:
        html print
      • toPEM

        public String toPEM()