|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
SignatureCardService The SignatureCardService offers methods to generate and verify a signature as well as key import, verification and generation methods. Many smartcard applications will work with existing keys imported during initialization or personalization instead of importing/generating them at runtime. Thus the functionality for
KeyGenerationCardService
,
KeyImportCardService
Method Summary | |
byte[] |
signData(PrivateKeyRef privateKey,
java.lang.String signAlgorithm,
byte[] data)
Generate a digital Signature. |
byte[] |
signData(PrivateKeyRef privateKey,
java.lang.String signAgorithm,
java.lang.String padAlgorithm,
byte[] data)
Generate a digital Signature (overload method that allows to specify the padding algorithm). |
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 interface opencard.opt.service.CardServiceInterface |
getCard,
setCHVDialog |
Methods inherited from interface opencard.opt.security.SecureService |
provideCredentials |
Method Detail |
public byte[] signData(PrivateKeyRef privateKey, java.lang.String signAlgorithm, byte[] data) throws opencard.core.service.CardServiceException, java.security.InvalidKeyException, opencard.core.terminal.CardTerminalException
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
privateKey
- a reference to the private key on card to be used for signingsignAlgorithm
- standard digital signature algorithm namedata
- data to be signedJCAStandardNames
public byte[] signData(PrivateKeyRef privateKey, java.lang.String signAgorithm, java.lang.String padAlgorithm, byte[] data) throws opencard.core.service.CardServiceException, java.security.InvalidKeyException, opencard.core.terminal.CardTerminalException
The standard algorithm name must be specified as defined in the Java Cryptography Architecture API Specification & Reference, for example
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 signedJCAStandardNames
public byte[] signHash(PrivateKeyRef privateKey, java.lang.String signAgorithm, byte[] hash) throws opencard.core.service.CardServiceException, java.security.InvalidKeyException, opencard.core.terminal.CardTerminalException
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
privateKey
- a reference to the private key on card to be used for signingsignAlgorithm
- standard key algorithm namehash
- the hash/digest to be signedJCAStandardNames
public byte[] signHash(PrivateKeyRef privateKey, java.lang.String signAgorithm, java.lang.String padAlgorithm, byte[] hash) throws opencard.core.service.CardServiceException, java.security.InvalidKeyException, opencard.core.terminal.CardTerminalException
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
privateKey
- a reference to the private key on card to be used for signingsignAlgorithm
- standard key algorithm namepadAlgorithm
- padding algorithm name, for example one of
ISO9796,
PKCS#1,
ZEROPADDINGhash
- the hash/digest to be signedJCAStandardNames
public boolean verifySignedData(PublicKeyRef publicKey, java.lang.String signAlgorithm, byte[] data, byte[] signature) throws opencard.core.service.CardServiceException, java.security.InvalidKeyException, opencard.core.terminal.CardTerminalException
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
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 verifiedJCAStandardNames
public boolean verifySignedData(PublicKeyRef publicKey, java.lang.String signAlgorithm, java.lang.String padAlgorithm, byte[] data, byte[] signature) throws opencard.core.service.CardServiceException, java.security.InvalidKeyException, opencard.core.terminal.CardTerminalException
The standard algorithm name must be specified as defined in the Java Cryptography Architecture API Specification & Reference, for example
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 verifiedJCAStandardNames
public boolean verifySignedHash(PublicKeyRef publicKey, java.lang.String signAlgorithm, byte[] hash, byte[] signature) throws opencard.core.service.CardServiceException, java.security.InvalidKeyException, opencard.core.terminal.CardTerminalException
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
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 verifiedJCAStandardNames
public boolean verifySignedHash(PublicKeyRef publicKey, java.lang.String signAlgorithm, java.lang.String padAlgorithm, byte[] hash, byte[] signature) throws opencard.core.service.CardServiceException, java.security.InvalidKeyException, opencard.core.terminal.CardTerminalException
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
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 verifiedJCAStandardNames
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |