SSL KafkaAdminClient object using java.security.Keystore object Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Registering multiple keystores in JVMUsing client/server certificates for two way authentication SSL socket on AndroidJava/Keystore Verify Signed certificateIs my client and server authentication with ssl certificates is secure?Java 7 (acting as client) SSL handshake failure with keystore and truststore that worked in Java 6ActiveMQ, SSL, C#Security settings in Storm to connect to secured Kafka ClusterConfigured Weblogic Managed Server with Custom Identity and Truststore uses jre truststoregRPC: How to configure SSL in client?Connect to Kafka with SSL using KafkaIO on Google Dataflow

Can a new player join a group only when a new campaign starts?

Fundamental Solution of the Pell Equation

Wu formula for manifolds with boundary

Is it common practice to audition new musicians one-on-one before rehearsing with the entire band?

How come Sam didn't become Lord of Horn Hill?

Trademark violation for app?

Is grep documentation wrong?

Does classifying an integer as a discrete log require it be part of a multiplicative group?

Denied boarding although I have proper visa and documentation. To whom should I make a complaint?

Is the Standard Deduction better than Itemized when both are the same amount?

How can I use the Python library networkx from Mathematica?

Should I use a zero-interest credit card for a large one-time purchase?

What do you call the main part of a joke?

Do I really need to have a message in a novel to appeal to readers?

Do square wave exist?

When a candle burns, why does the top of wick glow if bottom of flame is hottest?

Do jazz musicians improvise on the parent scale in addition to the chord-scales?

Extracting terms with certain heads in a function

What would be the ideal power source for a cybernetic eye?

How do I find out the mythology and history of my Fortress?

How to compare two different files line by line in unix?

Irreducible of finite Krull dimension implies quasi-compact?

How to deal with a team lead who never gives me credit?

How could we fake a moon landing now?



SSL KafkaAdminClient object using java.security.Keystore object



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
Data science time! April 2019 and salary with experience
The Ask Question Wizard is Live!Registering multiple keystores in JVMUsing client/server certificates for two way authentication SSL socket on AndroidJava/Keystore Verify Signed certificateIs my client and server authentication with ssl certificates is secure?Java 7 (acting as client) SSL handshake failure with keystore and truststore that worked in Java 6ActiveMQ, SSL, C#Security settings in Storm to connect to secured Kafka ClusterConfigured Weblogic Managed Server with Custom Identity and Truststore uses jre truststoregRPC: How to configure SSL in client?Connect to Kafka with SSL using KafkaIO on Google Dataflow



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I need to create kafkaAmdinClient SSL object using java.security.keystore object.
i.e I have to read the keystore and truststire files from database as a clob and get the keystore in java.security.keystore object and use this to create Admin client object.



I am able to create AdminClient object using properties object :



props.put(SslConfigs.SSL_TRUSTSTORE_PASSWORD_CONFIG, trustStorePwd);
props.put(SslConfigs.SSL_KEYSTORE_LOCATION_CONFIG, "/ngs/app/bolt_components/kafka_ssl/RN_BC_YELLOWBIRD/client.truststore.jks");
props.put(SslConfigs.SSL_KEYSTORE_PASSWORD_CONFIG, keyStorePwd);
kafkaAdminClient = AdminClient.create(props);


But as per requiremtn i should not specify keystore file location. Instead specify keystore object.



KeyStoreDto kDto=KeystoreManager.getKafkaKeyStoreDto(kafkaDto.getKEYSTORE_ID());
java.security.KeyStore keyStore = kDto.getKeyStore();
java.security.KeyStore trustStore = kDto.getTrustStore();
String keyStorePwd=kDto.getKeyStorePassword();
String trustStorePwd=kDto.getTrustStorePassword();


From this i have to use keyStore and trustStore.



Can anyone help me with this.










share|improve this question






























    0















    I need to create kafkaAmdinClient SSL object using java.security.keystore object.
    i.e I have to read the keystore and truststire files from database as a clob and get the keystore in java.security.keystore object and use this to create Admin client object.



    I am able to create AdminClient object using properties object :



    props.put(SslConfigs.SSL_TRUSTSTORE_PASSWORD_CONFIG, trustStorePwd);
    props.put(SslConfigs.SSL_KEYSTORE_LOCATION_CONFIG, "/ngs/app/bolt_components/kafka_ssl/RN_BC_YELLOWBIRD/client.truststore.jks");
    props.put(SslConfigs.SSL_KEYSTORE_PASSWORD_CONFIG, keyStorePwd);
    kafkaAdminClient = AdminClient.create(props);


    But as per requiremtn i should not specify keystore file location. Instead specify keystore object.



    KeyStoreDto kDto=KeystoreManager.getKafkaKeyStoreDto(kafkaDto.getKEYSTORE_ID());
    java.security.KeyStore keyStore = kDto.getKeyStore();
    java.security.KeyStore trustStore = kDto.getTrustStore();
    String keyStorePwd=kDto.getKeyStorePassword();
    String trustStorePwd=kDto.getTrustStorePassword();


    From this i have to use keyStore and trustStore.



    Can anyone help me with this.










    share|improve this question


























      0












      0








      0








      I need to create kafkaAmdinClient SSL object using java.security.keystore object.
      i.e I have to read the keystore and truststire files from database as a clob and get the keystore in java.security.keystore object and use this to create Admin client object.



      I am able to create AdminClient object using properties object :



      props.put(SslConfigs.SSL_TRUSTSTORE_PASSWORD_CONFIG, trustStorePwd);
      props.put(SslConfigs.SSL_KEYSTORE_LOCATION_CONFIG, "/ngs/app/bolt_components/kafka_ssl/RN_BC_YELLOWBIRD/client.truststore.jks");
      props.put(SslConfigs.SSL_KEYSTORE_PASSWORD_CONFIG, keyStorePwd);
      kafkaAdminClient = AdminClient.create(props);


      But as per requiremtn i should not specify keystore file location. Instead specify keystore object.



      KeyStoreDto kDto=KeystoreManager.getKafkaKeyStoreDto(kafkaDto.getKEYSTORE_ID());
      java.security.KeyStore keyStore = kDto.getKeyStore();
      java.security.KeyStore trustStore = kDto.getTrustStore();
      String keyStorePwd=kDto.getKeyStorePassword();
      String trustStorePwd=kDto.getTrustStorePassword();


      From this i have to use keyStore and trustStore.



      Can anyone help me with this.










      share|improve this question
















      I need to create kafkaAmdinClient SSL object using java.security.keystore object.
      i.e I have to read the keystore and truststire files from database as a clob and get the keystore in java.security.keystore object and use this to create Admin client object.



      I am able to create AdminClient object using properties object :



      props.put(SslConfigs.SSL_TRUSTSTORE_PASSWORD_CONFIG, trustStorePwd);
      props.put(SslConfigs.SSL_KEYSTORE_LOCATION_CONFIG, "/ngs/app/bolt_components/kafka_ssl/RN_BC_YELLOWBIRD/client.truststore.jks");
      props.put(SslConfigs.SSL_KEYSTORE_PASSWORD_CONFIG, keyStorePwd);
      kafkaAdminClient = AdminClient.create(props);


      But as per requiremtn i should not specify keystore file location. Instead specify keystore object.



      KeyStoreDto kDto=KeystoreManager.getKafkaKeyStoreDto(kafkaDto.getKEYSTORE_ID());
      java.security.KeyStore keyStore = kDto.getKeyStore();
      java.security.KeyStore trustStore = kDto.getTrustStore();
      String keyStorePwd=kDto.getKeyStorePassword();
      String trustStorePwd=kDto.getTrustStorePassword();


      From this i have to use keyStore and trustStore.



      Can anyone help me with this.







      ssl apache-kafka keystore truststore






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 23 at 0:04









      Giorgos Myrianthous

      5,59731848




      5,59731848










      asked Mar 22 at 9:35









      NehaGoswamiNehaGoswami

      286




      286






















          1 Answer
          1






          active

          oldest

          votes


















          0














          Kafka does not support ssl using java.security.keystore object.
          You can look into SslFactory class at kafka for more information.






          share|improve this answer























          • But i dont have a path here, i am reading clob (.jks fie) from databse. String keystore_pwd = PasswordService.INSTANCE.decrypt(result.getString("keystore_pwd")); dto.setKeyStorePassword(keystore_pwd); Blob blob = result.getBlob("keystore_file"); is = blob.getBinaryStream(); keyStore.load(is, keystore_pwd.toCharArray()); dto.setKeyStore(keyStore);

            – NehaGoswami
            Mar 25 at 7:47












          • that's mentioned kafka does not support this.

            – Rohit Yadav
            Mar 25 at 8:37











          • ok so is there any other way in which keystore.jks file can be used to create AdminClient object in Kafka through java code if keystore.jks is stored in DB? And workaround?

            – NehaGoswami
            Mar 25 at 8:52












          • Kafka doesn't support your requirement and there is no alternate for the same.I have provide the link of Kafka source code.You can go through.

            – Rohit Yadav
            Mar 25 at 9:54











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55296657%2fssl-kafkaadminclient-object-using-java-security-keystore-object%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          Kafka does not support ssl using java.security.keystore object.
          You can look into SslFactory class at kafka for more information.






          share|improve this answer























          • But i dont have a path here, i am reading clob (.jks fie) from databse. String keystore_pwd = PasswordService.INSTANCE.decrypt(result.getString("keystore_pwd")); dto.setKeyStorePassword(keystore_pwd); Blob blob = result.getBlob("keystore_file"); is = blob.getBinaryStream(); keyStore.load(is, keystore_pwd.toCharArray()); dto.setKeyStore(keyStore);

            – NehaGoswami
            Mar 25 at 7:47












          • that's mentioned kafka does not support this.

            – Rohit Yadav
            Mar 25 at 8:37











          • ok so is there any other way in which keystore.jks file can be used to create AdminClient object in Kafka through java code if keystore.jks is stored in DB? And workaround?

            – NehaGoswami
            Mar 25 at 8:52












          • Kafka doesn't support your requirement and there is no alternate for the same.I have provide the link of Kafka source code.You can go through.

            – Rohit Yadav
            Mar 25 at 9:54















          0














          Kafka does not support ssl using java.security.keystore object.
          You can look into SslFactory class at kafka for more information.






          share|improve this answer























          • But i dont have a path here, i am reading clob (.jks fie) from databse. String keystore_pwd = PasswordService.INSTANCE.decrypt(result.getString("keystore_pwd")); dto.setKeyStorePassword(keystore_pwd); Blob blob = result.getBlob("keystore_file"); is = blob.getBinaryStream(); keyStore.load(is, keystore_pwd.toCharArray()); dto.setKeyStore(keyStore);

            – NehaGoswami
            Mar 25 at 7:47












          • that's mentioned kafka does not support this.

            – Rohit Yadav
            Mar 25 at 8:37











          • ok so is there any other way in which keystore.jks file can be used to create AdminClient object in Kafka through java code if keystore.jks is stored in DB? And workaround?

            – NehaGoswami
            Mar 25 at 8:52












          • Kafka doesn't support your requirement and there is no alternate for the same.I have provide the link of Kafka source code.You can go through.

            – Rohit Yadav
            Mar 25 at 9:54













          0












          0








          0







          Kafka does not support ssl using java.security.keystore object.
          You can look into SslFactory class at kafka for more information.






          share|improve this answer













          Kafka does not support ssl using java.security.keystore object.
          You can look into SslFactory class at kafka for more information.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 23 at 4:27









          Rohit YadavRohit Yadav

          37728




          37728












          • But i dont have a path here, i am reading clob (.jks fie) from databse. String keystore_pwd = PasswordService.INSTANCE.decrypt(result.getString("keystore_pwd")); dto.setKeyStorePassword(keystore_pwd); Blob blob = result.getBlob("keystore_file"); is = blob.getBinaryStream(); keyStore.load(is, keystore_pwd.toCharArray()); dto.setKeyStore(keyStore);

            – NehaGoswami
            Mar 25 at 7:47












          • that's mentioned kafka does not support this.

            – Rohit Yadav
            Mar 25 at 8:37











          • ok so is there any other way in which keystore.jks file can be used to create AdminClient object in Kafka through java code if keystore.jks is stored in DB? And workaround?

            – NehaGoswami
            Mar 25 at 8:52












          • Kafka doesn't support your requirement and there is no alternate for the same.I have provide the link of Kafka source code.You can go through.

            – Rohit Yadav
            Mar 25 at 9:54

















          • But i dont have a path here, i am reading clob (.jks fie) from databse. String keystore_pwd = PasswordService.INSTANCE.decrypt(result.getString("keystore_pwd")); dto.setKeyStorePassword(keystore_pwd); Blob blob = result.getBlob("keystore_file"); is = blob.getBinaryStream(); keyStore.load(is, keystore_pwd.toCharArray()); dto.setKeyStore(keyStore);

            – NehaGoswami
            Mar 25 at 7:47












          • that's mentioned kafka does not support this.

            – Rohit Yadav
            Mar 25 at 8:37











          • ok so is there any other way in which keystore.jks file can be used to create AdminClient object in Kafka through java code if keystore.jks is stored in DB? And workaround?

            – NehaGoswami
            Mar 25 at 8:52












          • Kafka doesn't support your requirement and there is no alternate for the same.I have provide the link of Kafka source code.You can go through.

            – Rohit Yadav
            Mar 25 at 9:54
















          But i dont have a path here, i am reading clob (.jks fie) from databse. String keystore_pwd = PasswordService.INSTANCE.decrypt(result.getString("keystore_pwd")); dto.setKeyStorePassword(keystore_pwd); Blob blob = result.getBlob("keystore_file"); is = blob.getBinaryStream(); keyStore.load(is, keystore_pwd.toCharArray()); dto.setKeyStore(keyStore);

          – NehaGoswami
          Mar 25 at 7:47






          But i dont have a path here, i am reading clob (.jks fie) from databse. String keystore_pwd = PasswordService.INSTANCE.decrypt(result.getString("keystore_pwd")); dto.setKeyStorePassword(keystore_pwd); Blob blob = result.getBlob("keystore_file"); is = blob.getBinaryStream(); keyStore.load(is, keystore_pwd.toCharArray()); dto.setKeyStore(keyStore);

          – NehaGoswami
          Mar 25 at 7:47














          that's mentioned kafka does not support this.

          – Rohit Yadav
          Mar 25 at 8:37





          that's mentioned kafka does not support this.

          – Rohit Yadav
          Mar 25 at 8:37













          ok so is there any other way in which keystore.jks file can be used to create AdminClient object in Kafka through java code if keystore.jks is stored in DB? And workaround?

          – NehaGoswami
          Mar 25 at 8:52






          ok so is there any other way in which keystore.jks file can be used to create AdminClient object in Kafka through java code if keystore.jks is stored in DB? And workaround?

          – NehaGoswami
          Mar 25 at 8:52














          Kafka doesn't support your requirement and there is no alternate for the same.I have provide the link of Kafka source code.You can go through.

          – Rohit Yadav
          Mar 25 at 9:54





          Kafka doesn't support your requirement and there is no alternate for the same.I have provide the link of Kafka source code.You can go through.

          – Rohit Yadav
          Mar 25 at 9:54



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55296657%2fssl-kafkaadminclient-object-using-java-security-keystore-object%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript