Interface KeyEntryResolver
- All Superinterfaces:
KeyTypeNamesSupport
- All Known Subinterfaces:
PrivateKeyEntryDecoder, PublicKeyEntryDecoder
- All Known Implementing Classes:
AbstractKeyEntryResolver, AbstractPrivateKeyEntryDecoder, AbstractPublicKeyEntryDecoder, DSSPublicKeyEntryDecoder, ECDSAPublicKeyEntryDecoder, Ed25519PublicKeyDecoder, OpenSSHCertificateDecoder, OpenSSHDSSPrivateKeyEntryDecoder, OpenSSHECDSAPrivateKeyEntryDecoder, OpenSSHEd25519PrivateKeyEntryDecoder, OpenSSHRSAPrivateKeyDecoder, RSAPublicKeyDecoder, SkECDSAPublicKeyEntryDecoder, SkED25519PublicKeyEntryDecoder
- Author:
- Apache MINA SSHD Project
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intA reasonable max. number of octets used for aBigIntegerin the context of keys based on such numbers -
Method Summary
Modifier and TypeMethodDescriptionstatic 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 KeyTypeNamesSupport
getSupportedKeyTypes
-
Field Details
-
MAX_BIGINT_OCTETS_COUNT
static final int MAX_BIGINT_OCTETS_COUNTA reasonable max. number of octets used for aBigIntegerin the context of keys based on such numbers- See Also:
-
-
Method Details
-
generateKeyPair
- Parameters:
keySize- Key size in bits- Returns:
- A
KeyPairwith the specified key size - Throws:
GeneralSecurityException- if unable to generate the pair
-
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)
-