From: Markus K. <ma...@pr...> - 2017-04-09 19:54:48
|
On 03/30/2017 02:55 PM, Khadija Ferjani wrote: > Hello all, Hello Khadija, > > I'm using SignServer 3.7.0 to sign documents. > The client can only send the digest of the documents to be signed > (CAdES, XAdES and PAdES signatures) Does it have to be exactly only the digest of the document or could it be the digest of the document and some more information? > I have to generate the cryptographic signature with the client private > key stored in an HSM and the client will then create the final signature > envelope. If the client is constructing the signature format (i.e. CAdES, XAdES and PAdES) it could construct the structure to be signed (i.e. containing the message-digest and all other signed attributes) and send that to the PlainSigner in SignServer. The client could then incorporate the signature bytes into the final document. > > I would like to know if the MRTDSigner allows to perform this operation > (I need to use RSA and ECDSA algorithms) The MRTDSigner was used as an early ePassport signer before the MRTDSODSigner was developed. As far as I understand it is not actually performing a full signature operation but only part of the RSA and the input needs to be padded before. I am not sure if this would work with any real HSM. For sure it would not work as it is now for ECDSA because of the hardcoded RSA algorithm below. > > Note : I found the following lines in the source code (MRTDSigner.java), > > // Using a PKCS#11 HSM plain RSA Cipher does not work, but > we have to use RSA/ECB/PKCS1Padding > // It may be possible to use that, if the data is already > padded correctly when it is sent as input, but only for > // PKCS#1, not PSS. Sun's PKCS#11 provider does not supoprt > PSS (OAEP) padding yet as of 2009-08-14. > // The below (plain RSA) works for soft keystores and > PrimeCardHSM > c = Cipher.getInstance("RSA", > getCryptoToken().getProvider(ICryptoToken.PROVIDERUSAGE_SIGN)); > > Best regards, > > Khadija FERJANI Cheers, Markus PrimeKey Solutions Save time and money with an Enterprise support subscription. Please see www.primekey.se for more information. https://www.primekey.se/technologies/products-overview/ https://www.primekey.se/service-support/support/ |