|
Bouncy Castle Cryptography 1.51 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.bouncycastle.bcpg.BCPGObject
org.bouncycastle.bcpg.S2K
public class S2K
Parameter specifier for the PGP string-to-key password based key derivation function.
In iterated mode, S2K takes a single byte iteration count specifier, which is converted to an actual iteration count using a formula that grows the iteration count exponentially as the byte value increases.0x01 == 1088 iterations, and 0xFF
== 65,011,712 iterations.
Field Summary
static int
GNU_DUMMY_S2K
static int
SALTED
Salted key generation.
static int
SALTED_AND_ITERATED
Salted and iterated key generation.
static int
SIMPLE
Simple key generation.
Constructor Summary
S2K(int algorithm)
Constructs a specifier for a simple
S2K generation.
S2K(int algorithm,
byte[] iv)
Constructs a specifier for a salted
S2K generation.
S2K(int algorithm,
byte[] iv,
int itCount)
Constructs a specifier for a salted and iterated
S2K generation.
Method Summary
void
encode(BCPGOutputStream out)
int
getHashAlgorithm()
Gets the hash algorithm
for this S2K.
long
getIterationCount()
Gets the actual (expanded) iteration count.
byte[]
getIV()
Gets the iv/salt to use for the key generation.
int
getProtectionMode()
Gets the protection mode - only if GNU_DUMMY_S2K
int
getType()
Gets the digest algorithm
specified.
Methods inherited from class org.bouncycastle.bcpg.BCPGObject
getEncoded
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Field Detail
SIMPLE
public static final int SIMPLE
- Simple key generation. A single non-salted iteration of a hash function
- See Also:
- Constant Field Values
SALTED
public static final int SALTED
- Salted key generation. A single iteration of a hash function with a (unique) salt
- See Also:
- Constant Field Values
SALTED_AND_ITERATED
public static final int SALTED_AND_ITERATED
- Salted and iterated key generation. Multiple iterations of a hash function, with a salt
- See Also:
- Constant Field Values
GNU_DUMMY_S2K
public static final int GNU_DUMMY_S2K
- See Also:
- Constant Field Values
Constructor Detail
S2K
public S2K(int algorithm)
- Constructs a specifier for a
simple
S2K generation.
- Parameters:
algorithm
- the digest algorithm
to use.
S2K
public S2K(int algorithm,
byte[] iv)
- Constructs a specifier for a
salted
S2K generation.
- Parameters:
algorithm
- the digest algorithm
to use.iv
- the salt to apply to input to the key generation.
S2K
public S2K(int algorithm,
byte[] iv,
int itCount)
- Constructs a specifier for a
salted and iterated
S2K generation.
- Parameters:
algorithm
- the digest algorithm
to iterate.iv
- the salt to apply to input to the key generation.itCount
- the single byte iteration count specifier.
Method Detail
getType
public int getType()
- Gets the
digest algorithm
specified.
getHashAlgorithm
public int getHashAlgorithm()
- Gets the
hash algorithm
for this S2K.
getIV
public byte[] getIV()
- Gets the iv/salt to use for the key generation.
getIterationCount
public long getIterationCount()
- Gets the actual (expanded) iteration count.
getProtectionMode
public int getProtectionMode()
- Gets the protection mode - only if GNU_DUMMY_S2K
encode
public void encode(BCPGOutputStream out)
throws java.io.IOException
- Specified by:
encode
in class BCPGObject
- Throws:
java.io.IOException
Overview
Package
Class
Tree
Deprecated
Index
Help
Bouncy Castle Cryptography 1.51
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD