org.bouncycastle.bcpg

Class S2K


public class S2K
extends BCPGObject

The string to key specifier class

Field Summary

static int
GNU_DUMMY_S2K
static int
SALTED
static int
SALTED_AND_ITERATED
static int
SIMPLE

Constructor Summary

S2K(int algorithm)
S2K(int algorithm, byte[] iv)
S2K(int algorithm, byte[] iv, int itCount)

Method Summary

void
encode(BCPGOutputStream out)
int
getHashAlgorithm()
return the hash algorithm for this S2K
byte[]
getIV()
return the iv for the key generation algorithm
long
getIterationCount()
return the iteration count
int
getProtectionMode()
the protection mode - only if GN_DUMMY_S2K
int
getType()

Methods inherited from class org.bouncycastle.bcpg.BCPGObject

encode, getEncoded

Field Details

GNU_DUMMY_S2K

public static final int GNU_DUMMY_S2K
Field Value:
101

SALTED

public static final int SALTED
Field Value:
1

SALTED_AND_ITERATED

public static final int SALTED_AND_ITERATED
Field Value:
3

SIMPLE

public static final int SIMPLE
Field Value:
0

Constructor Details

S2K

public S2K(int algorithm)

S2K

public S2K(int algorithm,
           byte[] iv)

S2K

public S2K(int algorithm,
           byte[] iv,
           int itCount)

Method Details

encode

public void encode(BCPGOutputStream out)
            throws IOException
Overrides:
encode in interface BCPGObject

getHashAlgorithm

public int getHashAlgorithm()
return the hash algorithm for this S2K

getIV

public byte[] getIV()
return the iv for the key generation algorithm

getIterationCount

public long getIterationCount()
return the iteration count

getProtectionMode

public int getProtectionMode()
the protection mode - only if GN_DUMMY_S2K

getType

public int getType()