Class DockerCertificates

  • All Implemented Interfaces:
    DockerCertificatesStore

    public class DockerCertificates
    extends java.lang.Object
    implements DockerCertificatesStore
    DockerCertificates holds certificates for connecting to an HTTPS-secured Docker instance with client/server authentication.
    • Field Detail

      • DEFAULT_CA_CERT_NAME

        public static final java.lang.String DEFAULT_CA_CERT_NAME
        See Also:
        Constant Field Values
      • DEFAULT_CLIENT_CERT_NAME

        public static final java.lang.String DEFAULT_CLIENT_CERT_NAME
        See Also:
        Constant Field Values
      • DEFAULT_CLIENT_KEY_NAME

        public static final java.lang.String DEFAULT_CLIENT_KEY_NAME
        See Also:
        Constant Field Values
      • KEY_STORE_PASSWORD

        private static final char[] KEY_STORE_PASSWORD
      • PRIVATE_KEY_ALGS

        private static final java.util.Set<java.lang.String> PRIVATE_KEY_ALGS
      • log

        private static final org.slf4j.Logger log
      • sslContext

        private final javax.net.ssl.SSLContext sslContext
    • Method Detail

      • newKeyStore

        private java.security.KeyStore newKeyStore()
                                            throws java.security.cert.CertificateException,
                                                   java.security.NoSuchAlgorithmException,
                                                   java.io.IOException,
                                                   java.security.KeyStoreException
        Throws:
        java.security.cert.CertificateException
        java.security.NoSuchAlgorithmException
        java.io.IOException
        java.security.KeyStoreException
      • readPrivateKey

        private java.security.PrivateKey readPrivateKey​(java.nio.file.Path file)
                                                 throws java.io.IOException,
                                                        java.security.spec.InvalidKeySpecException,
                                                        DockerCertificateException
        Throws:
        java.io.IOException
        java.security.spec.InvalidKeySpecException
        DockerCertificateException
      • generatePrivateKey

        private static java.security.PrivateKey generatePrivateKey​(org.bouncycastle.asn1.pkcs.PrivateKeyInfo privateKeyInfo)
                                                            throws java.io.IOException,
                                                                   java.security.spec.InvalidKeySpecException
        Throws:
        java.io.IOException
        java.security.spec.InvalidKeySpecException
      • tryGeneratePrivateKey

        private static java.security.PrivateKey tryGeneratePrivateKey​(java.security.spec.PKCS8EncodedKeySpec spec,
                                                                      java.util.Set<java.lang.String> algorithms)
                                                               throws java.security.spec.InvalidKeySpecException
        Throws:
        java.security.spec.InvalidKeySpecException
      • readCertificates

        private java.util.List<java.security.cert.Certificate> readCertificates​(java.nio.file.Path file)
                                                                         throws java.security.cert.CertificateException,
                                                                                java.io.IOException
        Throws:
        java.security.cert.CertificateException
        java.io.IOException