Class CertificateUtils
java.lang.Object
com.qualys.plugins.containerSecurity.util.CertificateUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic KeyStorecreateKeyStore(String keypem, String certpem) static KeyStorecreateTrustStore(Reader certReader) "ca.pem" from Readerstatic KeyStorecreateTrustStore(String capem) "ca.pem" from Stringstatic List<Certificate>loadCertificates(Reader reader) "cert.pem" from readerstatic List<Certificate>loadCertificates(String certpem) from "cert.pem" Stringstatic PrivateKeyloadPrivateKey(Reader reader) Return private key ("key.pem") from Readerstatic PrivateKeyloadPrivateKey(String keypem) Return KeyPair from "key.pem"static booleanverifyCertificatesExist(String dockerCertPath)
-
Method Details
-
verifyCertificatesExist
-
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:
IOExceptionCertificateException
-
loadCertificates
public static List<Certificate> loadCertificates(Reader reader) throws IOException, CertificateException "cert.pem" from reader- Throws:
IOExceptionCertificateException
-
loadPrivateKey
@Nullable public static PrivateKey loadPrivateKey(Reader reader) throws IOException, NoSuchAlgorithmException, InvalidKeySpecException Return private key ("key.pem") from Reader -
loadPrivateKey
@Nullable 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
-