demo.pkcs.pkcs11.wrapper
Class SimpleTest
java.lang.Object
demo.pkcs.pkcs11.wrapper.SimpleTest
- public class SimpleTest
- extends Object
This is a simple class for testing the implementation.
Notice that this is an sample that may not run as is with many tokens.
It may be required to exclude some test methods in the main method.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CERTIFICATE_FILE
protected static final String CERTIFICATE_FILE
- See Also:
- Constant Field Values
SIGNATURE_FILE
protected static final String SIGNATURE_FILE
- See Also:
- Constant Field Values
DIGEST_FILE
protected static final String DIGEST_FILE
- See Also:
- Constant Field Values
myPKCS11Module_
protected PKCS11 myPKCS11Module_
userPin_
protected String userPin_
token_
protected long token_
session_
protected long session_
objects_
protected long[] objects_
signatureKeyHandle_
protected long signatureKeyHandle_
certificateHandle_
protected long certificateHandle_
derEncodedCertificate_
protected byte[] derEncodedCertificate_
file_
protected File file_
signatureMechanism_
protected CK_MECHANISM signatureMechanism_
digestMechanism_
protected CK_MECHANISM digestMechanism_
messageDigest_
protected MessageDigest messageDigest_
signature_
protected byte[] signature_
digest_
protected byte[] digest_
SimpleTest
public SimpleTest(String pkcs11Module,
String userPin,
File file)
throws IOException,
PKCS11Exception
main
public static void main(String[] args)
printUsage
public static void printUsage()
initialize
public void initialize()
throws PKCS11Exception
- Throws:
PKCS11Exception
getInfo
public void getInfo()
throws PKCS11Exception
- Throws:
PKCS11Exception
getSlotInfo
public void getSlotInfo()
throws PKCS11Exception
- Throws:
PKCS11Exception
getTokenInfo
public void getTokenInfo()
throws PKCS11Exception
- Throws:
PKCS11Exception
getMechanismInfo
public void getMechanismInfo()
throws PKCS11Exception
- Throws:
PKCS11Exception
initToken
public void initToken()
throws PKCS11Exception
- Throws:
PKCS11Exception
openROSession
public void openROSession()
throws PKCS11Exception
- Throws:
PKCS11Exception
getSessionInfo
public void getSessionInfo()
throws PKCS11Exception
- Throws:
PKCS11Exception
findAllObjects
public void findAllObjects()
throws PKCS11Exception
- Throws:
PKCS11Exception
printAllObjects
public void printAllObjects()
throws PKCS11Exception
- Throws:
PKCS11Exception
loginUser
public void loginUser()
throws PKCS11Exception
- Throws:
PKCS11Exception
findSignatureKey
public void findSignatureKey()
throws PKCS11Exception
- Throws:
PKCS11Exception
findCertificate
public void findCertificate()
throws PKCS11Exception
- Throws:
PKCS11Exception
readCertificate
public void readCertificate()
throws PKCS11Exception
- Throws:
PKCS11Exception
writeCertificateToFile
public void writeCertificateToFile()
throws IOException,
PKCS11Exception
- Throws:
IOException
PKCS11Exception
signData
public void signData()
throws IOException,
PKCS11Exception
- Throws:
IOException
PKCS11Exception
writeSignatureToFile
public void writeSignatureToFile()
throws IOException,
PKCS11Exception
- Throws:
IOException
PKCS11Exception
digestData
public void digestData()
throws IOException,
PKCS11Exception
- Throws:
IOException
PKCS11Exception
writeDigestToFile
public void writeDigestToFile()
throws IOException,
PKCS11Exception
- Throws:
IOException
PKCS11Exception
logout
public void logout()
throws PKCS11Exception
- Throws:
PKCS11Exception
closeSession
public void closeSession()
throws PKCS11Exception
- Throws:
PKCS11Exception
IAIK JavaSecurity Website http://jce.iaik.tugraz.at/
IAIK at Graz University of Technology, Austria, Europe
Copyright 2001-2002, IAIK, Graz University of Technology, Inffeldgasse 16a, 8010 Graz, Austria. All Rights Reserved.