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
APrivateKeyEncryptionContext
for use with aOpenSSHKeyPairResourceWriter
.
-
-
Field Summary
Fields Modifier and Type Field Description static String
AES
static int
DEFAULT_KDF_ROUNDS
Default 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 String
getCipherFactoryName()
String
getCipherName()
int
getKdfRounds()
Retrieves the number of KDF rounds to apply.void
setCipherName(String value)
void
setKdfRounds(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:
getCipherName
in classPrivateKeyEncryptionContext
-
setCipherName
public void setCipherName(String value)
- Overrides:
setCipherName
in 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.
-
-