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_KDFBY_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,
CipherFactory cipherSpec,
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, waitfindByName, findFirstMatchByName, getNameList, getNames, ofName, removeByName, safeCompareByNamepublic 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 OpenSSHKdfOptionsIOExceptionprotected void initialize(InputStream stream, int maxSaltSize) throws IOException
IOExceptionpublic boolean isEncrypted()
isEncrypted in interface OpenSSHKeyDecryptorpublic byte[] decodePrivateKeyBytes(SessionContext session, NamedResource resourceKey, CipherFactory cipherSpec, byte[] privateDataBytes, String password) throws IOException, GeneralSecurityException
decodePrivateKeyBytes in interface OpenSSHKeyDecryptorIOExceptionGeneralSecurityExceptionprotected void bcryptKdf(byte[] password,
byte[] output)
throws IOException,
GeneralSecurityException
IOExceptionGeneralSecurityExceptionpublic final String getName()
getName in interface NamedResourcepublic 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 © 2018–2024 The Apache Software Foundation. All rights reserved.