JavacardOS will not accept order any more, please contact our partner Feitian online Store:
https://ftsafe.en.alibaba.com/index.html
https://ftsafe.en.alibaba.com/index.html
Do hash on PC and send digest to my card for signing
Moderator: UNKNwYSHSA
Do hash on PC and send digest to my card for signing
My card supports ALG_ECDSA_SHA. As we all know,for java card, hash calculation is time-consuming,let along data transferring time. Thus I want to do hash on pc and then send digest to my card for signing.
But I don't know how to do this. Any help?
But I don't know how to do this. Any help?
Last edited by Christy16 on Tue Mar 14, 2017 6:11 am, edited 1 time in total.
Re: Do hash on PC and send digest to my card for signing
Try to use cipher instead of hash.
Re: Do hash on PC and send digest to my card for signing
Use signPreComputedHash, which can help you generate the signature of the precomputed hash data. But you java card version should support
since 3.
Detailed info:
since 3.
Detailed info:
signPreComputedHash
public abstract short signPreComputedHash(byte[] hashBuff,
short hashOff,
short hashLength,
byte[] sigBuff,
short sigOffset)
throws CryptoException
Generates the signature of the precomputed hash data.
A call to this method also resets this Signature object to the state it was in when previously initialized via a call to init(). That is, the object is reset and available to sign another precomputed hash.
Note:
This method throws an exception if the underlying signature algorithm does not compute a distinct message digest value prior to applying cryptographic primitives. These algorithms throw exception - DES, triple DES, AES, and KOREAN SEED.
Any data previously accumulated from previous calls to the update method are discarded.
The hash and output buffer data may overlap.
Parameters:
hashBuff - the input buffer of precomputed hash to be signed
hashOffset - the offset into the buffer where the hash begins
hashLength - the byte length of the hash
sigBuff - the output buffer to store signature data
sigOffset - the offset into sigBuff at which to begin signature data
Returns:
number of bytes of signature output in sigBuff
Throws:
CryptoException - with the following reason codes:
CryptoException.UNINITIALIZED_KEY if key not initialized.
CryptoException.INVALID_INIT if this Signature object is not initialized or initialized for signature verify mode.
CryptoException.ILLEGAL_USE if one of the following conditions is met:
if the hashLength value is not equal to the length of the algorithm's message digest length.
if this Signature algorithm includes message recovery functionality.
if the Signature algorithm does not compute a distinct message digest value prior to applying cryptographic primitives
Re: Do hash on PC and send digest to my card for signing
popmun09 wrote:Try to use cipher instead of hash.
Why's that?
Re: Do hash on PC and send digest to my card for signing
Use signPreComputedHash, which can help you generate the signature of the precomputed hash data. elections results But you java card version should support since 3.
Re: Do hash on PC and send digest to my card for signing
Why's that?[/quote]
It is clear why
It is clear why
The crazy bulk could be quite a good help https://diets-usa.com/crazy-bulk-reviews/
Re: Do hash on PC and send digest to my card for signing
good info
The crazy bulk could be quite a good help https://diets-usa.com/crazy-bulk-reviews/
Re: Do hash on PC and send digest to my card for signing
A call to this method also resets this Signature object to the state it was in when previously initialized via a call to init(). That is, the object is reset and available to sign another precomputed hash.
-
- Posts: 1
- Joined: Thu Jul 19, 2018 3:51 am
- Points :12
- Contact:
Re: Do hash on PC and send digest to my card for signing
Why's that?popmun09 wrote:Try to use cipher https://www.arydigital.tv/videos/catego ... hand-rakh/ instead of hash.
Who is online
Users browsing this forum: No registered users and 20 guests