Interface PublicKeyEntryDecoder<PUB extends java.security.PublicKey,PRV extends java.security.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 java.security.PublicKey,PRV extends java.security.PrivateKey> extends KeyEntryResolver<PUB,PRV>, PublicKeyRawDataDecoder<PUB>, PublicKeyEntryResolver
Represents a decoder of anOpenSSHencoded key data
-
-
Field Summary
-
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
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default PUBdecodePublicKeyByType(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, PUB key)Encodes thePublicKeyusing theOpenSSHformat - same one used by thedecodePublicKeymethod(s)default java.security.PublicKeyresolve(SessionContext session, java.lang.String keyType, byte[] keyData, java.util.Map<java.lang.String,java.lang.String> headers)-
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, clonePrivateKey, clonePublicKey, generateKeyPair, getKeyFactoryInstance, getKeyPairGenerator
-
Methods inherited from interface org.apache.sshd.common.config.keys.KeyTypeNamesSupport
getSupportedKeyTypes
-
Methods inherited from interface org.apache.sshd.common.config.keys.PublicKeyRawDataDecoder
decodePublicKey, decodePublicKey, decodePublicKey
-
-
-
-
Method Detail
-
resolve
default java.security.PublicKey resolve(SessionContext session, java.lang.String keyType, byte[] keyData, java.util.Map<java.lang.String,java.lang.String> headers) throws java.io.IOException, java.security.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:
java.io.IOException- If failed to parse the key datajava.security.GeneralSecurityException- If failed to generate the key
-
decodePublicKeyByType
default PUB decodePublicKeyByType(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
- Specified by:
decodePublicKeyByTypein interfacePublicKeyRawDataDecoder<PUB extends java.security.PublicKey>- Throws:
java.io.IOExceptionjava.security.GeneralSecurityException
-
encodePublicKey
java.lang.String encodePublicKey(java.io.OutputStream s, PUB key) throws java.io.IOExceptionEncodes 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
-
-