Interface EdDSASupport<PUB extends PublicKey,PRV extends PrivateKey>
- Type Parameters:
PUB- type of the public key supported by the security providerPRV- type of the private key supported by the security provider
- All Known Implementing Classes:
BouncyCastleEdDSASupport,NetI2pCryptoEdDSASupport
public interface EdDSASupport<PUB extends PublicKey,PRV extends PrivateKey>
Provides generic operations required of a security provider to support EdDSA and Ed25519.
- Author:
- Apache MINA SSHD Project
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleancreatePrivateKeySpec(PRV privateKey) createPublicKeySpec(PUB publicKey) static KeyPairdecodeEd25519KeyPair(byte[] keyData) static PrivateKeydecodeEdDSAPrivateKey(byte[] keyData) generateEDDSAPrivateKey(byte[] seed) generateEDDSAPublicKey(byte[] seed) intgetEDDSAKeySize(Key key) byte[]getPrivateKeyData(PRV privateKey) byte[]getPublicKeyData(PUB publicKey) <B extends Buffer>
BputEDDSAKeyPair(B buffer, PublicKey pubKey, PrivateKey prvKey) <B extends Buffer>
BputRawEDDSAPublicKey(B buffer, PublicKey key)
-
Field Details
-
KEY_SIZE
static final int KEY_SIZE- See Also:
-
ED25519_OID
- See Also:
-
-
Method Details
-
decodeEd25519KeyPair
- Parameters:
keyData- the raw private key bytes.- Returns:
- a
KeyPairfrom the given raw private key data. - Throws:
IOExceptionGeneralSecurityException
-
decodeEdDSAPrivateKey
static PrivateKey decodeEdDSAPrivateKey(byte[] keyData) throws IOException, GeneralSecurityException - Parameters:
keyData- the raw private key bytes.- Returns:
- the associated private key.
- Throws:
IOExceptionGeneralSecurityException
-
getEDDSAPublicKeyEntryDecoder
PublicKeyEntryDecoder<PUB,PRV> getEDDSAPublicKeyEntryDecoder()- Returns:
- the public key entry decoder implementation associated with the security provider.
-
getOpenSSHEDDSAPrivateKeyEntryDecoder
PrivateKeyEntryDecoder<PUB,PRV> getOpenSSHEDDSAPrivateKeyEntryDecoder()- Returns:
- the private key entry decoder implementation associated with the security provider.
-
getEDDSASigner
Signature getEDDSASigner()- Returns:
- the signature implementation associated with the security provider.
-
getEDDSAKeySize
- Parameters:
key- the key to get the size of.- Returns:
- the size of the key if it is an EdDSA key, -1 otherwise.
-
getEDDSAPublicKeyType
- Returns:
- the public key class type associated with the security provider.
-
getEDDSAPrivateKeyType
- Returns:
- the private key class type associated with the security provider.
-
compareEDDSAPPublicKeys
- Parameters:
k1- the first keyk2- the second key- Returns:
trueif both keys are instances of the public key type associated with the security provider and they are equal.
-
compareEDDSAPrivateKeys
- Parameters:
k1- the first keyk2- the second key- Returns:
trueif both keys are instances of the private key type associated with the security provider and they are equal.
-
recoverEDDSAPublicKey
- Parameters:
key- the private key- Returns:
- the public key associated with the private key.
- Throws:
GeneralSecurityException
-
generateEDDSAPublicKey
- Parameters:
seed- the raw public key bytes- Returns:
- the associated public key
- Throws:
GeneralSecurityException
-
generateEDDSAPrivateKey
- Parameters:
seed- the raw private key bytes- Returns:
- the associated private key
- Throws:
GeneralSecurityExceptionIOException
-
putRawEDDSAPublicKey
- Type Parameters:
B- type of the buffer- Parameters:
buffer- the buffer to insert the public key intokey- the public key to be inserted into the buffer- Returns:
- the buffer that was passed in
-
putEDDSAKeyPair
- Type Parameters:
B- type of the buffer- Parameters:
buffer- the buffer to insert the keys intopubKey- the public key to be inserted into the bufferprvKey- the private key to be inserted into the buffer- Returns:
- the buffer that was passed in
-
createPublicKeySpec
- Parameters:
publicKey- the public key- Returns:
- a key spec from the public key
-
createPrivateKeySpec
- Parameters:
privateKey- the private key- Returns:
- a key spec from the private key
-
getPublicKeyData
- Parameters:
publicKey- the public key- Returns:
- the raw public key bytes associated with the key
-
getPrivateKeyData
- Parameters:
privateKey- the private key- Returns:
- the raw private key bytes associated with the key
- Throws:
IOException
-
getKeyFactoryAlgorithm
String getKeyFactoryAlgorithm()- Returns:
- the algorithm name used by the provider's
KeyFactory.
-