Top Fields Constructors Methods
org.apache.sshd.common.util.security.eddsa.generic

public Class GenericEd25519PublicKeyDecoder<PUB extends PublicKey, PRV extends PrivateKey>

extends AbstractPublicKeyEntryDecoder<PUB extends PublicKey, PRV extends PrivateKey>
Class Inheritance
Known Direct Subclasses
org.apache.sshd.common.util.security.eddsa.Ed25519PublicKeyDecoder
Imports
java.io.IOException, .InputStream, .OutputStream, java.security.GeneralSecurityException, .KeyFactory, .KeyPairGenerator, .PrivateKey, .PublicKey, java.util.Collections, .Map, .Objects, org.apache.sshd.common.config.keys.KeyEntryResolver, org.apache.sshd.common.config.keys.impl.AbstractPublicKeyEntryDecoder, org.apache.sshd.common.keyprovider.KeyPairProvider, org.apache.sshd.common.session.SessionContext, org.apache.sshd.common.util.security.SecurityUtils

Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
protected final EdDSASupport<PUB, PRV>
public static final int

Constructor Summary

AccessConstructor and Description
public
GenericEd25519PublicKeyDecoder(Class<PUB> pubType, Class<PRV> prvType, EdDSASupport<PUB, PRV> edDSASupport)

Method Summary

Modifier and TypeMethod and Description
public PRV
public PUB
public PUB
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
)

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

public String
encodePublicKey(OutputStream
The OutputStream to write the data to
s
,
PUB
The PublicKey - may not be null
key
)

Implements org.apache.sshd.common.config.keys.PublicKeyEntryDecoder.encodePublicKey.

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

public KeyFactory
public KeyPairGenerator
Inherited from org.apache.sshd.common.config.keys.impl.AbstractPublicKeyEntryDecoder:
parseBooleanHeader

Field Detail

edDSASupportback to summary
protected final EdDSASupport<PUB, PRV> edDSASupport
MAX_ALLOWED_SEED_LENback to summary
public static final int MAX_ALLOWED_SEED_LEN

Constructor Detail

GenericEd25519PublicKeyDecoderback to summary
public GenericEd25519PublicKeyDecoder(Class<PUB> pubType, Class<PRV> prvType, EdDSASupport<PUB, PRV> edDSASupport)

Method Detail

clonePrivateKeyback to summary
public PRV clonePrivateKey(PRV key) throws GeneralSecurityException

Implements org.apache.sshd.common.config.keys.KeyEntryResolver.clonePrivateKey.

Parameters
key:PRV

Doc from org.apache.sshd.common.config.keys.KeyEntryResolver.clonePrivateKey.

The PrivateKey to clone - ignored if null

Returns:PRV

Doc from org.apache.sshd.common.config.keys.KeyEntryResolver.clonePrivateKey.

The cloned key (or null if no original key)

Annotations
@Override
Exceptions
GeneralSecurityException:

Doc from org.apache.sshd.common.config.keys.KeyEntryResolver.clonePrivateKey.

If failed to clone the key

clonePublicKeyback to summary
public PUB clonePublicKey(PUB key) throws GeneralSecurityException

Implements org.apache.sshd.common.config.keys.KeyEntryResolver.clonePublicKey.

Parameters
key:PUB

Doc from org.apache.sshd.common.config.keys.KeyEntryResolver.clonePublicKey.

The PublicKey to clone - ignored if null

Returns:PUB

Doc from org.apache.sshd.common.config.keys.KeyEntryResolver.clonePublicKey.

The cloned key (or null if no original key)

Annotations
@Override
Exceptions
GeneralSecurityException:

Doc from org.apache.sshd.common.config.keys.KeyEntryResolver.clonePublicKey.

If failed to clone the key

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

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

Parameters
session:SessionContext

Doc from org.apache.sshd.common.config.keys.PublicKeyRawDataDecoder.decodePublicKey.

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

Doc from org.apache.sshd.common.config.keys.PublicKeyRawDataDecoder.decodePublicKey.

The reported / encode key type

keyData:InputStream

Doc from org.apache.sshd.common.config.keys.PublicKeyRawDataDecoder.decodePublicKey.

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>

Doc from org.apache.sshd.common.config.keys.PublicKeyRawDataDecoder.decodePublicKey.

Any headers that may have been available when data was read

Returns:PUB

Doc from org.apache.sshd.common.config.keys.PublicKeyRawDataDecoder.decodePublicKey.

The decoded PublicKey

Annotations
@Override
Exceptions
IOException:

Doc from org.apache.sshd.common.config.keys.PublicKeyRawDataDecoder.decodePublicKey.

If failed to read from the data stream

GeneralSecurityException:

Doc from org.apache.sshd.common.config.keys.PublicKeyRawDataDecoder.decodePublicKey.

If failed to generate the key

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

Implements org.apache.sshd.common.config.keys.PublicKeyEntryDecoder.encodePublicKey.

Doc from org.apache.sshd.common.config.keys.PublicKeyEntryDecoder.encodePublicKey.

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()

Annotations
@Override
Exceptions
IOException:
If failed to generate the encoding
getKeyFactoryInstanceback to summary
public KeyFactory getKeyFactoryInstance() throws GeneralSecurityException

Implements org.apache.sshd.common.config.keys.KeyEntryResolver.getKeyFactoryInstance.

Returns:KeyFactory

Doc from org.apache.sshd.common.config.keys.KeyEntryResolver.getKeyFactoryInstance.

A KeyFactory suitable for the specific decoder type

Annotations
@Override
Exceptions
GeneralSecurityException:

Doc from org.apache.sshd.common.config.keys.KeyEntryResolver.getKeyFactoryInstance.

If failed to create one

getKeyPairGeneratorback to summary
public KeyPairGenerator getKeyPairGenerator() throws GeneralSecurityException

Implements org.apache.sshd.common.config.keys.KeyEntryResolver.getKeyPairGenerator.

Returns:KeyPairGenerator

Doc from org.apache.sshd.common.config.keys.KeyEntryResolver.getKeyPairGenerator.

A KeyPairGenerator suitable for this decoder

Annotations
@Override
Exceptions
GeneralSecurityException:

Doc from org.apache.sshd.common.config.keys.KeyEntryResolver.getKeyPairGenerator.

If failed to create the generator