[Mono-dev] X509Certificate problem

Sebastien Pouliot sebastien.pouliot at gmail.com
Mon Jun 2 08:25:37 EDT 2008


Hey,

This should be working(*) and we have unit tests for them. Please fill a
bug report and attach your PEM certificate to it.

Sebastien

(*) the only known issue is that the current ASN.1 decoder does not
support elements with indefinite length - but this is not common for
certificates.

On Fri, 2008-05-30 at 11:50 +0200, paszczi wrote:
> 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?
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list



More information about the Mono-devel-list mailing list