net.schmizz.sshj.common
Enum KeyType

java.lang.Object
  extended by java.lang.Enum<KeyType>
      extended by net.schmizz.sshj.common.KeyType
All Implemented Interfaces:
Serializable, Comparable<KeyType>

public enum KeyType
extends Enum<KeyType>

Type of key e.g. rsa, dsa


Enum Constant Summary
DSA
          SSH identifier for DSA keys
RSA
          SSH identifier for RSA keys
UNKNOWN
          Unrecognized
 
Field Summary
protected  String sType
           
 
Method Summary
static KeyType fromKey(Key key)
           
static KeyType fromString(String sType)
           
protected abstract  boolean isMyType(Key key)
           
abstract  void putPubKeyIntoBuffer(PublicKey pk, Buffer<?> buf)
           
abstract  PublicKey readPubKeyFromBuffer(String type, Buffer<?> buf)
           
 String toString()
           
static KeyType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static KeyType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

RSA

public static final KeyType RSA
SSH identifier for RSA keys


DSA

public static final KeyType DSA
SSH identifier for DSA keys


UNKNOWN

public static final KeyType UNKNOWN
Unrecognized

Field Detail

sType

protected final String sType
Method Detail

values

public static KeyType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (KeyType c : KeyType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static KeyType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

readPubKeyFromBuffer

public abstract PublicKey readPubKeyFromBuffer(String type,
                                               Buffer<?> buf)
                                        throws GeneralSecurityException
Throws:
GeneralSecurityException

putPubKeyIntoBuffer

public abstract void putPubKeyIntoBuffer(PublicKey pk,
                                         Buffer<?> buf)

isMyType

protected abstract boolean isMyType(Key key)

fromKey

public static KeyType fromKey(Key key)

fromString

public static KeyType fromString(String sType)

toString

public String toString()
Overrides:
toString in class Enum<KeyType>


Copyright © 2009-2012. All Rights Reserved.