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 Stringstatic final intDefault number of bcrypt KDF rounds to apply.private intFields inherited from class PrivateKeyEncryptionContext
DEFAULT_CIPHER_MODE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringintRetrieves 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 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:
getCipherNamein classPrivateKeyEncryptionContext
-
setCipherName
- 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
- Returns:
- the cipher's factory name.
-