|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectopencard.core.service.CardService
de.cardcontact.opencard.service.signature.ISSSSignatureService
public class ISSSSignatureService
Constructor Summary | |
---|---|
ISSSSignatureService()
Instantiate ISSSSignatureService Initialization is done in #ISSSSignatureService.initialize |
Method Summary | |
---|---|
protected void |
cardHash(CardChannel channel,
byte[] data)
Performed chained hash in card The data is split into chunks of 64 bytes. |
protected void |
cardSelectAlgorithm(CardChannel channel,
java.lang.String signAlgorithm)
|
protected void |
cardSelectKey(CardChannel channel,
PrivateKeyRef privateKey)
|
protected byte[] |
cardSign(CardChannel channel,
byte[] hash)
Sign data either provided or already hashed in the card |
protected byte[] |
cardSignDummy(CardChannel channel,
byte[] hash)
Sign data either provided or already hashed in the card (Dummy) |
protected void |
initialize(CardServiceScheduler scheduler,
SmartCard smartcard,
boolean blocking)
Check that the IsoCardState object exists in the card channel Overwrites #opencard.core.service.CardService#initialize |
void |
provideCredentials(SecurityDomain domain,
CredentialBag creds)
Provides credentials to a card service. |
byte[] |
signData(PrivateKeyRef privateKey,
java.lang.String signAlgorithm,
byte[] data)
Implement signData |
byte[] |
signData(PrivateKeyRef privateKey,
java.lang.String signAlgorithm,
java.lang.String padAlgorithm,
byte[] data)
Implement signData |
byte[] |
signHash(PrivateKeyRef privateKey,
java.lang.String signAgorithm,
byte[] hash)
Generate a digital Signature on the provided hash. |
byte[] |
signHash(PrivateKeyRef privateKey,
java.lang.String signAgorithm,
java.lang.String padAlgorithm,
byte[] hash)
Generate a digital Signature on the provided hash (Overloaded method that allows to specify the padding algorithm). |
boolean |
verifySignedData(PublicKeyRef publicKey,
java.lang.String signAlgorithm,
byte[] data,
byte[] signature)
Verify a digital Signature including hashing. |
boolean |
verifySignedData(PublicKeyRef publicKey,
java.lang.String signAlgorithm,
java.lang.String padAlgorithm,
byte[] data,
byte[] signature)
Verify a digital Signature including hashing (overload method that allows to specify the padding algorithm to be used). |
boolean |
verifySignedHash(PublicKeyRef publicKey,
java.lang.String signAlgorithm,
byte[] hash,
byte[] signature)
Verify a digital Signature. |
boolean |
verifySignedHash(PublicKeyRef publicKey,
java.lang.String signAlgorithm,
java.lang.String padAlgorithm,
byte[] hash,
byte[] signature)
Verify a digital Signature (overloaded method that allows to specify the padding algorithm to be used). |
Methods inherited from class opencard.core.service.CardService |
---|
allocateCardChannel, getCard, getCardChannel, getCHVDialog, releaseCardChannel, setCardChannel, setCHVDialog |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface opencard.opt.service.CardServiceInterface |
---|
getCard, setCHVDialog |
Constructor Detail |
---|
public ISSSSignatureService()
Method Detail |
---|
protected void initialize(CardServiceScheduler scheduler, SmartCard smartcard, boolean blocking) throws CardServiceException
initialize
in class CardService
scheduler
- where this service is going to allocate channelssmartcard
- which smartcard has to be supported by this serviceblocking
- whether channel allocation is going to be blocking
CardServiceException
- if the service could not be initialized. The object created via the
default constructor may not be used if this happens.CardServiceFactory
public byte[] signData(PrivateKeyRef privateKey, java.lang.String signAlgorithm, byte[] data) throws CardServiceException, java.security.InvalidKeyException, CardTerminalException
signData
in interface SignatureCardService
privateKey
- a reference to the private key on card to be used for signingsignAlgorithm
- standard digital signature algorithm namedata
- data to be signed
CardServiceException
- any subclass of CardServiceException
java.security.InvalidKeyException
- Thrown when the key is not valid or does not match the requested algorithm.
CardTerminalException
- any subclass of CardTerminalExceptionSignatureCardService.signData(opencard.opt.security.PrivateKeyRef, java.lang.String, byte[])
public byte[] signData(PrivateKeyRef privateKey, java.lang.String signAlgorithm, java.lang.String padAlgorithm, byte[] data) throws CardServiceException, java.security.InvalidKeyException, CardTerminalException
signData
in interface SignatureCardService
privateKey
- a reference to the private key on card to be used for signingsignAlgorithm
- standard digital signature algorithm namepadAlgorithm
- padding algorithm name, for example one of
ISO9796,
PKCS#1,
ZEROPADDINGdata
- data to be signed
CardServiceException
- any subclass of CardServiceException
java.security.InvalidKeyException
- Thrown when the key is not valid or does not match the requested algorithm.
CardTerminalException
- any subclass of CardTerminalExceptionSignatureCardService.signData(opencard.opt.security.PrivateKeyRef, java.lang.String, java.lang.String, byte[])
public byte[] signHash(PrivateKeyRef privateKey, java.lang.String signAgorithm, byte[] hash) throws CardServiceException, java.security.InvalidKeyException, CardTerminalException
SignatureCardService
The padding algorithm is chosen as defined in the Java Cryptography Architecture Specification.
Use a key algorithm name (not a digital signature algorithm name, because digital signature algorithms include hashing) a defined in the Java Cryptography Architecture API Specification & Reference, for example
signHash
in interface SignatureCardService
privateKey
- a reference to the private key on card to be used for signingsignAgorithm
- standard key algorithm namehash
- the hash/digest to be signed
CardServiceException
- any subclass of CardServiceException
java.security.InvalidKeyException
- Thrown when the key is not valid or does not match the requested algorithm.
CardTerminalException
- any subclass of CardTerminalExceptionJCAStandardNames
public byte[] signHash(PrivateKeyRef privateKey, java.lang.String signAgorithm, java.lang.String padAlgorithm, byte[] hash) throws CardServiceException, java.security.InvalidKeyException, CardTerminalException
SignatureCardService
Use a key algorithm name (not a digital signature algorithm name, because digital signature algorithms include hashing) a defined in the Java Cryptography Architecture API Specification & Reference, for example
signHash
in interface SignatureCardService
privateKey
- a reference to the private key on card to be used for signingsignAgorithm
- standard key algorithm namepadAlgorithm
- padding algorithm name, for example one of
ISO9796,
PKCS#1,
ZEROPADDINGhash
- the hash/digest to be signed
CardServiceException
- any subclass of CardServiceException
java.security.InvalidKeyException
- Thrown when the key is not valid or does not match the requested algorithm.
CardTerminalException
- any subclass of CardTerminalExceptionJCAStandardNames
public boolean verifySignedData(PublicKeyRef publicKey, java.lang.String signAlgorithm, byte[] data, byte[] signature) throws CardServiceException, java.security.InvalidKeyException, CardTerminalException
SignatureCardService
The padding algorithm is chosen as defined in the Java Cryptography Architecture Specification.
The standard algorithm name must be specified as defined in the Java Cryptography Architecture API Specification & Reference, for example
verifySignedData
in interface SignatureCardService
publicKey
- a reference to the public key on card to be used for signature validationsignAlgorithm
- standard digital signature algorithm namedata
- the data for which the signature should be verifiedsignature
- signature to be verified
CardServiceException
- any subclass of CardServiceException
java.security.InvalidKeyException
- Thrown when the key is not valid or does not match the requested algorithm.
CardTerminalException
- any subclass of CardTerminalExceptionJCAStandardNames
public boolean verifySignedData(PublicKeyRef publicKey, java.lang.String signAlgorithm, java.lang.String padAlgorithm, byte[] data, byte[] signature) throws CardServiceException, java.security.InvalidKeyException, CardTerminalException
SignatureCardService
The standard algorithm name must be specified as defined in the Java Cryptography Architecture API Specification & Reference, for example
verifySignedData
in interface SignatureCardService
publicKey
- a reference to the public key on card to be used for signature validationsignAlgorithm
- standard digital signature algorithm namepadAlgorithm
- padding algorithm name, for example one of
ISO9796,
PKCS#1,
ZEROPADDINGdata
- the data for which the signature should be verifiedsignature
- signature to be verified
CardServiceException
- any subclass of CardServiceException
java.security.InvalidKeyException
- Thrown when the key is not valid or does not match the requested algorithm.
CardTerminalException
- any subclass of CardTerminalExceptionJCAStandardNames
public boolean verifySignedHash(PublicKeyRef publicKey, java.lang.String signAlgorithm, byte[] hash, byte[] signature) throws CardServiceException, java.security.InvalidKeyException, CardTerminalException
SignatureCardService
The padding algorithm is chosen as defined in the Java Cryptography Architecture Specification.
Use a key algorithm name (not a digital signature algorithm name, because digital signature algorithms include hashing) a defined in the Java Cryptography Architecture API Specification & Reference, for example
verifySignedHash
in interface SignatureCardService
publicKey
- a reference to the public key on card to be used for signature validationsignAlgorithm
- standard key algorithm namehash
- The hash for which the signature should be verified.signature
- signature to be verified
CardServiceException
- any subclass of CardServiceException
java.security.InvalidKeyException
- Thrown when the key is not valid or does not match the requested algorithm.
CardTerminalException
- any subclass of CardTerminalExceptionJCAStandardNames
public boolean verifySignedHash(PublicKeyRef publicKey, java.lang.String signAlgorithm, java.lang.String padAlgorithm, byte[] hash, byte[] signature) throws CardServiceException, java.security.InvalidKeyException, CardTerminalException
SignatureCardService
Use a key algorithm name (not a digital signature algorithm name, because digital signature algorithms include hashing) a defined in the Java Cryptography Architecture API Specification & Reference, for example
verifySignedHash
in interface SignatureCardService
publicKey
- a reference to the public key on card to be used for signature validationsignAlgorithm
- standard key algorithm namepadAlgorithm
- padding algorithm name, for example one of
ISO9796,
PKCS#1,
ZEROPADDINGhash
- The hash for which the signature should be verified.signature
- signature to be verified
CardServiceException
- any subclass of CardServiceException
java.security.InvalidKeyException
- Thrown when the key is not valid or does not match the requested algorithm.
CardTerminalException
- any subclass of CardTerminalExceptionJCAStandardNames
public void provideCredentials(SecurityDomain domain, CredentialBag creds) throws CardServiceException
SecureService
provideCredentials
in interface SecureService
domain
- the security domain for which to provide credentialscreds
- the credentials for that domain
CardServiceException
- If the card service could not process the credentials,
if the SecurityDomain is invalid.CardService
protected void cardSelectKey(CardChannel channel, PrivateKeyRef privateKey) throws CardTerminalException, CardServiceOperationFailedException
CardTerminalException
CardServiceOperationFailedException
protected void cardSelectAlgorithm(CardChannel channel, java.lang.String signAlgorithm) throws CardTerminalException, CardServiceOperationFailedException, java.security.InvalidKeyException
CardTerminalException
CardServiceOperationFailedException
java.security.InvalidKeyException
protected void cardHash(CardChannel channel, byte[] data) throws CardTerminalException, CardServiceOperationFailedException
channel
- Open channel for card communicationdata
- Data to be hashed
CardTerminalException
CardServiceOperationFailedException
protected byte[] cardSign(CardChannel channel, byte[] hash) throws CardTerminalException, CardServiceOperationFailedException
channel
- Open card channelhash
- Hash value or null if hashed in the card
CardTerminalException
CardServiceOperationFailedException
protected byte[] cardSignDummy(CardChannel channel, byte[] hash) throws CardTerminalException, CardServiceOperationFailedException
channel
- Open card channelhash
- Hash value or null if hashed in the card
CardTerminalException
CardServiceOperationFailedException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |