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
APrivateKeyEncryptionContextfor use with aOpenSSHKeyPairResourceWriter.
-
-
Field Summary
Fields Modifier and Type Field Description static StringAESstatic intDEFAULT_KDF_ROUNDSDefault number of bcrypt KDF rounds to apply.-
Fields inherited from class org.apache.sshd.common.config.keys.loader.PrivateKeyEncryptionContext
DEFAULT_CIPHER_MODE
-
-
Constructor Summary
Constructors Constructor Description OpenSSHKeyEncryptionContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringgetCipherFactoryName()StringgetCipherName()intgetKdfRounds()Retrieves the number of KDF rounds to apply.voidsetCipherName(String value)voidsetKdfRounds(int rounds)Sets the number of KDF rounds to apply.-
Methods inherited from class org.apache.sshd.common.config.keys.loader.PrivateKeyEncryptionContext
clone, equals, getCipherMode, getCipherType, getInitVector, getPassword, getPrivateKeyObfuscator, getRegisteredPrivateKeyObfuscator, getRegisteredPrivateKeyObfuscatorCiphers, getRegisteredPrivateKeyObfuscators, hashCode, initializeObfuscator, newPrivateKeyEncryptionContext, parseAlgorithmInfo, parseAlgorithmInfo, registerPrivateKeyObfuscator, registerPrivateKeyObfuscator, resolvePrivateKeyObfuscator, setCipherMode, setCipherType, setInitVector, setPassword, setPrivateKeyObfuscator, toString, unregisterPrivateKeyObfuscator, unregisterPrivateKeyObfuscator
-
-
-
-
Field Detail
-
DEFAULT_KDF_ROUNDS
public static final int DEFAULT_KDF_ROUNDS
Default number of bcrypt KDF rounds to apply.- See Also:
- Constant Field Values
-
AES
public static final String AES
- See Also:
- Constant Field Values
-
-
Method Detail
-
getCipherName
public String getCipherName()
- Overrides:
getCipherNamein classPrivateKeyEncryptionContext
-
setCipherName
public void setCipherName(String value)
- Overrides:
setCipherNamein classPrivateKeyEncryptionContext
-
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 theDEFAULT_KDF_ROUNDS, set that default.- Parameters:
rounds- number of rounds to apply
-
getCipherFactoryName
protected String getCipherFactoryName()
- Returns:
- the cipher's factory name.
-
-