Using private keys to sign hash

From: Erick Daniel Tinajero (etinajero_at_quimera.org)
Date: 11/23/04


Date: Mon, 22 Nov 2004 19:23:37 -0600


Hi there:

I am trying to export (use) a private key from the certificate store to sign
a
hash. But I am getting the error:
Export of private parameters is not supported

I have this:

    Dim store =
Microsoft.Web.Services2.Security.X509.X509CertificateStore.LocalMachineStore(Microsoft.Web.Services2.Security.X509.X509CertificateStore.MyStore)
    store.OpenRead
    Dim cert as Microsoft.Web.Services2.Security.X509.X509Certificate =
store.Certificates(0)
    Dim RSA as RSA = Cert.Key
    Dim RSAParams as RSAParameters = Cert.Key.ExportParameters(True)

The exception happens when the last line executes. I guess its a permission
problem, but I can't figure it out the solution. Can anyone help me? Thanks.



Relevant Pages

  • ECDsaCng elliptic curve class exception on import of private key
    ... I was playing around with the new ECDsaCng elliptic curve class of the ... importing a previously exported private key. ... Dim bSignature() As Byte ...
    (microsoft.public.dotnet.security)
  • Re: Sign hash with public key
    ... You can encrypt with public key and decrypt with private. ... You can sign with private key and verify with public. ... Dim AlgHash As HashAlgorithm = HashAlgorithm.Create ...
    (microsoft.public.dotnet.security)
  • Re: Using private keys to sign hash
    ... Dim store As Microsoft.Web.Services2.Security.X509.X509CertificateStore = ... I have a certificate and private key generated by a tool that I didn't ... I was told that a private key without ...
    (microsoft.public.dotnet.security)
  • Re: 512 bit encryption with RSACryptoServiceProvider results in "Bad Key"
    ... Both these tests will get a Machine Certificate and then Encrypt and Decrypt ... "Private Key" to encrypt and "Public Key" to decrypt, ... Dim CAPI_Store As New CAPICOM.Store ...
    (microsoft.public.dotnet.security)
  • private key crypto on form post data
    ... I need to find a way to encode a form post element with a private key, ... then can be decoded using that same private key using ASP. ... get back the encoded data as well as being able to pass in the encoded data ... DIM myData, X ...
    (microsoft.public.inetserver.asp.general)