Class GenericEd25519PublicKeyDecoder<PUB extends PublicKey,PRV extends PrivateKey>
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<PUB,PRV>
org.apache.sshd.common.util.security.eddsa.generic.GenericEd25519PublicKeyDecoder<PUB,PRV>
- All Implemented Interfaces:
IdentityResourceLoader<PUB,,PRV> KeyEntryResolver<PUB,,PRV> KeyTypeNamesSupport,PublicKeyEntryDecoder<PUB,,PRV> PublicKeyEntryResolver,PublicKeyRawDataDecoder<PUB>
- Direct Known Subclasses:
Ed25519PublicKeyDecoder
public class GenericEd25519PublicKeyDecoder<PUB extends PublicKey,PRV extends PrivateKey>
extends AbstractPublicKeyEntryDecoder<PUB,PRV>
- Author:
- Apache MINA SSHD Project
-
Field Summary
FieldsFields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
logFields inherited from interface org.apache.sshd.common.config.keys.IdentityResourceLoader
MAX_BIGINT_OCTETS_COUNTFields inherited from interface org.apache.sshd.common.config.keys.PublicKeyEntryResolver
FAILING, IGNORING, UNSUPPORTED -
Constructor Summary
ConstructorsConstructorDescriptionGenericEd25519PublicKeyDecoder(Class<PUB> pubType, Class<PRV> prvType, EdDSASupport<PUB, PRV> edDSASupport) -
Method Summary
Modifier and TypeMethodDescriptionclonePrivateKey(PRV key) clonePublicKey(PUB key) decodePublicKey(SessionContext session, String keyType, InputStream keyData, Map<String, String> headers) encodePublicKey(OutputStream s, PUB key) Methods inherited from class org.apache.sshd.common.config.keys.impl.AbstractPublicKeyEntryDecoder
parseBooleanHeaderMethods inherited from class org.apache.sshd.common.config.keys.impl.AbstractKeyEntryResolver
generatePrivateKey, generatePublicKey, toStringMethods inherited from class org.apache.sshd.common.config.keys.impl.AbstractIdentityResourceLoader
getPrivateKeyType, getPublicKeyType, getSupportedKeyTypesMethods 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, warnMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.sshd.common.config.keys.IdentityResourceLoader
getPrivateKeyType, getPublicKeyTypeMethods inherited from interface org.apache.sshd.common.config.keys.KeyEntryResolver
cloneKeyPair, generateKeyPairMethods inherited from interface org.apache.sshd.common.config.keys.KeyTypeNamesSupport
getSupportedKeyTypesMethods inherited from interface org.apache.sshd.common.config.keys.PublicKeyEntryDecoder
decodePublicKeyByType, resolveMethods inherited from interface org.apache.sshd.common.config.keys.PublicKeyRawDataDecoder
decodePublicKey, decodePublicKey
-
Field Details
-
MAX_ALLOWED_SEED_LEN
public static final int MAX_ALLOWED_SEED_LEN- See Also:
-
edDSASupport
-
-
Constructor Details
-
GenericEd25519PublicKeyDecoder
-
-
Method Details
-
clonePublicKey
- Parameters:
key- ThePublicKeyto clone - ignored ifnull- Returns:
- The cloned key (or
nullif no original key) - Throws:
GeneralSecurityException- If failed to clone the key
-
clonePrivateKey
- Parameters:
key- ThePrivateKeyto clone - ignored ifnull- Returns:
- The cloned key (or
nullif no original key) - Throws:
GeneralSecurityException- If failed to clone the key
-
getKeyPairGenerator
- Returns:
- A
KeyPairGeneratorsuitable for this decoder - Throws:
GeneralSecurityException- If failed to create the generator
-
encodePublicKey
Description copied from interface:PublicKeyEntryDecoder- Parameters:
s- TheOutputStreamto 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
-
getKeyFactoryInstance
- Returns:
- A
KeyFactorysuitable for the specific decoder type - Throws:
GeneralSecurityException- If failed to create one
-
decodePublicKey
public PUB decodePublicKey(SessionContext session, String keyType, InputStream keyData, Map<String, String> headers) throws IOException, GeneralSecurityException- Parameters:
session- TheSessionContextfor invoking this command - may benullif 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
-