|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.cryptware.jdigitsign.DigitalSignature
public class DigitalSignature
Main class for qualified digital signature with CAdES and/or PKCS#7 format
Field Summary | |
---|---|
static int |
ASK_FOR_SLOT
|
static long |
ERROR_CANCELLED
|
static long |
ERROR_CERTIFICATE_NOT_FOUND
|
static long |
ERROR_INVALID_CMS
|
static long |
ERROR_INVALID_SLOT_INDEX
|
static long |
ERROR_NO_MATCHING_ATR_FOUND
|
static long |
ERROR_NO_SLOTS_FOUND
|
static long |
ERROR_NO_TOKEN_INSERTED
|
static long |
ERROR_PRIVATE_KEY_NOT_FOUND
|
static long |
ERROR_TSP_EXCEPTION
|
static java.lang.String |
VERSION
The library Version |
Constructor Summary | |
---|---|
DigitalSignature(java.lang.String cryptokiPath)
Initializes a new instance of the DigitalSignature class. |
Method Summary | |
---|---|
void |
closeSession()
Closes the session. |
static java.lang.String |
getMathingCryptokiPath()
Searchs for a matching cryptoki based upon the ATR of the smart card and returns the cryptoki path to be used in DigitalSignature Constructor |
void |
login(java.lang.String pin)
Logins the with specified pin. |
void |
logout()
Logouts this instance. |
void |
openSession(int slotIndex)
Opens the session. |
byte[] |
sign(byte[] data,
CertificateSelector selector)
Signs the specified data and add a time stamp taken from the given TSA Client |
byte[] |
sign(byte[] data,
CertificateSelector selector,
boolean cades)
Signs the specified data and add a time stamp taken from the given TSA Client |
byte[] |
sign(byte[] data,
CertificateSelector selector,
boolean cades,
TSAClient tsaClient)
Signs the specified data and add a time stamp taken from the given TSA Client |
boolean |
verify(byte[] data)
Verifies the specified signature. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ASK_FOR_SLOT
public static final long ERROR_NO_SLOTS_FOUND
public static final long ERROR_INVALID_SLOT_INDEX
public static final long ERROR_NO_TOKEN_INSERTED
public static final long ERROR_CANCELLED
public static final long ERROR_CERTIFICATE_NOT_FOUND
public static final long ERROR_PRIVATE_KEY_NOT_FOUND
public static final long ERROR_INVALID_CMS
public static final long ERROR_TSP_EXCEPTION
public static final long ERROR_NO_MATCHING_ATR_FOUND
public static final java.lang.String VERSION
Constructor Detail |
---|
public DigitalSignature(java.lang.String cryptokiPath) throws java.io.IOException, iaik.pkcs.pkcs11.wrapper.PKCS11Exception
cryptokiPath
- The PKCS11 path.
java.io.IOException
iaik.pkcs.pkcs11.wrapper.PKCS11Exception
Method Detail |
---|
public static java.lang.String getMathingCryptokiPath() throws DigitalSignatureException
DigitalSignatureException
- with error ERROR_NO_MATCHING_ATR_FOUND if no matching ATR is foundpublic void openSession(int slotIndex) throws DigitalSignatureException
slotIndex
- index of the slot to opem
DigitalSignatureException
public void closeSession() throws DigitalSignatureException
DigitalSignatureException
public void login(java.lang.String pin) throws DigitalSignatureException
pin
-
DigitalSignatureException
public void logout() throws DigitalSignatureException
DigitalSignatureException
public byte[] sign(byte[] data, CertificateSelector selector) throws DigitalSignatureException
data
- the dataselector
- the certificate selector
DigitalSignatureException
public byte[] sign(byte[] data, CertificateSelector selector, boolean cades) throws DigitalSignatureException
data
- the dataselector
- the certificate selectorcades
- specifies if CAdES signature is needed
DigitalSignatureException
public byte[] sign(byte[] data, CertificateSelector selector, boolean cades, TSAClient tsaClient) throws DigitalSignatureException, java.io.IOException
data
- the dataselector
- the certificate selectorcades
- specifies if CAdES signature is neededtsaClient
- the TSA client
DigitalSignatureException
TSPException
java.io.IOException
public boolean verify(byte[] data) throws DigitalSignatureException
data
- the data to verify
CMSException
DigitalSignatureException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |