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
A
PrivateKeyEncryptionContext
for use with a OpenSSHKeyPairResourceWriter
.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final int
Default number of bcrypt KDF rounds to apply.private int
Fields inherited from class org.apache.sshd.common.config.keys.loader.PrivateKeyEncryptionContext
DEFAULT_CIPHER_MODE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String
int
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 Details
-
DEFAULT_KDF_ROUNDS
public static final int DEFAULT_KDF_ROUNDSDefault number of bcrypt KDF rounds to apply.- See Also:
-
AES
- See Also:
-
kdfRounds
private int kdfRounds
-
-
Constructor Details
-
OpenSSHKeyEncryptionContext
public OpenSSHKeyEncryptionContext()
-
-
Method Details
-
getCipherName
- Overrides:
getCipherName
in classPrivateKeyEncryptionContext
-
setCipherName
- 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
- Returns:
- the cipher's factory name.
-