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

public Interface PublicKeyEntryDecoder<PUB extends PublicKey, PRV extends PrivateKey>

extends KeyEntryResolver<PUB extends PublicKey, PRV extends PrivateKey>, PublicKeyRawDataDecoder<PUB extends PublicKey>, PublicKeyEntryResolver
Known Direct Implementers
org.apache.sshd.common.config.keys.impl.AbstractPublicKeyEntryDecoder
Type Parameters
<PUB>
Type of PublicKey
<PRV>
Type of PrivateKey
Imports
java.io.IOException, .InputStream, .OutputStream, .StreamCorruptedException, java.security.GeneralSecurityException, .PrivateKey, .PublicKey, java.security.spec.InvalidKeySpecException, java.util.Collection, .Map, org.apache.sshd.common.config.keys.loader.KeyPairResourceLoader, org.apache.sshd.common.session.SessionContext, org.apache.sshd.common.util.GenericUtils, .ValidateUtils

Represents a decoder of an OpenSSH encoded key data
Author
Apache MINA SSHD Project

Field Summary

Inherited from org.apache.sshd.common.config.keys.PublicKeyEntryResolver:
FAILINGIGNORINGUNSUPPORTED

Method Summary

Modifier and TypeMethod and Description
public default PUB
public String

Returns:

The key type value - one of the getSupportedKeyTypes()
encodePublicKey
(OutputStream
The OutputStream to write the data to
s
,
PUB
The PublicKey - may not be null
key
)

Encodes the PublicKey using the OpenSSH format - same one used by the decodePublicKey method(s)

public default PublicKey
resolve(SessionContext
The SessionContext for invoking this load 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 OpenSSH encoded key data
keyData
,
Map<String, String>
Any headers that may have been available when data was read
headers
)

Implements org.apache.sshd.common.config.keys.PublicKeyEntryResolver.resolve.

Inherited from org.apache.sshd.common.config.keys.KeyEntryResolver:
cloneKeyPairclonePrivateKeyclonePublicKeydecodeBigIntdecodeIntdecodeIntdecodeIntdecodeStringdecodeStringdecodeStringdecodeStringdecodeStringdecodeStringdecodeStringencodeBigIntencodeIntencodeStringencodeStringencodeStringgenerateKeyPairgetKeyFactoryInstancegetKeyPairGeneratorreadRLEBytesreadRLEBytesreadRLEByteswriteRLEByteswriteRLEBytes
Inherited from org.apache.sshd.common.config.keys.PublicKeyRawDataDecoder:
decodePublicKeydecodePublicKeydecodePublicKey

Method Detail

decodePublicKeyByTypeback to summary
public default PUB decodePublicKeyByType(SessionContext session, String keyType, InputStream keyData, Map<String, String> headers) throws IOException, GeneralSecurityException

Implements org.apache.sshd.common.config.keys.PublicKeyRawDataDecoder.decodePublicKeyByType.

Annotations
@Override
encodePublicKeyback to summary
public String encodePublicKey(OutputStream s, PUB key) throws IOException

Encodes the PublicKey using the OpenSSH format - same one used by the decodePublicKey method(s)

Parameters
s:OutputStream

The OutputStream to write the data to

key:PUB

The PublicKey - may not be null

Returns:String

The key type value - one of the getSupportedKeyTypes()

Exceptions
IOException:
If failed to generate the encoding
resolveback to summary
public default PublicKey resolve(SessionContext session, String keyType, byte[] keyData, Map<String, String> headers) throws IOException, GeneralSecurityException

Implements org.apache.sshd.common.config.keys.PublicKeyEntryResolver.resolve.

Parameters
session:SessionContext

Doc from org.apache.sshd.common.config.keys.PublicKeyEntryResolver.resolve.

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

keyType:String

Doc from org.apache.sshd.common.config.keys.PublicKeyEntryResolver.resolve.

The OpenSSH reported key type

keyData:byte[]

Doc from org.apache.sshd.common.config.keys.PublicKeyEntryResolver.resolve.

The OpenSSH encoded key data

headers:Map<String, String>

Doc from org.apache.sshd.common.config.keys.PublicKeyEntryResolver.resolve.

Any headers that may have been available when data was read

Returns:PublicKey

Doc from org.apache.sshd.common.config.keys.PublicKeyEntryResolver.resolve.

The extracted PublicKey - ignored if null

Annotations
@Override
Exceptions
IOException:

Doc from org.apache.sshd.common.config.keys.PublicKeyEntryResolver.resolve.

If failed to parse the key data

GeneralSecurityException:

Doc from org.apache.sshd.common.config.keys.PublicKeyEntryResolver.resolve.

If failed to generate the key