org.jclouds.digitalocean.ssh
Class DSAKeys

java.lang.Object
  extended by org.jclouds.digitalocean.ssh.DSAKeys

public class DSAKeys
extends Object

Utility methods to work with DSA SSH keys.

Methods in this class should be moved to the SshKeys class.

See Also:
SshKeys

Constructor Summary
DSAKeys()
           
 
Method Summary
static String encodeAsOpenSSH(DSAPublicKey key)
           
static String fingerprint(BigInteger p, BigInteger q, BigInteger g, BigInteger y)
          Create a fingerprint per the following spec
static String fingerprintPublicKey(String publicKeyOpenSSH)
           
static DSAPublicKeySpec publicKeySpecFromOpenSSH(com.google.common.io.ByteSource supplier)
          Returns DSAPublicKeySpec which was OpenSSH Base64 Encoded id_rsa.pub
static DSAPublicKeySpec publicKeySpecFromOpenSSH(String idDsaPub)
          Executes org.jclouds.crypto.Pems#publicKeySpecFromOpenSSH(com.google.common.io.InputSupplier) on the string which was OpenSSH Base64 Encoded id_rsa.pub
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DSAKeys

public DSAKeys()
Method Detail

encodeAsOpenSSH

public static String encodeAsOpenSSH(DSAPublicKey key)

publicKeySpecFromOpenSSH

public static DSAPublicKeySpec publicKeySpecFromOpenSSH(String idDsaPub)
Executes org.jclouds.crypto.Pems#publicKeySpecFromOpenSSH(com.google.common.io.InputSupplier) on the string which was OpenSSH Base64 Encoded id_rsa.pub

Parameters:
idRsaPub - formatted ssh-dss AAAAB3NzaC1yc2EAAAADAQABAAAB...
See Also:
org.jclouds.crypto.Pems#publicKeySpecFromOpenSSH(com.google.common.io.InputSupplier)

publicKeySpecFromOpenSSH

public static DSAPublicKeySpec publicKeySpecFromOpenSSH(com.google.common.io.ByteSource supplier)
                                                 throws IOException
Returns DSAPublicKeySpec which was OpenSSH Base64 Encoded id_rsa.pub

Parameters:
supplier - the input stream factory, formatted ssh-dss AAAAB3NzaC1yc2EAAAADAQABAAAB...
Returns:
the DSAPublicKeySpec which was OpenSSH Base64 Encoded id_rsa.pub
Throws:
IOException - if an I/O error occurs

fingerprintPublicKey

public static String fingerprintPublicKey(String publicKeyOpenSSH)
Parameters:
publicKeyOpenSSH - RSA public key in OpenSSH format
Returns:
fingerprint ex. 2b:a9:62:95:5b:8b:1d:61:e0:92:f7:03:10:e9:db:d9

fingerprint

public static String fingerprint(BigInteger p,
                                 BigInteger q,
                                 BigInteger g,
                                 BigInteger y)
Create a fingerprint per the following spec

Returns:
hex fingerprint ex. 2b:a9:62:95:5b:8b:1d:61:e0:92:f7:03:10:e9:db:d9


Copyright © 2009-2014 The Apache Software Foundation. All Rights Reserved.