Class EblockerCa

java.lang.Object
org.eblocker.server.common.ssl.EblockerCa

public class EblockerCa extends Object
  • Field Details

    • MAX_VALIDITY_SERVER_IN_DAYS

      public static final int MAX_VALIDITY_SERVER_IN_DAYS
      See Also:
  • Constructor Details

    • EblockerCa

      public EblockerCa(org.eblocker.crypto.pki.CertificateAndKey certificateAndKey)
  • Method Details

    • getCertificate

      public X509Certificate getCertificate()
    • getKey

      public PrivateKey getKey()
    • generateServerCertificate

      public org.eblocker.crypto.pki.CertificateAndKey generateServerCertificate(String commonName, Date notValidAfter, List<String> subjectAlternativeNames) throws org.eblocker.crypto.CryptoException, IOException
      Throws:
      org.eblocker.crypto.CryptoException
      IOException
    • generateServerCertificate

      public org.eblocker.crypto.pki.CertificateAndKey generateServerCertificate(String commonName, KeyPair keyPair, Date notValidAfter, List<String> subjectAlternativeNames) throws org.eblocker.crypto.CryptoException, IOException
      Throws:
      org.eblocker.crypto.CryptoException
      IOException
    • getServerNotValidAfter

      public Date getServerNotValidAfter()
      Returns the end of the maximum lifetime of a server certificate. A server certificate can not be valid longer than the CA. In addition its lifetime can not be longer than 825 days.
      Returns:
    • writeToKeyStore

      public void writeToKeyStore(String alias, java.nio.file.Path keyStorePath, char[] keyStorePassword) throws IOException, org.eblocker.crypto.CryptoException
      Throws:
      IOException
      org.eblocker.crypto.CryptoException
    • loadFromKeyStore

      public static EblockerCa loadFromKeyStore(java.nio.file.Path keyStorePath, char[] keyStorePassword) throws PkiException
      Throws:
      PkiException
    • generateRootCa

      public static EblockerCa generateRootCa(String commonName, Date notBefore, Date notAfter, int caKeySize) throws org.eblocker.crypto.CryptoException
      Throws:
      org.eblocker.crypto.CryptoException