Howard Hoffman
Howard Hoffman

Reputation: 917

x509 Certs in .NET - Difference between PrivateKey XML-values and Cert RawData

I'm considering a Symmetric Encryption scheme that uses an encryption key that itself derives from an X509 certificate. I realize this is not Asymmetric, and perhaps odd, but its an experiment.

My goal is to access the private key, or some portion, from the x509 Certificate as input to a "key" derivation function.

Dumb question: What property on the x509Certificate2 is the private key? The PrivateKey is itself just the alrogithm. The algorithm's ToXmlString enumerates several values (Modulus, Exponent, P, Q, DP, DQ, InverseQ, D) that I suspect are vendor specific. Also the x509Certificate2.RawData is available.

When talking about the Encrypt-with-public-key / decrypt-with-private-key Asymmetric algorithm...which of the above properties, if any, is that private-key?

Thanks in advance,

Howard Hoffman

Upvotes: 1

Views: 511

Answers (1)

Henri
Henri

Reputation: 5113

According to the documentation here: http://msdn.microsoft.com/en-us/library/system.security.cryptography.x509certificates.x509certificate2.privatekey.aspx the PrivateKey property is a link to the private key and not the algorithm.

See also the example on the provided link to see how to print the private key.

Upvotes: 1

Related Questions