public class ImplicitRSAPssSignedDataStreamDemo extends SignedDataStreamDemo
SecurityProvider
feature of the IAIK-CMS toolkit.
For running this demo the following packages are required (in addition to
iaik_cms.jar
and iaik_cms_demo.jar
):
iaik_jce(full).jar
(IAIK-JCE crypto toolkit)
iaikPkcs11Wrapper.jar
(IAIK PKCS#11 Wrapper)
iaikPkcs11Provider.jar
(IAIK PKCS#11 Provider)
pkcs11wrapper.dll
for Windows
and libpkcs11wrapper.so
for Unix)
iaik_cms.jar
, iaik_cms_demo.jar
, iaik_jce(full).jar
,
iaikPkcs11Wrapper.jar
and iaikPkcs11Provider.jar
have to
be put into the classpath, the shared library (pkcs11wrapper.dll
or
libpkcs11wrapper.so
) has to be in your system library search path
or in your VM library path, e.g. (on Windows, assuming that all jar files in a lib
located in a lib sub-directory and the dll is in a lib/win64 sub-directory):
java -Djava.library.path=lib/win64 -cp lib/iaik_jce.jar;lib/iaikPkcs11Wrapper.jar;lib/iaikPkcs11Provider.jar;lib/iaik_cms.jar;lib/iaik_cms_demo.jar demo.pkcs11.ImplicitSignedDataStreamDemo <pkcs11Module>.dll
signerCertificate_, signerKey_
iaikPkcs11Provider_, iaikSoftwareProvider_, moduleName_, tokenKeyStore_, userPin_
Constructor and Description |
---|
ImplicitRSAPssSignedDataStreamDemo()
Creates a ImplicitRSAPssSignedDataStreamDemo object that has to be explicitly
initialized with a module name. |
ImplicitRSAPssSignedDataStreamDemo(java.lang.String moduleName,
char[] userPin)
Creates a ImplicitRSAPssSignedDataStreamDemo object for the given module name.
|
Modifier and Type | Method and Description |
---|---|
protected iaik.cms.SignerInfo |
createSignerInfo(iaik.x509.X509Certificate signerCertificate)
This method creates a SignerInfo for the given signer certificate.
|
protected void |
getSignatureKey()
This method gets the key stores of all inserted (compatible) smart
cards and simply takes the first key-entry.
|
static void |
main(java.lang.String[] args)
This is the main method that is called by the JVM during startup.
|
getSignatureKey, init, sign, start, verify
getKeyStore, init
public ImplicitRSAPssSignedDataStreamDemo()
initialized
with a module name.public ImplicitRSAPssSignedDataStreamDemo(java.lang.String moduleName, char[] userPin)
moduleName
- the name of the moduleuserPin
- the user-pin (password) for the TokenKeyStore
(may be null
to pop-up a dialog asking for the pin)public static void main(java.lang.String[] args)
args
- These are the command line arguments.protected void getSignatureKey() throws java.security.GeneralSecurityException, java.io.IOException
signerKey_
and signerCertificate_
.getSignatureKey
in class SignedDataStreamDemo
java.security.GeneralSecurityException
- If anything with the provider fails.java.io.IOException
- If loading the key store fails.protected iaik.cms.SignerInfo createSignerInfo(iaik.x509.X509Certificate signerCertificate)
createSignerInfo
in class SignedDataStreamDemo
signerCertificate
- the certificate of the signer