public class BCryptKdfOptions extends Object implements OpenSSHKdfOptions
Modifier and Type | Class and Description |
---|---|
static class |
BCryptKdfOptions.BCryptBadRoundsException |
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MAX_ROUNDS
Various discussions on the net seem to indicate that 64 is the value
at which many computers seem to slow down noticeably, so we are rather
generous here.
|
static String |
NAME |
IS_NONE_KDF, MAX_KDF_NAME_LENGTH, MAX_KDF_OPTIONS_SIZE, NONE_KDF
BY_NAME_COMPARATOR, NAME_EXTRACTOR
Constructor and Description |
---|
BCryptKdfOptions() |
Modifier and Type | Method and Description |
---|---|
protected void |
bcryptKdf(byte[] password,
byte[] output) |
byte[] |
decodePrivateKeyBytes(SessionContext session,
NamedResource resourceKey,
String cipherName,
byte[] privateDataBytes,
String password) |
boolean |
equals(Object obj) |
static int |
getMaxAllowedRounds() |
String |
getName() |
int |
getNumRounds() |
byte[] |
getSalt() |
int |
hashCode() |
protected void |
initialize(InputStream stream,
int maxSaltSize) |
void |
initialize(String name,
byte[] kdfOptions) |
boolean |
isEncrypted() |
static void |
setMaxAllowedRounds(int value) |
void |
setNumRounds(int numRounds) |
void |
setSalt(byte[] salt) |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
findByName, getNameList, getNames, ofName, removeByName
public static final String NAME
public static final int DEFAULT_MAX_ROUNDS
-a
parameter to the ssh-keygen
command) is usually 16.public void initialize(String name, byte[] kdfOptions) throws IOException
initialize
in interface OpenSSHKdfOptions
IOException
protected void initialize(InputStream stream, int maxSaltSize) throws IOException
IOException
public boolean isEncrypted()
isEncrypted
in interface OpenSSHKeyDecryptor
public byte[] decodePrivateKeyBytes(SessionContext session, NamedResource resourceKey, String cipherName, byte[] privateDataBytes, String password) throws IOException, GeneralSecurityException
decodePrivateKeyBytes
in interface OpenSSHKeyDecryptor
IOException
GeneralSecurityException
protected void bcryptKdf(byte[] password, byte[] output) throws IOException, GeneralSecurityException
IOException
GeneralSecurityException
public final String getName()
getName
in interface NamedResource
public byte[] getSalt()
public void setSalt(byte[] salt)
public int getNumRounds()
public void setNumRounds(int numRounds)
public static int getMaxAllowedRounds()
public static void setMaxAllowedRounds(int value)
Copyright © 2008–2022 The Apache Software Foundation. All rights reserved.