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

public Class OpenSSHCertificateDecoder

extends AbstractPublicKeyEntryDecoder<OpenSshCertificate, OpenSshCertificate>
Class Inheritance
Imports
java.io.ByteArrayInputStream, .ByteArrayOutputStream, .IOException, .InputStream, .OutputStream, java.security.GeneralSecurityException, .KeyFactory, .KeyPairGenerator, java.util.Arrays, .Collections, .Map, .Objects, org.apache.sshd.common.config.keys.KeyUtils, .OpenSshCertificate, org.apache.sshd.common.keyprovider.KeyPairProvider, org.apache.sshd.common.session.SessionContext, org.apache.sshd.common.util.buffer.ByteArrayBuffer, org.apache.sshd.common.util.buffer.keys.OpenSSHCertPublicKeyParser, org.apache.sshd.common.util.io.IoUtils

Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
public static final OpenSSHCertificateDecoder

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public OpenSshCertificate
public OpenSshCertificate
public OpenSshCertificate
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
,
OpenSshCertificate
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

INSTANCEback to summary
public static final OpenSSHCertificateDecoder INSTANCE

Constructor Detail

OpenSSHCertificateDecoderback to summary
public OpenSSHCertificateDecoder()

Method Detail

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

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

Parameters
key:OpenSshCertificate

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

The PrivateKey to clone - ignored if null

Returns:OpenSshCertificate

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

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

Parameters
key:OpenSshCertificate

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

The PublicKey to clone - ignored if null

Returns:OpenSshCertificate

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

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, OpenSshCertificate 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:OpenSshCertificate

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