Class AbstractBufferPublicKeyParser<PUB extends java.security.PublicKey>
- java.lang.Object
-
- org.apache.sshd.common.util.buffer.keys.AbstractBufferPublicKeyParser<PUB>
-
- Type Parameters:
PUB
- Type ofPublicKey
being extracted
- All Implemented Interfaces:
BufferPublicKeyParser<PUB>
- Direct Known Subclasses:
DSSBufferPublicKeyParser
,ECBufferPublicKeyParser
,ED25519BufferPublicKeyParser
,OpenSSHCertPublicKeyParser
,RSABufferPublicKeyParser
,SkECBufferPublicKeyParser
,SkED25519BufferPublicKeyParser
public abstract class AbstractBufferPublicKeyParser<PUB extends java.security.PublicKey> extends java.lang.Object implements BufferPublicKeyParser<PUB>
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractBufferPublicKeyParser(java.lang.Class<PUB> keyClass, java.lang.String... supported)
protected
AbstractBufferPublicKeyParser(java.lang.Class<PUB> keyClass, java.util.Collection<java.lang.String> supported)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <S extends java.security.spec.KeySpec>
PUBgeneratePublicKey(java.lang.String algorithm, S keySpec)
java.lang.Class<PUB>
getKeyClass()
protected java.security.KeyFactory
getKeyFactory(java.lang.String algorithm)
java.util.Collection<java.lang.String>
getSupportedKeyTypes()
boolean
isKeyTypeSupported(java.lang.String keyType)
java.lang.String
toString()
-
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.util.buffer.keys.BufferPublicKeyParser
getRawPublicKey
-
-
-
-
Field Detail
-
keyClass
private final java.lang.Class<PUB extends java.security.PublicKey> keyClass
-
supported
private final java.util.Collection<java.lang.String> supported
-
-
Constructor Detail
-
AbstractBufferPublicKeyParser
protected AbstractBufferPublicKeyParser(java.lang.Class<PUB> keyClass, java.lang.String... supported)
-
AbstractBufferPublicKeyParser
protected AbstractBufferPublicKeyParser(java.lang.Class<PUB> keyClass, java.util.Collection<java.lang.String> supported)
-
-
Method Detail
-
getSupportedKeyTypes
public java.util.Collection<java.lang.String> getSupportedKeyTypes()
-
getKeyClass
public final java.lang.Class<PUB> getKeyClass()
-
isKeyTypeSupported
public boolean isKeyTypeSupported(java.lang.String keyType)
- Specified by:
isKeyTypeSupported
in interfaceBufferPublicKeyParser<PUB extends java.security.PublicKey>
- Parameters:
keyType
- The key type - e.g., "ssh-rsa", "ssh-dss"- Returns:
true
if this key type is supported by the parser
-
generatePublicKey
protected <S extends java.security.spec.KeySpec> PUB generatePublicKey(java.lang.String algorithm, S keySpec) throws java.security.GeneralSecurityException
- Throws:
java.security.GeneralSecurityException
-
getKeyFactory
protected java.security.KeyFactory getKeyFactory(java.lang.String algorithm) throws java.security.GeneralSecurityException
- Throws:
java.security.GeneralSecurityException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-