[Mono-dev] X509Certificate problem

paszczi paszczi at o2.pl
Fri May 30 05:50:43 EDT 2008


Hi guys!

I have problems with reading certificate from PEM file. The following code works on .NET (System.Security):

X509Certificate crt = new X509Certificate (certPath);

but doesn't work in Mono 1.9.1 (I've tried to use both System.Security and Mono.Security + FileStream to read bytes from file).
The message I get is:

Unhandled Exception: System.Security.Cryptography.CryptographicException: Unable to decode certificate. ---> System.Security.Cryptography.Cryptographi
cException: Input data cannot be coded as a valid certificate. ---> System.Security.Cryptography.CryptographicException: Input data cannot be coded as
 a valid certificate.
  at Mono.Security.X509.X509Certificate.Parse (System.Byte[] data) [0x00000] --- End of inner exception stack trace ---

  at Mono.Security.X509.X509Certificate.Parse (System.Byte[] data) [0x00000]
  at Mono.Security.X509.X509Certificate..ctor (System.Byte[] data) [0x00000]
  at System.Security.Cryptography.X509Certificates.X509Certificate.Import (System.Byte[] rawData, System.String password, X509KeyStorageFlags keyStora
geFlags) [0x00000] --- End of inner exception stack trace ---

  at System.Security.Cryptography.X509Certificates.X509Certificate.Import (System.Byte[] rawData, System.String password, X509KeyStorageFlags keyStora
geFlags) [0x00000]
  at System.Security.Cryptography.X509Certificates.X509Certificate.Import (System.String fileName, System.String password, X509KeyStorageFlags keyStor
ageFlags) [0x00000]
  at System.Security.Cryptography.X509Certificates.X509Certificate..ctor (System.String fileName) [0x00000]
  at SecPL.Return.Tools.SignManifest.ManifestSigner..ctor (System.String manifestPath, System.String certPath, System.String privateKeyPath) [0x00000]

  at SecPL.Return.Tools.SignManifest.ManifestSigner.Main (System.String[] args) [0x00000]

Any hint?


More information about the Mono-devel-list mailing list