Class Ed25519PublicKeyDecoder
- java.lang.Object
-
- org.apache.sshd.common.util.logging.AbstractLoggingBean
-
- org.apache.sshd.common.config.keys.impl.AbstractIdentityResourceLoader<PUB,PRV>
-
- org.apache.sshd.common.config.keys.impl.AbstractKeyEntryResolver<PUB,PRV>
-
- org.apache.sshd.common.config.keys.impl.AbstractPublicKeyEntryDecoder<net.i2p.crypto.eddsa.EdDSAPublicKey,net.i2p.crypto.eddsa.EdDSAPrivateKey>
-
- org.apache.sshd.common.util.security.eddsa.Ed25519PublicKeyDecoder
-
- All Implemented Interfaces:
IdentityResourceLoader<net.i2p.crypto.eddsa.EdDSAPublicKey,net.i2p.crypto.eddsa.EdDSAPrivateKey>
,KeyEntryResolver<net.i2p.crypto.eddsa.EdDSAPublicKey,net.i2p.crypto.eddsa.EdDSAPrivateKey>
,KeyTypeNamesSupport
,PublicKeyEntryDecoder<net.i2p.crypto.eddsa.EdDSAPublicKey,net.i2p.crypto.eddsa.EdDSAPrivateKey>
,PublicKeyEntryResolver
,PublicKeyRawDataDecoder<net.i2p.crypto.eddsa.EdDSAPublicKey>
public final class Ed25519PublicKeyDecoder extends AbstractPublicKeyEntryDecoder<net.i2p.crypto.eddsa.EdDSAPublicKey,net.i2p.crypto.eddsa.EdDSAPrivateKey>
- Author:
- Apache MINA SSHD Project
-
-
Field Summary
Fields Modifier and Type Field Description static Ed25519PublicKeyDecoder
INSTANCE
static int
MAX_ALLOWED_SEED_LEN
-
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
-
Fields inherited from interface org.apache.sshd.common.config.keys.IdentityResourceLoader
MAX_BIGINT_OCTETS_COUNT
-
Fields inherited from interface org.apache.sshd.common.config.keys.PublicKeyEntryResolver
FAILING, IGNORING
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description net.i2p.crypto.eddsa.EdDSAPrivateKey
clonePrivateKey(net.i2p.crypto.eddsa.EdDSAPrivateKey key)
net.i2p.crypto.eddsa.EdDSAPublicKey
clonePublicKey(net.i2p.crypto.eddsa.EdDSAPublicKey key)
net.i2p.crypto.eddsa.EdDSAPublicKey
decodePublicKey(SessionContext session, String keyType, InputStream keyData, Map<String,String> headers)
String
encodePublicKey(OutputStream s, net.i2p.crypto.eddsa.EdDSAPublicKey key)
KeyFactory
getKeyFactoryInstance()
KeyPairGenerator
getKeyPairGenerator()
static byte[]
getSeedValue(net.i2p.crypto.eddsa.EdDSAPublicKey key)
-
Methods inherited from class org.apache.sshd.common.config.keys.impl.AbstractPublicKeyEntryDecoder
parseBooleanHeader
-
Methods inherited from class org.apache.sshd.common.config.keys.impl.AbstractKeyEntryResolver
generatePrivateKey, generatePublicKey, toString
-
Methods inherited from class org.apache.sshd.common.config.keys.impl.AbstractIdentityResourceLoader
getPrivateKeyType, getPublicKeyType, getSupportedKeyTypes
-
Methods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warn
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.sshd.common.config.keys.IdentityResourceLoader
getPrivateKeyType, getPublicKeyType
-
Methods inherited from interface org.apache.sshd.common.config.keys.KeyEntryResolver
cloneKeyPair, generateKeyPair
-
Methods inherited from interface org.apache.sshd.common.config.keys.KeyTypeNamesSupport
getSupportedKeyTypes
-
Methods inherited from interface org.apache.sshd.common.config.keys.PublicKeyEntryDecoder
decodePublicKeyByType, resolve
-
Methods inherited from interface org.apache.sshd.common.config.keys.PublicKeyRawDataDecoder
decodePublicKey, decodePublicKey
-
-
-
-
Field Detail
-
MAX_ALLOWED_SEED_LEN
public static final int MAX_ALLOWED_SEED_LEN
- See Also:
- Constant Field Values
-
INSTANCE
public static final Ed25519PublicKeyDecoder INSTANCE
-
-
Method Detail
-
clonePublicKey
public net.i2p.crypto.eddsa.EdDSAPublicKey clonePublicKey(net.i2p.crypto.eddsa.EdDSAPublicKey key) throws GeneralSecurityException
- Parameters:
key
- ThePublicKey
to clone - ignored ifnull
- Returns:
- The cloned key (or
null
if no original key) - Throws:
GeneralSecurityException
- If failed to clone the key
-
clonePrivateKey
public net.i2p.crypto.eddsa.EdDSAPrivateKey clonePrivateKey(net.i2p.crypto.eddsa.EdDSAPrivateKey key) throws GeneralSecurityException
- Parameters:
key
- ThePrivateKey
to clone - ignored ifnull
- Returns:
- The cloned key (or
null
if no original key) - Throws:
GeneralSecurityException
- If failed to clone the key
-
getKeyPairGenerator
public KeyPairGenerator getKeyPairGenerator() throws GeneralSecurityException
- Returns:
- A
KeyPairGenerator
suitable for this decoder - Throws:
GeneralSecurityException
- If failed to create the generator
-
encodePublicKey
public String encodePublicKey(OutputStream s, net.i2p.crypto.eddsa.EdDSAPublicKey key) throws IOException
Description copied from interface:PublicKeyEntryDecoder
- Parameters:
s
- TheOutputStream
to write the data tokey
- ThePublicKey
- may not benull
- Returns:
- The key type value - one of the
KeyTypeNamesSupport.getSupportedKeyTypes()
- Throws:
IOException
- If failed to generate the encoding
-
getKeyFactoryInstance
public KeyFactory getKeyFactoryInstance() throws GeneralSecurityException
- Returns:
- A
KeyFactory
suitable for the specific decoder type - Throws:
GeneralSecurityException
- If failed to create one
-
decodePublicKey
public net.i2p.crypto.eddsa.EdDSAPublicKey decodePublicKey(SessionContext session, String keyType, InputStream keyData, Map<String,String> headers) throws IOException, GeneralSecurityException
- Parameters:
session
- TheSessionContext
for invoking this command - may benull
if not invoked within a session context (e.g., offline tool or session unknown).keyType
- The reported / encode key typekeyData
- The key data bytes stream positioned after the key type decoding and making sure it is one of the supported typesheaders
- Any headers that may have been available when data was read- Returns:
- The decoded
PublicKey
- Throws:
IOException
- If failed to read from the data streamGeneralSecurityException
- If failed to generate the key
-
getSeedValue
public static byte[] getSeedValue(net.i2p.crypto.eddsa.EdDSAPublicKey key)
-
-