Interface KeyEntryResolver<PUB extends PublicKey,PRV extends PrivateKey>
- Type Parameters:
PUB- Type ofPublicKeyPRV- Type ofPrivateKey
- All Superinterfaces:
IdentityResourceLoader<PUB,,PRV> KeyTypeNamesSupport
- All Known Subinterfaces:
PrivateKeyEntryDecoder<PUB,,PRV> PublicKeyEntryDecoder<PUB,PRV>
- All Known Implementing Classes:
AbstractKeyEntryResolver,AbstractPrivateKeyEntryDecoder,AbstractPublicKeyEntryDecoder,DSSPublicKeyEntryDecoder,ECDSAPublicKeyEntryDecoder,Ed25519PublicKeyDecoder,OpenSSHCertificateDecoder,OpenSSHDSSPrivateKeyEntryDecoder,OpenSSHECDSAPrivateKeyEntryDecoder,OpenSSHEd25519PrivateKeyEntryDecoder,OpenSSHRSAPrivateKeyDecoder,RSAPublicKeyDecoder,SkECDSAPublicKeyEntryDecoder,SkED25519PublicKeyEntryDecoder
public interface KeyEntryResolver<PUB extends PublicKey,PRV extends PrivateKey>
extends IdentityResourceLoader<PUB,PRV>
-
Field Summary
Fields inherited from interface org.apache.sshd.common.config.keys.IdentityResourceLoader
MAX_BIGINT_OCTETS_COUNT -
Method Summary
Modifier and TypeMethodDescriptiondefault KeyPaircloneKeyPair(KeyPair kp) clonePrivateKey(PRV key) clonePublicKey(PUB key) static BigIntegerstatic intdecodeInt(byte[] buf) static intdecodeInt(byte[] buf, int offset, int available) static intdecodeString(byte[] buf, int maxChars) decodeString(byte[] buf, int offset, int available, int maxChars) decodeString(byte[] buf, int offset, int available, Charset cs, int maxChars) Decodes a run-length encoded stringdecodeString(byte[] buf, Charset cs, int maxChars) static StringdecodeString(InputStream s, int maxChars) static StringdecodeString(InputStream s, String charset, int maxChars) static StringdecodeString(InputStream s, Charset cs, int maxChars) static intstatic byte[]encodeInt(OutputStream s, int v) static intencodeString(OutputStream s, String v) static intencodeString(OutputStream s, String v, String charset) static intencodeString(OutputStream s, String v, Charset cs) default KeyPairgenerateKeyPair(int keySize) readRLEBytes(byte[] buf, int maxAllowed) readRLEBytes(byte[] buf, int offset, int available, int maxAllowed) Decodes a run-length encoded byte arraystatic byte[]readRLEBytes(InputStream s, int maxAllowed) static intwriteRLEBytes(OutputStream s, byte... bytes) static intwriteRLEBytes(OutputStream s, byte[] bytes, int off, int len) Methods inherited from interface org.apache.sshd.common.config.keys.IdentityResourceLoader
getPrivateKeyType, getPublicKeyTypeMethods inherited from interface org.apache.sshd.common.config.keys.KeyTypeNamesSupport
getSupportedKeyTypes
-
Method Details
-
generateKeyPair
- Parameters:
keySize- Key size in bits- Returns:
- A
KeyPairwith the specified key size - Throws:
GeneralSecurityException- if unable to generate the pair
-
cloneKeyPair
- Parameters:
kp- TheKeyPairto be cloned - ignored ifnull- Returns:
- A cloned pair (or
nullif no original pair) - Throws:
GeneralSecurityException- If failed to clone - e.g., provided key pair does not contain keys of the expected type- See Also:
-
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
-
getKeyFactoryInstance
- Returns:
- A
KeyFactorysuitable for the specific decoder type - Throws:
GeneralSecurityException- If failed to create one
-
encodeString
- Throws:
IOException
-
encodeString
- Throws:
IOException
-
encodeString
- Throws:
IOException
-
encodeBigInt
- Throws:
IOException
-
writeRLEBytes
- Throws:
IOException
-
writeRLEBytes
- Throws:
IOException
-
encodeInt
- Throws:
IOException
-
decodeString
- Throws:
IOException
-
decodeString
- Throws:
IOException
-
decodeString
- Throws:
IOException
-
decodeBigInt
- Throws:
IOException
-
readRLEBytes
- Throws:
IOException
-
decodeInt
- Throws:
IOException
-
decodeString
-
decodeString
-
decodeString
-
decodeString
static Map.Entry<String,Integer> decodeString(byte[] buf, int offset, int available, Charset cs, int maxChars) Decodes a run-length encoded string- Parameters:
buf- The buffer with the data bytesoffset- The offset in the buffer to decode the stringavailable- The max. available data starting from the offsetcs- TheCharsetto use to decode the stringmaxChars- Max. allowed characters in string - if more than that is encoded then anIndexOutOfBoundsExceptionwill be thrown- Returns:
- The decoded string + the offset of the next byte after it
- See Also:
-
readRLEBytes
-
readRLEBytes
static Map.Entry<byte[],Integer> readRLEBytes(byte[] buf, int offset, int available, int maxAllowed) Decodes a run-length encoded byte array- Parameters:
buf- The buffer with the data bytesoffset- The offset in the buffer to decode the arrayavailable- The max. available data starting from the offsetmaxAllowed- Max. allowed data in decoded buffer - if more than that is encoded then anIndexOutOfBoundsExceptionwill be thrown- Returns:
- The decoded data buffer + the offset of the next byte after it
-
decodeInt
static int decodeInt(byte[] buf) -
decodeInt
static int decodeInt(byte[] buf, int offset, int available)
-