> + /**
> + * Returns {@link DSAPublicKeySpec} which was OpenSSH Base64 Encoded
> + * {@code id_rsa.pub}
> + *
> + * @param supplier the input stream factory, formatted
> + * {@code ssh-dss AAAAB3NzaC1yc2EAAAADAQABAAAB...}
> + *
> + * @return the {@link DSAPublicKeySpec} which was OpenSSH Base64 Encoded
> + * {@code id_rsa.pub}
> + * @throws IOException if an I/O error occurs
> + */
> + public static DSAPublicKeySpec publicKeySpecFromOpenSSH(InputSupplier<?
> extends InputStream> supplier)
> + throws IOException {
> + InputStream stream = supplier.getInput();
> + Iterable<String> parts = Splitter.on('
> ').split(toStringAndClose(stream).trim());
> + checkArgument(size(parts) >= 2 && "ssh-dss".equals(get(parts, 0)),
> "bad format, should be: ssh-dss AAAAB3...");
I think we have this elsewhere too. Make a "public static Iterable\<String\>
parseKeyString(String keyString)" somewhere?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/49/files#r9166255