Class OpenSSHKeyEncryptionContext

java.lang.Object
org.apache.sshd.common.config.keys.loader.PrivateKeyEncryptionContext
org.apache.sshd.common.config.keys.writer.openssh.OpenSSHKeyEncryptionContext
All Implemented Interfaces:
Cloneable, MutablePassword, PasswordHolder

public class OpenSSHKeyEncryptionContext extends PrivateKeyEncryptionContext
  • Field Details

    • DEFAULT_KDF_ROUNDS

      public static final int DEFAULT_KDF_ROUNDS
      Default number of bcrypt KDF rounds to apply.
      See Also:
    • AES

      public static final String AES
      See Also:
    • kdfRounds

      private int kdfRounds
  • Constructor Details

    • OpenSSHKeyEncryptionContext

      public OpenSSHKeyEncryptionContext()
  • Method Details

    • getCipherName

      public String getCipherName()
      Overrides:
      getCipherName in class PrivateKeyEncryptionContext
    • setCipherName

      public void setCipherName(String value)
      Overrides:
      setCipherName in class PrivateKeyEncryptionContext
    • getKdfRounds

      public int getKdfRounds()
      Retrieves the number of KDF rounds to apply.
      Returns:
      the default number of KDF rounds, >= DEFAULT_KDF_ROUNDS
    • setKdfRounds

      public void setKdfRounds(int rounds)
      Sets the number of KDF rounds to apply. If smaller than the DEFAULT_KDF_ROUNDS, set that default.
      Parameters:
      rounds - number of rounds to apply
    • getCipherFactoryName

      protected String getCipherFactoryName()
      Returns:
      the cipher's factory name.