Interface PublicKeyRawDataDecoder
- All Known Subinterfaces:
PublicKeyEntryDecoder
- All Known Implementing Classes:
AbstractPublicKeyEntryDecoder, DSSPublicKeyEntryDecoder, ECDSAPublicKeyEntryDecoder, Ed25519PublicKeyDecoder, OpenSSHCertificateDecoder, RSAPublicKeyDecoder, SkECDSAPublicKeyEntryDecoder, SkED25519PublicKeyEntryDecoder, Ssh2PublicKeyEntryDecoder
public interface PublicKeyRawDataDecoder
- Author:
- Apache MINA SSHD Project
-
Method Summary
Modifier and TypeMethodDescriptiondefault PublicKeydecodePublicKey(SessionContext session, String keyType, byte[] keyData, int offset, int length, Map<String, String> headers) default PublicKeydecodePublicKey(SessionContext session, String keyType, byte[] keyData, Map<String, String> headers) decodePublicKey(SessionContext session, String keyType, InputStream keyData, Map<String, String> headers) decodePublicKeyByType(SessionContext session, String keyType, InputStream keyData, Map<String, String> headers)
-
Method Details
-
decodePublicKey
default PublicKey decodePublicKey(SessionContext session, String keyType, byte[] keyData, Map<String, String> headers) throws IOException, GeneralSecurityException- Parameters:
session- TheSessionContextfor invoking this command - may benullif not invoked within a session context (e.g., offline tool or session unknown).keyType- TheOpenSSHreported key typekeyData- The key data bytes inOpenSSHformat (after BASE64 decoding) - ignored ifnull/emptyheaders- Any headers that may have been available when data was read- Returns:
- The decoded
PublicKey- ornullif no data - Throws:
IOException- If failed to decode the keyGeneralSecurityException- If failed to generate the key
-
decodePublicKey
default PublicKey decodePublicKey(SessionContext session, String keyType, byte[] keyData, int offset, int length, Map<String, String> headers) throws IOException, GeneralSecurityException- Throws:
IOExceptionGeneralSecurityException
-
decodePublicKeyByType
PublicKey decodePublicKeyByType(SessionContext session, String keyType, InputStream keyData, Map<String, String> headers) throws IOException, GeneralSecurityException- Throws:
IOExceptionGeneralSecurityException
-
decodePublicKey
PublicKey decodePublicKey(SessionContext session, String keyType, InputStream keyData, Map<String, String> headers) throws IOException, 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:
IOException- If failed to read from the data streamGeneralSecurityException- If failed to generate the key
-