spotify/docker-client

Encryption algorithms other than RSA

开放

#554 创建于 2016年12月21日

 (2 条评论) (0 个反应) (0 位负责人)Java (551 个派生)batch import
enhancementhelp wantedpinned

仓库指标

星标
 (1,430 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

Description

My docker registry gives me a key encrypted with the ECDSA algoritm. At least, that's what I think when I read the key.pem

PEMParser pemParser = new PEMParser(new BufferedReader(new FileReader("key.pem")));
Object object = pemParser.readObject();
JcaPEMKeyConverter converter = new JcaPEMKeyConverter().setProvider("BC");
if (object instanceof PEMKeyPair) {
  PEMKeyPair pair = (PEMKeyPair) object;
  converter.getPrivateKey(pair.getPrivateKeyInfo()).getAlgorithm()
}

Then DockerCertificates throws exception maybe because of line 97.

How to reproduce

Don't know. If your docker registry gives you ECDSA-encrypted key, then you can try.

What do you expect

Maybe bouncycastle can be used to find the encryption algorithm.

What happened instead

exception java.security.spec.InvalidKeySpecException: java.security.InvalidKeyException: Invalid RSA private key: Version must be 0 [Describe the actual results]

Software:

docker-maven-plugin:0.4.13

Full backtrace

[Paste full backtrace here]

贡献者指南