Interface EdDSASupport<PUB extends PublicKey,PRV extends PrivateKey>

Type Parameters:
PUB - type of the public key supported by the security provider
PRV - 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 Details

  • Method Details

    • decodeEd25519KeyPair

      static KeyPair decodeEd25519KeyPair(byte[] keyData) throws IOException, GeneralSecurityException
      Parameters:
      keyData - the raw private key bytes.
      Returns:
      a KeyPair from the given raw private key data.
      Throws:
      IOException
      GeneralSecurityException
    • decodeEdDSAPrivateKey

      static PrivateKey decodeEdDSAPrivateKey(byte[] keyData) throws IOException, GeneralSecurityException
      Parameters:
      keyData - the raw private key bytes.
      Returns:
      the associated private key.
      Throws:
      IOException
      GeneralSecurityException
    • 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

      int getEDDSAKeySize(Key key)
      Parameters:
      key - the key to get the size of.
      Returns:
      the size of the key if it is an EdDSA key, -1 otherwise.
    • getEDDSAPublicKeyType

      Class<PUB> getEDDSAPublicKeyType()
      Returns:
      the public key class type associated with the security provider.
    • getEDDSAPrivateKeyType

      Class<PRV> getEDDSAPrivateKeyType()
      Returns:
      the private key class type associated with the security provider.
    • compareEDDSAPPublicKeys

      boolean compareEDDSAPPublicKeys(PublicKey k1, PublicKey k2)
      Parameters:
      k1 - the first key
      k2 - the second key
      Returns:
      true if both keys are instances of the public key type associated with the security provider and they are equal.
    • compareEDDSAPrivateKeys

      boolean compareEDDSAPrivateKeys(PrivateKey k1, PrivateKey k2)
      Parameters:
      k1 - the first key
      k2 - the second key
      Returns:
      true if both keys are instances of the private key type associated with the security provider and they are equal.
    • recoverEDDSAPublicKey

      PUB recoverEDDSAPublicKey(PrivateKey key) throws GeneralSecurityException
      Parameters:
      key - the private key
      Returns:
      the public key associated with the private key.
      Throws:
      GeneralSecurityException
    • generateEDDSAPublicKey

      PUB generateEDDSAPublicKey(byte[] seed) throws GeneralSecurityException
      Parameters:
      seed - the raw public key bytes
      Returns:
      the associated public key
      Throws:
      GeneralSecurityException
    • generateEDDSAPrivateKey

      PRV generateEDDSAPrivateKey(byte[] seed) throws GeneralSecurityException, IOException
      Parameters:
      seed - the raw private key bytes
      Returns:
      the associated private key
      Throws:
      GeneralSecurityException
      IOException
    • putRawEDDSAPublicKey

      <B extends Buffer> B putRawEDDSAPublicKey(B buffer, PublicKey key)
      Type Parameters:
      B - type of the buffer
      Parameters:
      buffer - the buffer to insert the public key into
      key - the public key to be inserted into the buffer
      Returns:
      the buffer that was passed in
    • putEDDSAKeyPair

      <B extends Buffer> B putEDDSAKeyPair(B buffer, PublicKey pubKey, PrivateKey prvKey)
      Type Parameters:
      B - type of the buffer
      Parameters:
      buffer - the buffer to insert the keys into
      pubKey - the public key to be inserted into the buffer
      prvKey - the private key to be inserted into the buffer
      Returns:
      the buffer that was passed in
    • createPublicKeySpec

      KeySpec createPublicKeySpec(PUB publicKey)
      Parameters:
      publicKey - the public key
      Returns:
      a key spec from the public key
    • createPrivateKeySpec

      KeySpec createPrivateKeySpec(PRV privateKey)
      Parameters:
      privateKey - the private key
      Returns:
      a key spec from the private key
    • getPublicKeyData

      byte[] getPublicKeyData(PUB publicKey)
      Parameters:
      publicKey - the public key
      Returns:
      the raw public key bytes associated with the key
    • getPrivateKeyData

      byte[] getPrivateKeyData(PRV privateKey) throws IOException
      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.