Created
November 15, 2016 22:34
-
-
Save david-martin/6aaa5e3fac5f7505ef64d6ba18853203 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bytes = null; | |
// look for the Base64 encoded part of the line to decode | |
// both ssh-rsa and ssh-dss begin with "AAAA" due to the length bytes | |
for (String part : keyLine.split(" ")) { | |
if (part.startsWith("AAAA")) { | |
bytes = Base64.decodeBase64(part); | |
break; | |
} | |
} | |
if (bytes == null) throw new IllegalArgumentException("no Base64 part to decode"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment