Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supports SSH algorithms other than RSA #4918

Closed
yunchen-myob opened this issue Nov 6, 2022 · 0 comments · Fixed by #4920
Closed

Supports SSH algorithms other than RSA #4918

yunchen-myob opened this issue Nov 6, 2022 · 0 comments · Fixed by #4920
Labels
Feature Request Suggest an idea for this project help wanted

Comments

@yunchen-myob
Copy link

Is your feature request related to a problem? Please describe.
SSH has several different types of algorithms for generating the key pair, you can reference this blog: https://goteleport.com/blog/comparing-ssh-keys/
But for now, this SDK can only support the RSA. The method in SDK to read the private key like below:

public static X509KeyManager keyManager(byte[] privateKeyPem, byte[] certificatePem)
      throws SSLException {
     
      ......
      KeyFactory factory = KeyFactory.getInstance("RSA");
      PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(decodePem(privateKeyPem));
      PrivateKey key = factory.generatePrivate(keySpec);
      ......
  }

As you can see in the above code, the SDK only instance the key using RSA algorithms.
I have also seen another similar issue here: #4751

Describe the solution you'd like
It can have 2 solutions here in my mind:

  1. Support another parameter for the OtlpGrpcSpanExporterBuilder.setClientTls method named like algorithm.
  2. Get the algorithm from the certificatePem and used to read the private key.

Describe alternatives you've considered
I purpose the soluton2. Automated reading will save developers a lot of time as they no longer need to know the algorithmic details of the certificate.

Additional context
Nothing here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Suggest an idea for this project help wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants