Re: How to create signed crypto message (p7m)

From: Leonid (lkryvelyov_at_gmail.com)
Date: 11/18/05

  • Next message: Jeffrey Tan[MSFT]: "Re: How to grant Access on Files on a share drive?"
    Date: 18 Nov 2005 03:02:02 -0800
    
    

    Hi Rounner,

    rounner@yahoo.com wrote:
    > Leonid,
    >
    > Is your question:
    > How do I use MS API to compose an SMIME message? If so:
    My question is: How do I use MS Win32 CryptoAPI to compose PKCS#7
    message from original data, signed hash of this data and signer's
    certificate with public key (without private key)?

    > Have you read rfc 2633?
    Yes, I read it and 3851, also 2315. But there is nothing about MS Win32
    CryptoAPI in these documents, because they are
    recommendations/standards, not implementation.

    > I dont know what you mean when you say signing is encryption. Do you
    > have a key pair (RSA for SMIME)? Does the receiver have the public key,
    > or are they to receive it as a certificate?
    I meant that signing is encryption of HASH of original data to be
    signed with private key.
    Key pair is inside smart card. Signing (encryption of hash) is
    performed inside smart card, it is never possible to get private key
    from smart card, but it is possible to get certificate with public key
    from smart card.

    > Will the receiver be getting this message as an email (using an smime
    > compatible email client), or are you writing the client as well?
    My task is not sending messages by email. The task is the following:
    documents to be signed are stored in a database or filesystem on a
    server and accessible for read/sign via web application. Users can
    download either original data or signed data in PKCS#7 format. Users
    have to co-sign original data, in this case signatures and certificates
    must be added to PKCS#7 data on a server. I need to develop
    application, which will consist of two parts: client part and server
    part. Client part has to download data from server, show data to user
    and sign it in smart card. After sign, signed hash and certificate with
    public key must be uploaded to server. Server part must receive signed
    hash and certificate and add this new co-signer's information to
    existing PKCS#7 data.
    I know how to extract ANY existing information from PKCS#7 format by
    Win32 CryptoAPI, but I don't know how do I compose PKCS#7 signed data
    by Win32 CryptoAPI without access to private key. I wonder, whether is
    it possible at all with Win32 CryptoAPI? Because all functions require
    access to private key.
    I know that it is possible to use OpenSSL or other open source
    libraries to perform required task, but my question is about Win32
    CryptoAPI.

    > The private and public keys are mathematically linked, you cant just
    > use one and any old number for the other. Note that the signing and
    > encryption key pairs need not be the same.


  • Next message: Jeffrey Tan[MSFT]: "Re: How to grant Access on Files on a share drive?"

    Relevant Pages

    • RE: Problems enabling smart card login on windows 2000
      ... Bad Certificate; ... Troubleshooting Windows 2000 PKI Deployment and Smart Card Logon ... | - Installing a Windows 2000 Server as a Domain Controller ...
      (microsoft.public.win2000.security)
    • Re: AD Authentication using smart card
      ... key to the server and the server authenticates the username, ... So i want to keep the authentication on the c# server. ... Now i want Ad Authentication using smart card. ... Decrypt the certificate present in the smart card. ...
      (microsoft.public.platformsdk.security)
    • Re: CA - Certificate Authority for Authentication?
      ... you can use CA to deploy user certificate in combination with e.g. ... Here are some white papers on how to set up CA server ... Implementing and Administering Certificate Templates in Windows Server 2003 ... You can use Smart Card for remote logons to domain, terminal servers, VPN, ...
      (microsoft.public.windows.server.networking)
    • Re: CA - Certificate Authority for Authentication?
      ... you can use CA to deploy user certificate in combination with e.g. ... Here are some white papers on how to set up CA server ... Implementing and Administering Certificate Templates in Windows Server 2003 ... You can use Smart Card for remote logons to domain, terminal servers, VPN, ...
      (microsoft.public.windows.server.networking)
    • RPC over HTTP, Microsoft solution
      ... Exchange Server 2003 RPC over HTTP Deployment Scenarios ... Place a check in the box next to 'Certificate Services' and click 'Yes' ...
      (microsoft.public.exchange.setup)