public class DemoUtil extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static boolean |
CREATE_DEMO_KEYSTORE_AUTOMATICAllY
Whether to
create a new demo keystore automatically
if it is not present or to explicitly ask if to create it. |
static boolean |
DEMO_DEBUG
Debug flag for all demos
|
static iaik.asn1.ObjectID |
IAIK_JAVA_SECURITY_DEMO_CMS_OID
Base OID for IAIK-CMS demos.
|
Modifier and Type | Method and Description |
---|---|
static void |
addIaikProvider()
Adds the IAIK JCE as a first security provider.
|
static void |
addProvider(java.lang.String name)
Adds the cryptography provider with the given name.
|
static iaik.asn1.structures.AlgorithmID |
createPssAlgorithmID(iaik.asn1.structures.AlgorithmID hashID,
iaik.asn1.structures.AlgorithmID mgfID,
int saltLength)
Creates a RSA-PSS AlgorithmID with the supplied parameters (hash algorithm id,
mask generation function, salt length).
|
static double |
getIaikProviderVersion()
Gets the version number of the IAIK-JCE provider used for this demos.
|
static void |
initDemos()
Perform a some initial setup to allow the demos to work
|
static void |
initDemos(boolean quickStart)
Perform a some initial setup to allow the demos to work
|
static void |
initRandom()
Setup the random number generator for a quick start.
|
static void |
initRandom(boolean quick)
Setup the random number generator for a quick start.
|
static void |
waitKey()
Wait for the user to press the return key on System.in.
|
public static final boolean DEMO_DEBUG
public static final iaik.asn1.ObjectID IAIK_JAVA_SECURITY_DEMO_CMS_OID
public static boolean CREATE_DEMO_KEYSTORE_AUTOMATICAllY
create
a new demo keystore automatically
if it is not present or to explicitly ask if to create it.public static void initDemos()
public static void initDemos(boolean quickStart)
quickStart
- whether to init the random generator with a
(not strong) seed for quick start (ONLY FOR
DEMO PURPOSES; NOT FOR PRODUCTION ENVIRONMENT!)public static void addIaikProvider()
public static double getIaikProviderVersion()
public static void addProvider(java.lang.String name)
SecurityProvider
class for more information.name
- the name of the provider to be addedpublic static void initRandom()
public static void initRandom(boolean quick)
quick
- whether to init the random generator with a (not strong) seed
for quick start (only for demonstration purposes)public static iaik.asn1.structures.AlgorithmID createPssAlgorithmID(iaik.asn1.structures.AlgorithmID hashID, iaik.asn1.structures.AlgorithmID mgfID, int saltLength) throws java.security.InvalidAlgorithmParameterException, java.security.NoSuchAlgorithmException
hashID
- the hash algorithm to be usedmgfID
- the mask generation function to be usedsaltLength
- the salt length to be usedjava.security.InvalidAlgorithmParameterException
- if the parameters cannot be created/setjava.security.NoSuchAlgorithmException
- if there is no AlgorithmParameters implementation
for RSA-PSSpublic static void waitKey()