org.opensc.pkcs11.spi
Class PKCS11SignatureSpi

java.lang.Object
  extended by java.security.SignatureSpi
      extended by org.opensc.pkcs11.spi.PKCS11SignatureSpi

public class PKCS11SignatureSpi
extends SignatureSpi

The signature service of the OpenSC PKCS#11 provider.

Author:
wglas

Field Summary
 
Fields inherited from class java.security.SignatureSpi
appRandom
 
Constructor Summary
PKCS11SignatureSpi(PKCS11Provider provider, String algorithm)
          Contructs an instance of PKCS11SignatureSpi using the given provider and algorithm.
 
Method Summary
protected  Object engineGetParameter(String key)
           
protected  void engineInitSign(PrivateKey privKey)
           
protected  void engineInitSign(PrivateKey privKey, SecureRandom random)
           
protected  void engineInitVerify(PublicKey pubKey)
           
protected  void engineSetParameter(String key, Object value)
           
protected  byte[] engineSign()
           
protected  void engineUpdate(byte b)
           
protected  void engineUpdate(byte[] data, int off, int len)
           
protected  boolean engineVerify(byte[] signature)
           
 
Methods inherited from class java.security.SignatureSpi
clone, engineGetParameters, engineSetParameter, engineSign, engineUpdate, engineVerify
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PKCS11SignatureSpi

public PKCS11SignatureSpi(PKCS11Provider provider,
                          String algorithm)
Contructs an instance of PKCS11SignatureSpi using the given provider and algorithm. Usually, you will not have to call this contructor, This class is implicitly instantiated using Signature.getInstance().

See Also:
Signature.getInstance(java.lang.String, java.security.Provider)
Method Detail

engineInitVerify

protected void engineInitVerify(PublicKey pubKey)
                         throws InvalidKeyException
Specified by:
engineInitVerify in class SignatureSpi
Throws:
InvalidKeyException

engineInitSign

protected void engineInitSign(PrivateKey privKey,
                              SecureRandom random)
                       throws InvalidKeyException
Overrides:
engineInitSign in class SignatureSpi
Throws:
InvalidKeyException

engineInitSign

protected void engineInitSign(PrivateKey privKey)
                       throws InvalidKeyException
Specified by:
engineInitSign in class SignatureSpi
Throws:
InvalidKeyException

engineUpdate

protected void engineUpdate(byte b)
                     throws SignatureException
Specified by:
engineUpdate in class SignatureSpi
Throws:
SignatureException

engineUpdate

protected void engineUpdate(byte[] data,
                            int off,
                            int len)
                     throws SignatureException
Specified by:
engineUpdate in class SignatureSpi
Throws:
SignatureException

engineSign

protected byte[] engineSign()
                     throws SignatureException
Specified by:
engineSign in class SignatureSpi
Throws:
SignatureException

engineVerify

protected boolean engineVerify(byte[] signature)
                        throws SignatureException
Specified by:
engineVerify in class SignatureSpi
Throws:
SignatureException

engineSetParameter

protected void engineSetParameter(String key,
                                  Object value)
                           throws InvalidParameterException
Specified by:
engineSetParameter in class SignatureSpi
Throws:
InvalidParameterException

engineGetParameter

protected Object engineGetParameter(String key)
                             throws InvalidParameterException
Specified by:
engineGetParameter in class SignatureSpi
Throws:
InvalidParameterException