Class SkECDSAPublicKeyEntryDecoder
- 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<SkEcdsaPublicKey,java.security.PrivateKey>
-
- org.apache.sshd.common.config.keys.impl.SkECDSAPublicKeyEntryDecoder
-
- All Implemented Interfaces:
IdentityResourceLoader<SkEcdsaPublicKey,java.security.PrivateKey>,KeyEntryResolver<SkEcdsaPublicKey,java.security.PrivateKey>,KeyTypeNamesSupport,PublicKeyEntryDecoder<SkEcdsaPublicKey,java.security.PrivateKey>,PublicKeyEntryResolver,PublicKeyRawDataDecoder<SkEcdsaPublicKey>
public class SkECDSAPublicKeyEntryDecoder extends AbstractPublicKeyEntryDecoder<SkEcdsaPublicKey,java.security.PrivateKey>
-
-
Field Summary
Fields Modifier and Type Field Description static SkECDSAPublicKeyEntryDecoderINSTANCEstatic java.lang.StringKEY_TYPEstatic intMAX_APP_NAME_LENGTHprivate static java.lang.StringNO_TOUCH_REQUIRED_HEADER-
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 SkECDSAPublicKeyEntryDecoder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.security.PrivateKeyclonePrivateKey(java.security.PrivateKey key)SkEcdsaPublicKeyclonePublicKey(SkEcdsaPublicKey key)SkEcdsaPublicKeydecodePublicKey(SessionContext session, java.lang.String keyType, java.io.InputStream keyData, java.util.Map<java.lang.String,java.lang.String> headers)java.lang.StringencodePublicKey(java.io.OutputStream s, SkEcdsaPublicKey key)Encodes thePublicKeyusing theOpenSSHformat - same one used by thedecodePublicKeymethod(s)java.security.KeyPairgenerateKeyPair(int keySize)java.security.KeyFactorygetKeyFactoryInstance()java.security.KeyPairGeneratorgetKeyPairGenerator()-
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 java.lang.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 SkECDSAPublicKeyEntryDecoder INSTANCE
-
NO_TOUCH_REQUIRED_HEADER
private static final java.lang.String NO_TOUCH_REQUIRED_HEADER
- See Also:
- Constant Field Values
-
-
Method Detail
-
decodePublicKey
public SkEcdsaPublicKey decodePublicKey(SessionContext session, java.lang.String keyType, java.io.InputStream keyData, java.util.Map<java.lang.String,java.lang.String> headers) throws java.io.IOException, java.security.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:
java.io.IOException- If failed to read from the data streamjava.security.GeneralSecurityException- If failed to generate the key
-
clonePublicKey
public SkEcdsaPublicKey clonePublicKey(SkEcdsaPublicKey key) throws java.security.GeneralSecurityException
- Parameters:
key- ThePublicKeyto clone - ignored ifnull- Returns:
- The cloned key (or
nullif no original key) - Throws:
java.security.GeneralSecurityException- If failed to clone the key
-
encodePublicKey
public java.lang.String encodePublicKey(java.io.OutputStream s, SkEcdsaPublicKey key) throws java.io.IOExceptionDescription copied from interface:PublicKeyEntryDecoderEncodes thePublicKeyusing theOpenSSHformat - same one used by thedecodePublicKeymethod(s)- Parameters:
s- TheOutputStreamto write the data tokey- ThePublicKey- may not benull- Returns:
- The key type value - one of the
KeyTypeNamesSupport.getSupportedKeyTypes() - Throws:
java.io.IOException- If failed to generate the encoding
-
clonePrivateKey
public java.security.PrivateKey clonePrivateKey(java.security.PrivateKey key)
- Parameters:
key- ThePrivateKeyto clone - ignored ifnull- Returns:
- The cloned key (or
nullif no original key)
-
getKeyFactoryInstance
public java.security.KeyFactory getKeyFactoryInstance()
- Returns:
- A
KeyFactorysuitable for the specific decoder type
-
generateKeyPair
public java.security.KeyPair generateKeyPair(int keySize)
- Parameters:
keySize- Key size in bits- Returns:
- A
KeyPairwith the specified key size
-
getKeyPairGenerator
public java.security.KeyPairGenerator getKeyPairGenerator()
- Returns:
- A
KeyPairGeneratorsuitable for this decoder
-
-