Package net.dona.doip.util.tls

# Class X509CertificateGenerator

java.lang.Object
net.dona.doip.util.tls.X509CertificateGenerator

public class X509CertificateGenerator extends Object
Utility methods to generate X509 certificates, and to read and write certificates from and to PEM files.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `X509CertificateGenerator()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static X509Certificate`
  `generate(String handle, int index, PublicKey pubKey, PrivateKey privKey)`
  `static X509Certificate`
  `generate(String handle, PublicKey pubKey, PrivateKey privKey)`
  `static X509Certificate`
  `generateWithCnAndUid(String cn, String uid, PublicKey pubKey, PrivateKey privKey)`
  `static X509Certificate`
  `generateWithUid(String uid, PublicKey pubKey, PrivateKey privKey)`
  `static X509Certificate`
  `readCertAsPem(Reader reader)`
  `static X509Certificate[]`
  `readCertChainAsPem(Reader reader)`
  `static void`
  `storeCertAndKey(KeyStore keyStore, Certificate cert, PrivateKey privKey, String alias, String keyPass)`
  `static void`
  `writeCertAsPem(Writer writer, Certificate cert)`

  ### Methods inherited from class java.lang.Object

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

- ## Constructor Details

  - ### X509CertificateGenerator

    public X509CertificateGenerator()

- ## Method Details

  - ### generate

    public static X509Certificate generate(String handle, PublicKey pubKey, PrivateKey privKey) throws Exception
    Throws:
      `Exception`

  - ### generate

    public static X509Certificate generate(String handle, int index, PublicKey pubKey, PrivateKey privKey) throws Exception
    Throws:
      `Exception`

  - ### generateWithUid

    public static X509Certificate generateWithUid(String uid, PublicKey pubKey, PrivateKey privKey) throws Exception
    Throws:
      `Exception`

  - ### generateWithCnAndUid

    public static X509Certificate generateWithCnAndUid(String cn, String uid, PublicKey pubKey, PrivateKey privKey) throws Exception
    Throws:
      `Exception`

  - ### storeCertAndKey

    public static void storeCertAndKey(KeyStore keyStore, Certificate cert, PrivateKey privKey, String alias, String keyPass) throws KeyStoreException
    Throws:
      `KeyStoreException`

  - ### writeCertAsPem

    public static void writeCertAsPem(Writer writer, Certificate cert) throws IOException
    Throws:
      `IOException`

  - ### readCertAsPem

    public static X509Certificate readCertAsPem(Reader reader) throws IOException
    Throws:
      `IOException`

  - ### readCertChainAsPem

    public static X509Certificate[] readCertChainAsPem(Reader reader) throws IOException
    Throws:
      `IOException`