Top Fields Constructors Methods
org.apache.sshd.common.config.keys.impl

public Class ECDSAPublicKeyEntryDecoder

extends AbstractPublicKeyEntryDecoder<ECPublicKey, ECPrivateKey>
Class Inheritance
Imports
java.io.IOException, .InputStream, .OutputStream, java.security.GeneralSecurityException, .InvalidKeyException, .KeyFactory, .KeyPair, .KeyPairGenerator, .NoSuchProviderException, java.security.interfaces.ECPrivateKey, .ECPublicKey, java.security.spec.ECParameterSpec, .ECPoint, .ECPrivateKeySpec, .ECPublicKeySpec, .InvalidKeySpecException, java.util.Map, .Objects, org.apache.sshd.common.cipher.ECCurves, org.apache.sshd.common.config.keys.IdentityResourceLoader, .KeyEntryResolver, .KeyUtils, org.apache.sshd.common.session.SessionContext, org.apache.sshd.common.util.buffer.BufferUtils, org.apache.sshd.common.util.security.SecurityUtils

Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
public static final byte
public static final byte
public static final byte
public static final ECDSAPublicKeyEntryDecoder
public static final int
public static final int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public ECPrivateKey
public ECPublicKey
public ECPublicKey
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.

pack-priv ECPublicKey
public String
encodePublicKey(OutputStream
The OutputStream to write the data to
s
,
ECPublicKey
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)

pack-priv static void
public KeyPair
public KeyFactory
public KeyPairGenerator
Inherited from org.apache.sshd.common.config.keys.impl.AbstractPublicKeyEntryDecoder:
parseBooleanHeader

Field Detail

ECPOINT_COMPRESSED_VARIANT_2back to summary
public static final byte ECPOINT_COMPRESSED_VARIANT_2
ECPOINT_COMPRESSED_VARIANT_3back to summary
public static final byte ECPOINT_COMPRESSED_VARIANT_3
ECPOINT_UNCOMPRESSED_FORM_INDICATORback to summary
public static final byte ECPOINT_UNCOMPRESSED_FORM_INDICATOR
INSTANCEback to summary
public static final ECDSAPublicKeyEntryDecoder INSTANCE
MAX_ALLOWED_POINT_SIZEback to summary
public static final int MAX_ALLOWED_POINT_SIZE
MAX_CURVE_NAME_LENGTHback to summary
public static final int MAX_CURVE_NAME_LENGTH

Constructor Detail

ECDSAPublicKeyEntryDecoderback to summary
public ECDSAPublicKeyEntryDecoder()

Method Detail

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

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

Parameters
key:ECPrivateKey

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

The PrivateKey to clone - ignored if null

Returns:ECPrivateKey

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 ECPublicKey clonePublicKey(ECPublicKey key) throws GeneralSecurityException

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

Parameters
key:ECPublicKey

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

The PublicKey to clone - ignored if null

Returns:ECPublicKey

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 ECPublicKey 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:ECPublicKey

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

decodePublicKeyback to summary
pack-priv ECPublicKey decodePublicKey(ECCurves curve, InputStream keyData) throws IOException, GeneralSecurityException
encodePublicKeyback to summary
public String encodePublicKey(OutputStream s, ECPublicKey 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:ECPublicKey

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
encodePublicKeyback to summary
pack-priv static void encodePublicKey(OutputStream s, String keyType, ECCurves curve, ECPoint w) throws IOException
generateKeyPairback to summary
public KeyPair generateKeyPair(int keySize) throws GeneralSecurityException

Overrides default org.apache.sshd.common.config.keys.KeyEntryResolver.generateKeyPair.

Parameters
keySize:int

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

Key size in bits

Returns:KeyPair

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

A KeyPair with the specified key size

Annotations
@Override
Exceptions
GeneralSecurityException:

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

if unable to generate the pair

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