Class CertificateManager


  • public class CertificateManager
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      org.bouncycastle.cert.X509CertificateHolder ca  
      org.bouncycastle.crypto.params.AsymmetricKeyParameter caKey  
      int minusHours  
      java.lang.String orgName  
      org.bouncycastle.cert.X509CertificateHolder server  
      org.bouncycastle.crypto.params.AsymmetricKeyParameter serverKey  
      pro.gravit.launcher.LauncherTrustManager trustManager  
      int validDays  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void checkClass​(java.lang.Class<?> clazz, pro.gravit.launcher.LauncherTrustManager.CheckMode mode)  
      void generateCA()  
      org.bouncycastle.cert.X509CertificateHolder generateCertificate​(java.lang.String subjectName, java.security.PublicKey subjectPublicKey)  
      java.security.KeyPair generateKeyPair()  
      org.bouncycastle.cert.X509CertificateHolder readCertificate​(java.io.Reader reader)  
      org.bouncycastle.cert.X509CertificateHolder readCertificate​(java.nio.file.Path file)  
      org.bouncycastle.crypto.params.AsymmetricKeyParameter readPrivateKey​(java.io.Reader reader)  
      org.bouncycastle.crypto.params.AsymmetricKeyParameter readPrivateKey​(java.nio.file.Path file)  
      void readTrustStore​(java.nio.file.Path dir)  
      void writeCertificate​(java.io.Writer writer, org.bouncycastle.cert.X509CertificateHolder holder)  
      void writeCertificate​(java.nio.file.Path file, org.bouncycastle.cert.X509CertificateHolder holder)  
      void writePrivateKey​(java.io.Writer writer, java.security.PrivateKey privateKey)  
      void writePrivateKey​(java.io.Writer writer, org.bouncycastle.crypto.params.AsymmetricKeyParameter key)  
      void writePrivateKey​(java.nio.file.Path file, java.security.PrivateKey privateKey)  
      void writePrivateKey​(java.nio.file.Path file, org.bouncycastle.crypto.params.AsymmetricKeyParameter key)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • ca

        public org.bouncycastle.cert.X509CertificateHolder ca
      • caKey

        public org.bouncycastle.crypto.params.AsymmetricKeyParameter caKey
      • server

        public org.bouncycastle.cert.X509CertificateHolder server
      • serverKey

        public org.bouncycastle.crypto.params.AsymmetricKeyParameter serverKey
      • trustManager

        public pro.gravit.launcher.LauncherTrustManager trustManager
      • orgName

        public java.lang.String orgName
    • Constructor Detail

      • CertificateManager

        public CertificateManager()
    • Method Detail

      • generateCertificate

        public org.bouncycastle.cert.X509CertificateHolder generateCertificate​(java.lang.String subjectName,
                                                                               java.security.PublicKey subjectPublicKey)
                                                                        throws org.bouncycastle.operator.OperatorCreationException
        Throws:
        org.bouncycastle.operator.OperatorCreationException
      • generateCA

        public void generateCA()
                        throws java.security.NoSuchAlgorithmException,
                               java.io.IOException,
                               org.bouncycastle.operator.OperatorCreationException,
                               java.security.InvalidAlgorithmParameterException
        Throws:
        java.security.NoSuchAlgorithmException
        java.io.IOException
        org.bouncycastle.operator.OperatorCreationException
        java.security.InvalidAlgorithmParameterException
      • generateKeyPair

        public java.security.KeyPair generateKeyPair()
                                              throws java.security.InvalidAlgorithmParameterException,
                                                     java.security.NoSuchAlgorithmException
        Throws:
        java.security.InvalidAlgorithmParameterException
        java.security.NoSuchAlgorithmException
      • writePrivateKey

        public void writePrivateKey​(java.nio.file.Path file,
                                    java.security.PrivateKey privateKey)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • writePrivateKey

        public void writePrivateKey​(java.io.Writer writer,
                                    java.security.PrivateKey privateKey)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • writePrivateKey

        public void writePrivateKey​(java.nio.file.Path file,
                                    org.bouncycastle.crypto.params.AsymmetricKeyParameter key)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • writePrivateKey

        public void writePrivateKey​(java.io.Writer writer,
                                    org.bouncycastle.crypto.params.AsymmetricKeyParameter key)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • writeCertificate

        public void writeCertificate​(java.nio.file.Path file,
                                     org.bouncycastle.cert.X509CertificateHolder holder)
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • writeCertificate

        public void writeCertificate​(java.io.Writer writer,
                                     org.bouncycastle.cert.X509CertificateHolder holder)
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • readPrivateKey

        public org.bouncycastle.crypto.params.AsymmetricKeyParameter readPrivateKey​(java.nio.file.Path file)
                                                                             throws java.io.IOException
        Throws:
        java.io.IOException
      • readPrivateKey

        public org.bouncycastle.crypto.params.AsymmetricKeyParameter readPrivateKey​(java.io.Reader reader)
                                                                             throws java.io.IOException
        Throws:
        java.io.IOException
      • readCertificate

        public org.bouncycastle.cert.X509CertificateHolder readCertificate​(java.nio.file.Path file)
                                                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • readCertificate

        public org.bouncycastle.cert.X509CertificateHolder readCertificate​(java.io.Reader reader)
                                                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • readTrustStore

        public void readTrustStore​(java.nio.file.Path dir)
                            throws java.io.IOException,
                                   java.security.cert.CertificateException
        Throws:
        java.io.IOException
        java.security.cert.CertificateException
      • checkClass

        public void checkClass​(java.lang.Class<?> clazz,
                               pro.gravit.launcher.LauncherTrustManager.CheckMode mode)
                        throws java.lang.SecurityException
        Throws:
        java.lang.SecurityException