Class CertificateManager
- java.lang.Object
-
- pro.gravit.launchserver.manangers.CertificateManager
-
public class CertificateManager extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description org.bouncycastle.cert.X509CertificateHoldercaorg.bouncycastle.crypto.params.AsymmetricKeyParametercaKeyintminusHoursjava.lang.StringorgNameorg.bouncycastle.cert.X509CertificateHolderserverorg.bouncycastle.crypto.params.AsymmetricKeyParameterserverKeypro.gravit.launcher.LauncherTrustManagertrustManagerintvalidDays
-
Constructor Summary
Constructors Constructor Description CertificateManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckClass(java.lang.Class<?> clazz, pro.gravit.launcher.LauncherTrustManager.CheckMode mode)voidgenerateCA()org.bouncycastle.cert.X509CertificateHoldergenerateCertificate(java.lang.String subjectName, java.security.PublicKey subjectPublicKey)java.security.KeyPairgenerateKeyPair()org.bouncycastle.cert.X509CertificateHolderreadCertificate(java.io.Reader reader)org.bouncycastle.cert.X509CertificateHolderreadCertificate(java.nio.file.Path file)org.bouncycastle.crypto.params.AsymmetricKeyParameterreadPrivateKey(java.io.Reader reader)org.bouncycastle.crypto.params.AsymmetricKeyParameterreadPrivateKey(java.nio.file.Path file)voidreadTrustStore(java.nio.file.Path dir)voidwriteCertificate(java.io.Writer writer, org.bouncycastle.cert.X509CertificateHolder holder)voidwriteCertificate(java.nio.file.Path file, org.bouncycastle.cert.X509CertificateHolder holder)voidwritePrivateKey(java.io.Writer writer, java.security.PrivateKey privateKey)voidwritePrivateKey(java.io.Writer writer, org.bouncycastle.crypto.params.AsymmetricKeyParameter key)voidwritePrivateKey(java.nio.file.Path file, java.security.PrivateKey privateKey)voidwritePrivateKey(java.nio.file.Path file, org.bouncycastle.crypto.params.AsymmetricKeyParameter key)
-
-
-
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
-
validDays
public final int validDays
- See Also:
- Constant Field Values
-
minusHours
public final int minusHours
- See Also:
- Constant Field Values
-
orgName
public java.lang.String orgName
-
-
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.NoSuchAlgorithmExceptionjava.io.IOExceptionorg.bouncycastle.operator.OperatorCreationExceptionjava.security.InvalidAlgorithmParameterException
-
generateKeyPair
public java.security.KeyPair generateKeyPair() throws java.security.InvalidAlgorithmParameterException, java.security.NoSuchAlgorithmException- Throws:
java.security.InvalidAlgorithmParameterExceptionjava.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.IOExceptionjava.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
-
-