|
IAIK PKCS#11 Wrapper Demo version 1.2.16 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.security.SignatureSpi
java.security.Signature
demo.pkcs.pkcs11.PKCS11SignatureEngine
This is an implementation of a JCA Signature class that uses the PKCS#11 wrapper to create the signature. This implementation hashes outside the token (i.e. in software) and support only signing but not verification.
Field Summary | |
protected MessageDigest |
digestEngine_
The digest engine used to hash the data. |
protected iaik.asn1.structures.AlgorithmID |
hashAlgorithm_
The hash algorithm to use for hashing the data. |
protected Session |
session_
The session that this object uses for signing with the token. |
protected Key |
signatureKey_
The PKCS#11 key that this object uses for signing with the token. |
protected Mechanism |
signatureMechanism_
The mechanism that this object uses for signing with the token. |
Fields inherited from class java.security.Signature |
SIGN, state, UNINITIALIZED, VERIFY |
Fields inherited from class java.security.SignatureSpi |
appRandom |
Constructor Summary | |
PKCS11SignatureEngine(String algorithmName,
Session session,
Mechanism signatureMechanism,
iaik.asn1.structures.AlgorithmID hashAlgorithm)
Creates a new signature engine that uses the given parameters to create the signature on the PKCS#11 token. |
Method Summary | |
protected Object |
engineGetParameter(String name)
SPI: see documentation of java.security.Signature. |
protected void |
engineInitSign(PrivateKey privateKey)
SPI: see documentation of java.security.Signature. |
protected void |
engineInitVerify(PublicKey publicKey)
SPI: see documentation of java.security.Signature. |
protected void |
engineSetParameter(String param,
Object value)
SPI: see documentation of java.security.Signature. |
protected byte[] |
engineSign()
SPI: see documentation of java.security.Signature. |
protected void |
engineUpdate(byte dataByte)
SPI: see documentation of java.security.Signature. |
protected void |
engineUpdate(byte[] data,
int offset,
int length)
SPI: see documentation of java.security.Signature. |
protected boolean |
engineVerify(byte[] signatureValue)
SPI: see documentation of java.security.Signature. |
Methods inherited from class java.security.Signature |
clone, getAlgorithm, getInstance, getInstance, getInstance, getParameter, getParameters, getProvider, initSign, initSign, initVerify, initVerify, setParameter, setParameter, sign, sign, toString, update, update, update, verify, verify |
Methods inherited from class java.security.SignatureSpi |
engineGetParameters, engineInitSign, engineSetParameter, engineSign, engineVerify |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected Session session_
protected Mechanism signatureMechanism_
protected Key signatureKey_
protected iaik.asn1.structures.AlgorithmID hashAlgorithm_
protected MessageDigest digestEngine_
Constructor Detail |
public PKCS11SignatureEngine(String algorithmName, Session session, Mechanism signatureMechanism, iaik.asn1.structures.AlgorithmID hashAlgorithm) throws NoSuchAlgorithmException
algorithmName
- The name of the signature algorithm. This class does
not interpret this name; it uses it as is.session
- The PKCS#11 session to use for signing. It must have the
permissions to sign with the used private key; e.g. it may
require a user session.signatureMechanism
- The PKCS#11 mechanism to use for signing; e.g.
Mechanism.RSA_PKCS.hashAlgorithm
- The hash algorithm to use for hashing the data;
e.g. AlgorithmID.sha1.
NoSuchAlgorithmException
- If the hash algorithm is not available.Method Detail |
protected boolean engineVerify(byte[] signatureValue) throws SignatureException
SignatureException
protected Object engineGetParameter(String name) throws InvalidParameterException
InvalidParameterException
protected void engineSetParameter(String param, Object value) throws InvalidParameterException
InvalidParameterException
protected void engineInitSign(PrivateKey privateKey) throws InvalidKeyException
InvalidKeyException
protected byte[] engineSign() throws SignatureException
SignatureException
protected void engineInitVerify(PublicKey publicKey) throws InvalidKeyException
InvalidKeyException
protected void engineUpdate(byte dataByte) throws SignatureException
SignatureException
protected void engineUpdate(byte[] data, int offset, int length) throws SignatureException
SignatureException
|
IAIK PKCS#11 Wrapper Demo version 1.2.16 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |