# Class CSCertificateIO

java.lang.Object
com.io7m.certusine.vanilla.internal.CSCertificateIO

public final class CSCertificateIO extends Object
Functions to encode and decode certificates.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static String`
  `encodeCertificate(X509Certificate certificate)`
  Encode a chain of X509 certificates as a PEM-encoded string.
  `static String`
  `encodeCertificates(List<X509Certificate> certificateChain)`
  Encode a chain of X509 certificates as a PEM-encoded string.
  `static String`
  `encodePrivateKey(PrivateKey key)`
  Encode private key as a PEM-encoded string.
  `static String`
  `encodePublicKey(PublicKey key)`
  Encode public key as a PEM-encoded string.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### encodeCertificates

    public static String encodeCertificates(List<X509Certificate> certificateChain) throws IOException
    Encode a chain of X509 certificates as a PEM-encoded string.
    Parameters:
      `certificateChain` - The certificates
    Returns:
      A PEM string
    Throws:
      `IOException` - On errors

  - ### encodeCertificate

    public static String encodeCertificate(X509Certificate certificate) throws IOException
    Encode a chain of X509 certificates as a PEM-encoded string.
    Parameters:
      `certificate` - The certificate
    Returns:
      A PEM string
    Throws:
      `IOException` - On errors

  - ### encodePublicKey

    public static String encodePublicKey(PublicKey key) throws IOException
    Encode public key as a PEM-encoded string.
    Parameters:
      `key` - The key
    Returns:
      A PEM string
    Throws:
      `IOException` - On errors

  - ### encodePrivateKey

    public static String encodePrivateKey(PrivateKey key) throws IOException
    Encode private key as a PEM-encoded string.
    Parameters:
      `key` - The key
    Returns:
      A PEM string
    Throws:
      `IOException` - On errors