Commit b642d99b authored by ls1947's avatar ls1947
Browse files

trim encoded key

parent e7fc5796
...@@ -44,6 +44,7 @@ public class OpenSshKeyDecoder implements Serializable { ...@@ -44,6 +44,7 @@ public class OpenSshKeyDecoder implements Serializable {
private void getKeyBytes(OpenSshPublicKey key) throws UnsupportedKeyTypeException { private void getKeyBytes(OpenSshPublicKey key) throws UnsupportedKeyTypeException {
for (String part : key.getPubKeyEntity().getEncodedKey().split(" ")) { for (String part : key.getPubKeyEntity().getEncodedKey().split(" ")) {
if (Base64.isBase64(part) && part.startsWith("AAAA")) { if (Base64.isBase64(part) && part.startsWith("AAAA")) {
part = part.trim();
key.setBaseDate(part); key.setBaseDate(part);
key.setBytes(Base64.decodeBase64(part)); key.setBytes(Base64.decodeBase64(part));
return; return;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment