Top Methods
org.apache.sshd.common.config.keys

public Interface PublicKeyRawDataDecoder<PUB extends PublicKey>

Known Direct Subinterfaces
org.apache.sshd.common.config.keys.PublicKeyEntryDecoder
Known Direct Implementers
org.apache.sshd.common.config.keys.loader.ssh2.Ssh2PublicKeyEntryDecoder
Type Parameters
<PUB>
Generic PublicKey type
Imports
java.io.ByteArrayInputStream, .IOException, .InputStream, java.security.GeneralSecurityException, .PublicKey, java.util.Map, org.apache.sshd.common.session.SessionContext, org.apache.sshd.common.util.NumberUtils

Author
Apache MINA SSHD Project

Method Summary

Modifier and TypeMethod and Description
public default PUB

Returns:

The decoded PublicKey - or null if no data
decodePublicKey
(SessionContext
The SessionContext for invoking this command - may be null if not invoked within a session context (e.g., offline tool or session unknown).
session
,
String
The OpenSSH reported key type
keyType
,
byte[]
The key data bytes in OpenSSH format (after BASE64 decoding) - ignored if null/empty
keyData
,
Map<String, String>
Any headers that may have been available when data was read
headers
)

public default PUB
decodePublicKey(SessionContext session, String keyType, byte[] keyData, int offset, int length, Map<String, String> headers)

public PUB

Returns:

The decoded PublicKey
decodePublicKey
(SessionContext
The SessionContext for invoking this command - may be null if not invoked within a session context (e.g., offline tool or session unknown).
session
,
String
The reported / encode key type
keyType
,
InputStream
The key data bytes stream positioned after the key type decoding and making sure it is one of the supported types
keyData
,
Map<String, String>
Any headers that may have been available when data was read
headers
)

public PUB
decodePublicKeyByType(SessionContext session, String keyType, InputStream keyData, Map<String, String> headers)

Method Detail

decodePublicKeyback to summary
public default PUB decodePublicKey(SessionContext session, String keyType, byte[] keyData, Map<String, String> headers) throws IOException, GeneralSecurityException
Parameters
session:SessionContext

The SessionContext for invoking this command - may be null if not invoked within a session context (e.g., offline tool or session unknown).

keyType:String

The OpenSSH reported key type

keyData:byte[]

The key data bytes in OpenSSH format (after BASE64 decoding) - ignored if null/empty

headers:Map<String, String>

Any headers that may have been available when data was read

Returns:PUB

The decoded PublicKey - or null if no data

Exceptions
IOException:
If failed to decode the key
GeneralSecurityException:
If failed to generate the key
decodePublicKeyback to summary
public default PUB decodePublicKey(SessionContext session, String keyType, byte[] keyData, int offset, int length, Map<String, String> headers) throws IOException, GeneralSecurityException
decodePublicKeyback to summary
public PUB decodePublicKey(SessionContext session, String keyType, InputStream keyData, Map<String, String> headers) throws IOException, GeneralSecurityException
Parameters
session:SessionContext

The SessionContext for invoking this command - may be null if not invoked within a session context (e.g., offline tool or session unknown).

keyType:String

The reported / encode key type

keyData:InputStream

The key data bytes stream positioned after the key type decoding and making sure it is one of the supported types

headers:Map<String, String>

Any headers that may have been available when data was read

Returns:PUB

The decoded PublicKey

Exceptions
IOException:
If failed to read from the data stream
GeneralSecurityException:
If failed to generate the key
decodePublicKeyByTypeback to summary
public PUB decodePublicKeyByType(SessionContext session, String keyType, InputStream keyData, Map<String, String> headers) throws IOException, GeneralSecurityException