X.509 certificates and RSA encryption

From: Mikael Engdahl ([myfirstname)
Date: 01/23/04


Date: Fri, 23 Jan 2004 11:51:24 +0100

Q1:

I have a certificate file (.cer) that I'm able to load into a
X509Certificate object using the X509Certificate.CreateFromCertFile method.

Now I want to use the public key from the certificate to do some RSA
encrypting. I can get the key from the certificate as a byte array by using
the GetPublicKey method, but I can't find any way of supplying the key to
the RSACryptoServiceProvider object. How do I do this?

Q2:

The same as above, but another certificate (mine), and this time I want to
use the private key (for signing). But I can't even find I way of getting
the private key out of the cert (there is no GetPrivateKey method).

Is the private key even in the certificate?

Mikael Engdahl



Relevant Pages

  • Re: How to exchange certificate ?
    ... certificate store (I own ONLY a public key). ... >contained in a certificate store AND having an associated private key. ... you can test any cert for an associated private key using: ...
    (microsoft.public.platformsdk.security)
  • Re: Client Certificates
    ... |> I am generating client certificates using win2k3 Certificate Services. ... | generate the request creates a public-private key pair on the fly. ... | Anything encrypted with the private key in the pair can only be ... | decrypted by the public key in the pair, ...
    (microsoft.public.windows.server.security)
  • Re: SSL Certificate - Self-Generated vs 3rd Party ?
    ... you mention a public key. ... The term "certificate" is used to mean many things by many people. ... You use your private key to sign the certificate, ... SSL does _not_ start off with a shared secret. ...
    (comp.security.misc)
  • Re: Need some information about certificates
    ... receiver uses your public key to verify the signature but for encryption you ... use an entities public key to encrypt the data and then the recipient uses ... their private key to decrypt the data. ... certificate installed on the server running my application. ...
    (microsoft.public.windows.server.security)
  • RE: SIMple SSL question ??
    ... I believe your book is instructing you to keep the private key secure. ... you use the certificate request wizard in IIS to install the cert after it's ... the certificate that's just been installed. ... If an attacker retrievs the SSL certificate, ...
    (microsoft.public.dotnet.security)