| | |
| | | |
| | | import com.gitblit.Constants.AccessPermission; |
| | | import com.gitblit.utils.StringUtils; |
| | | import com.google.common.base.Joiner; |
| | | |
| | | /** |
| | | * Class that encapsulates a public SSH key and it's metadata. |
| | |
| | | private AccessPermission permission; |
| | | |
| | | public SshKey(String data) { |
| | | this.rawData = data; |
| | | // strip out line breaks (issue-571) |
| | | this.rawData = Joiner.on("").join(data.replace("\r\n", "\n").split("\n")); |
| | | this.permission = AccessPermission.PUSH; |
| | | } |
| | | |
| | |
| | | try { |
| | | publicKey = new Buffer(bin).getRawPublicKey(); |
| | | } catch (SshException e) { |
| | | e.printStackTrace(); |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | return publicKey; |