• Post Reply Bookmark Topic Watch Topic
  • New Topic

extra data given to DerValue constructor (java.security.cert.CertificateException)  RSS feed

 
Alexey Sedoykin
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Dear Team!

i have String () when have certificate which i get from database:


-----BEGIN CERTIFICATE----- MIII1QYJKoZIhvcNAQcCoIIIxjCCCMICAQExDzANBglghkgBZQMEAgEFADALBgkqhkiG9w0BBwGgggZhMIIGXTCCBUWgAwIBAgIEH+9ohTANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UEBhMCREUxEDAOBgNVBAoMB1NpZW1lbnMxETAPBgNVBAUTCFpaWlpaWlkyMTowOAYDVQQLDDFDb3B5cmlnaHQgKEMpIFNpZW1lbnMgQUcgMjAxMyBBbGwgUmlnaHRzIFJlc2VydmVkMSgwJgYDVQQDDB9TaWVtZW5zIElzc3VpbmcgQ0EgRUUgQXV0aCAyMDEzMB4XDTE2MDcxOTE1MzYzOVoXDTE5MDcxOTE1MzYzOVowZTERMA8GA1UEBRMIWjAwM0EyQVkxDzANBgNVBCoMBkFuZHJleTESMBAGA1UEBAwJU2x5dW55YWV2MRAwDgYDVQQKDAdTaWVtZW5zM,RkwFwYDVQQDDBBTbHl1bnlhZXYgQW5kcmV5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAgwnt5QkByovf5lTFzivNp2rB2jVY+IP4Zz0rjswEwLI7ihFXiakiFXwCprCdPHpdTCBYuGAluBfp+dij+KLwytpPDncDLPYAERsJuircXPt453PS4LDNwGs1oxpkzmzSMIl9ZkSsS9MugWGQDCCaK0mKpLn5NT2xEFrOHyneYLHIV+pX5WOTrCNo3lDSUh6NZZLOhqkX5WK3omBNv8eLpv5G/v8yXxAuTTEkzlPgsVWwSJznVIYb1FrV2dm9BXEYBSguWOxdDKsPrX32bgTcESVCW1aHDSbZr43OKdOV7xgzVTp+XFBvBVRVB+BkzkE2wFGxwSgzs/WWynokqM7dqQIDAQABo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certifacte can be decrypt on on-line services, for example https://certlogik.com/decoder/

And i have next code which doesn't work:





But i get error:

java.security.cert.CertificateException java.security.cert.CertificateException: Unable to initialize, java.io.IOException: extra data given to DerValue constructor at sun.security.x509.X509CertImpl.(X509CertImpl.java:199) at sun.security.provider.X509Factory.engineGenerateCertificate(X509Factory.java:98)


Dear Team please any idea, I`m not a professional programmer

Thank you!
 
Knute Snortum
Sheriff
Posts: 4276
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post a short, complete, compilable example, something we can cut and paste into a IDE.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!