Interface PublicKeyEntryDecoder<PUB extends PublicKey,PRV extends PrivateKey>
- Type Parameters:
PUB- Type ofPublicKeyPRV- Type ofPrivateKey
- All Superinterfaces:
IdentityResourceLoader<PUB,,PRV> KeyEntryResolver<PUB,,PRV> KeyTypeNamesSupport,PublicKeyEntryResolver,PublicKeyRawDataDecoder<PUB>
- All Known Implementing Classes:
AbstractPublicKeyEntryDecoder,DSSPublicKeyEntryDecoder,ECDSAPublicKeyEntryDecoder,Ed25519PublicKeyDecoder,OpenSSHCertificateDecoder,RSAPublicKeyDecoder,SkECDSAPublicKeyEntryDecoder,SkED25519PublicKeyEntryDecoder
public interface PublicKeyEntryDecoder<PUB extends PublicKey,PRV extends PrivateKey>
extends KeyEntryResolver<PUB,PRV>, PublicKeyRawDataDecoder<PUB>, PublicKeyEntryResolver
Represents a decoder of an
OpenSSH encoded key data-
Field Summary
Fields 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 -
Method Summary
Modifier and TypeMethodDescriptiondefault PUBdecodePublicKeyByType(SessionContext session, String keyType, InputStream keyData, Map<String, String> headers) encodePublicKey(OutputStream s, PUB key) default PublicKeyMethods inherited from interface org.apache.sshd.common.config.keys.IdentityResourceLoader
getPrivateKeyType, getPublicKeyTypeMethods inherited from interface org.apache.sshd.common.config.keys.KeyEntryResolver
cloneKeyPair, clonePrivateKey, clonePublicKey, generateKeyPair, getKeyFactoryInstance, getKeyPairGeneratorMethods inherited from interface org.apache.sshd.common.config.keys.KeyTypeNamesSupport
getSupportedKeyTypesMethods inherited from interface org.apache.sshd.common.config.keys.PublicKeyRawDataDecoder
decodePublicKey, decodePublicKey, decodePublicKey
-
Method Details
-
resolve
default PublicKey resolve(SessionContext session, String keyType, byte[] keyData, Map<String, String> headers) throws IOException, GeneralSecurityException- Specified by:
resolvein interfacePublicKeyEntryResolver- Parameters:
session- TheSessionContextfor invoking this load command - may benullif not invoked within a session context (e.g., offline tool or session unknown).keyType- TheOpenSSHreported key typekeyData- TheOpenSSHencoded key dataheaders- Any headers that may have been available when data was read- Returns:
- The extracted
PublicKey- ignored ifnull - Throws:
IOException- If failed to parse the key dataGeneralSecurityException- If failed to generate the key
-
decodePublicKeyByType
default PUB decodePublicKeyByType(SessionContext session, String keyType, InputStream keyData, Map<String, String> headers) throws IOException, GeneralSecurityException- Specified by:
decodePublicKeyByTypein interfacePublicKeyRawDataDecoder<PUB extends PublicKey>- Throws:
IOExceptionGeneralSecurityException
-
encodePublicKey
- 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
-