Class SkED25519PublicKeyEntryDecoder
- java.lang.Object
-
- org.apache.sshd.common.util.logging.AbstractLoggingBean
-
- org.apache.sshd.common.config.keys.impl.AbstractIdentityResourceLoader<PUB,PRV>
-
- org.apache.sshd.common.config.keys.impl.AbstractKeyEntryResolver<PUB,PRV>
-
- org.apache.sshd.common.config.keys.impl.AbstractPublicKeyEntryDecoder<SkED25519PublicKey,PrivateKey>
-
- org.apache.sshd.common.config.keys.impl.SkED25519PublicKeyEntryDecoder
-
- All Implemented Interfaces:
IdentityResourceLoader<SkED25519PublicKey,PrivateKey>
,KeyEntryResolver<SkED25519PublicKey,PrivateKey>
,KeyTypeNamesSupport
,PublicKeyEntryDecoder<SkED25519PublicKey,PrivateKey>
,PublicKeyEntryResolver
,PublicKeyRawDataDecoder<SkED25519PublicKey>
public class SkED25519PublicKeyEntryDecoder extends AbstractPublicKeyEntryDecoder<SkED25519PublicKey,PrivateKey>
- Author:
- Apache MINA SSHD Project
-
-
Field Summary
Fields Modifier and Type Field Description static SkED25519PublicKeyEntryDecoder
INSTANCE
static String
KEY_TYPE
static int
MAX_APP_NAME_LENGTH
-
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
-
Fields inherited from interface org.apache.sshd.common.config.keys.IdentityResourceLoader
MAX_BIGINT_OCTETS_COUNT
-
Fields inherited from interface org.apache.sshd.common.config.keys.PublicKeyEntryResolver
FAILING, IGNORING
-
-
Constructor Summary
Constructors Constructor Description SkED25519PublicKeyEntryDecoder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PrivateKey
clonePrivateKey(PrivateKey key)
SkED25519PublicKey
clonePublicKey(SkED25519PublicKey key)
SkED25519PublicKey
decodePublicKey(SessionContext session, String keyType, InputStream keyData, Map<String,String> headers)
String
encodePublicKey(OutputStream s, SkED25519PublicKey key)
KeyPair
generateKeyPair(int keySize)
KeyFactory
getKeyFactoryInstance()
KeyPairGenerator
getKeyPairGenerator()
-
Methods inherited from class org.apache.sshd.common.config.keys.impl.AbstractPublicKeyEntryDecoder
parseBooleanHeader
-
Methods inherited from class org.apache.sshd.common.config.keys.impl.AbstractKeyEntryResolver
generatePrivateKey, generatePublicKey, toString
-
Methods inherited from class org.apache.sshd.common.config.keys.impl.AbstractIdentityResourceLoader
getPrivateKeyType, getPublicKeyType, getSupportedKeyTypes
-
Methods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warn
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.sshd.common.config.keys.IdentityResourceLoader
getPrivateKeyType, getPublicKeyType
-
Methods inherited from interface org.apache.sshd.common.config.keys.KeyEntryResolver
cloneKeyPair
-
Methods inherited from interface org.apache.sshd.common.config.keys.KeyTypeNamesSupport
getSupportedKeyTypes
-
Methods inherited from interface org.apache.sshd.common.config.keys.PublicKeyEntryDecoder
decodePublicKeyByType, resolve
-
Methods inherited from interface org.apache.sshd.common.config.keys.PublicKeyRawDataDecoder
decodePublicKey, decodePublicKey
-
-
-
-
Field Detail
-
KEY_TYPE
public static final String KEY_TYPE
- See Also:
- Constant Field Values
-
MAX_APP_NAME_LENGTH
public static final int MAX_APP_NAME_LENGTH
- See Also:
- Constant Field Values
-
INSTANCE
public static final SkED25519PublicKeyEntryDecoder INSTANCE
-
-
Method Detail
-
decodePublicKey
public SkED25519PublicKey decodePublicKey(SessionContext session, String keyType, InputStream keyData, Map<String,String> headers) throws IOException, GeneralSecurityException
- Parameters:
session
- TheSessionContext
for invoking this command - may benull
if not invoked within a session context (e.g., offline tool or session unknown).keyType
- The reported / encode key typekeyData
- The key data bytes stream positioned after the key type decoding and making sure it is one of the supported typesheaders
- Any headers that may have been available when data was read- Returns:
- The decoded
PublicKey
- Throws:
IOException
- If failed to read from the data streamGeneralSecurityException
- If failed to generate the key
-
clonePublicKey
public SkED25519PublicKey clonePublicKey(SkED25519PublicKey key)
- Parameters:
key
- ThePublicKey
to clone - ignored ifnull
- Returns:
- The cloned key (or
null
if no original key)
-
encodePublicKey
public String encodePublicKey(OutputStream s, SkED25519PublicKey key) throws IOException
Description copied from interface:PublicKeyEntryDecoder
- Parameters:
s
- TheOutputStream
to write the data tokey
- ThePublicKey
- may not benull
- Returns:
- The key type value - one of the
KeyTypeNamesSupport.getSupportedKeyTypes()
- Throws:
IOException
- If failed to generate the encoding
-
clonePrivateKey
public PrivateKey clonePrivateKey(PrivateKey key)
- Parameters:
key
- ThePrivateKey
to clone - ignored ifnull
- Returns:
- The cloned key (or
null
if no original key)
-
getKeyFactoryInstance
public KeyFactory getKeyFactoryInstance()
- Returns:
- A
KeyFactory
suitable for the specific decoder type
-
generateKeyPair
public KeyPair generateKeyPair(int keySize)
- Parameters:
keySize
- Key size in bits- Returns:
- A
KeyPair
with the specified key size
-
getKeyPairGenerator
public KeyPairGenerator getKeyPairGenerator()
- Returns:
- A
KeyPairGenerator
suitable for this decoder
-
-