Class CertificateUtils
- java.lang.Object
-
- com.qualys.plugins.containerSecurity.util.CertificateUtils
-
public class CertificateUtils extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static KeyStore
createKeyStore(String keypem, String certpem)
static KeyStore
createTrustStore(Reader certReader)
"ca.pem" from Readerstatic KeyStore
createTrustStore(String capem)
"ca.pem" from Stringstatic List<Certificate>
loadCertificates(Reader reader)
"cert.pem" from readerstatic List<Certificate>
loadCertificates(String certpem)
from "cert.pem" Stringstatic PrivateKey
loadPrivateKey(Reader reader)
Return private key ("key.pem") from Readerstatic PrivateKey
loadPrivateKey(String keypem)
Return KeyPair from "key.pem"static boolean
verifyCertificatesExist(String dockerCertPath)
-
-
-
Method Detail
-
verifyCertificatesExist
public static boolean verifyCertificatesExist(String dockerCertPath)
-
createKeyStore
public static KeyStore createKeyStore(String keypem, String certpem) throws NoSuchAlgorithmException, InvalidKeySpecException, IOException, CertificateException, KeyStoreException
-
loadCertificates
public static List<Certificate> loadCertificates(String certpem) throws IOException, CertificateException
from "cert.pem" String- Throws:
IOException
CertificateException
-
loadCertificates
public static List<Certificate> loadCertificates(Reader reader) throws IOException, CertificateException
"cert.pem" from reader- Throws:
IOException
CertificateException
-
loadPrivateKey
@CheckForNull public static PrivateKey loadPrivateKey(Reader reader) throws IOException, NoSuchAlgorithmException, InvalidKeySpecException
Return private key ("key.pem") from Reader
-
loadPrivateKey
@CheckForNull public static PrivateKey loadPrivateKey(String keypem) throws IOException, NoSuchAlgorithmException, InvalidKeySpecException
Return KeyPair from "key.pem"
-
createTrustStore
public static KeyStore createTrustStore(String capem) throws IOException, CertificateException, KeyStoreException, NoSuchAlgorithmException
"ca.pem" from String
-
createTrustStore
public static KeyStore createTrustStore(Reader certReader) throws IOException, CertificateException, KeyStoreException, NoSuchAlgorithmException
"ca.pem" from Reader
-
-