Test with openssl
Use openssl and you should see good output:
user@server$ openssl x509 -text -noout -in cert.public
Certificate:
Data:
Version: 1 (0x0)
Serial Number:
00:00:00:00:00:00:00:00
Signature Algorithm: sha1WithRSAEncryption
Issuer: C=US, ST=CA, L=SFO, O=Riverbed, OU=Corporate, CN=www.test.com
Validity
Not Before: Sep 19 21:23:47 2013 GMT
Not After : Sep 19 21:23:47 2014 GMT
Subject: C=US, ST=CA, L=SFO, O=Riverbed, OU=Corporate, CN=www.test.com
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
RSA Public Key: (2048 bit)
Modulus (2048 bit):
If the certificate is corrupt, openssl will show an error similar to the following:
user@server$ openssl x509 -text -noout -in signed.cer
unable to load certificate
18011:error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag:tasn_dec.c:959:
18011:error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error:tasn_dec.c:304:Type=X509_CINF
18011:error:0D08303A:asn1 encoding routines:ASN1_TEMPLATE_D2I:nested asn1 error:tasn_dec.c:566:Field=cert_info, Type=X509
18011:error:0906700D:PEM routines:PEM_ASN1_read_bio:ASN1 lib:pem_oth.c:82