Package net.schmizz.sshj.common
Enum KeyType
- java.lang.Object
-
- java.lang.Enum<KeyType>
-
- net.schmizz.sshj.common.KeyType
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
KeyType.CertUtils
-
Enum Constant Summary
Enum Constants Enum Constant Description DSA
SSH identifier for DSA keysDSA_CERT
Signed dsa certificateECDSA256
SSH identifier for ECDSA-256 keysECDSA256_CERT
ECDSA384
SSH identifier for ECDSA-384 keysECDSA384_CERT
ECDSA521
SSH identifier for ECDSA-521 keysECDSA521_CERT
ED25519
ED25519_CERT
RSA
SSH identifier for RSA keysRSA_CERT
Signed rsa certificateUNKNOWN
Unrecognized
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
sType
-
Method Summary
Modifier and Type Method Description static KeyType
fromKey(java.security.Key key)
static KeyType
fromString(java.lang.String sType)
KeyType
getParent()
protected abstract boolean
isMyType(java.security.Key key)
void
putPubKeyIntoBuffer(java.security.PublicKey pk, Buffer<?> buf)
abstract java.security.PublicKey
readPubKeyFromBuffer(Buffer<?> buf)
java.lang.String
toString()
static KeyType
valueOf(java.lang.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.protected abstract void
writePubKeyContentsIntoBuffer(java.security.PublicKey pk, Buffer<?> buf)
-
-
-
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
-
ECDSA256
public static final KeyType ECDSA256
SSH identifier for ECDSA-256 keys
-
ECDSA384
public static final KeyType ECDSA384
SSH identifier for ECDSA-384 keys
-
ECDSA521
public static final KeyType ECDSA521
SSH identifier for ECDSA-521 keys
-
ED25519
public static final KeyType ED25519
-
RSA_CERT
public static final KeyType RSA_CERT
Signed rsa certificate
-
DSA_CERT
public static final KeyType DSA_CERT
Signed dsa certificate
-
ED25519_CERT
public static final KeyType ED25519_CERT
-
ECDSA256_CERT
public static final KeyType ECDSA256_CERT
-
ECDSA384_CERT
public static final KeyType ECDSA384_CERT
-
ECDSA521_CERT
public static final KeyType ECDSA521_CERT
-
UNKNOWN
public static final KeyType UNKNOWN
Unrecognized
-
-
Method Detail
-
values
public static KeyType[] values()
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static KeyType valueOf(java.lang.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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
readPubKeyFromBuffer
public abstract java.security.PublicKey readPubKeyFromBuffer(Buffer<?> buf) throws java.security.GeneralSecurityException
- Throws:
java.security.GeneralSecurityException
-
writePubKeyContentsIntoBuffer
protected abstract void writePubKeyContentsIntoBuffer(java.security.PublicKey pk, Buffer<?> buf)
-
putPubKeyIntoBuffer
public void putPubKeyIntoBuffer(java.security.PublicKey pk, Buffer<?> buf)
-
isMyType
protected abstract boolean isMyType(java.security.Key key)
-
fromKey
public static KeyType fromKey(java.security.Key key)
-
getParent
public KeyType getParent()
-
fromString
public static KeyType fromString(java.lang.String sType)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Enum<KeyType>
-
-