IOException: -----END PRIVATE KEY not found

#3 · closed · 3 comments

View on GitHub ↗

dylanpiera

Hey, I'm having some troubles getting the API running, when I simply try to initialize the API and try to get all TLD's I get this error, stating no private key could be found: I added the key as a VS Secret, and when that didn't work out I tried directly inserting it hard-coded in my MVC controller, didn't do the job either.. Code: `DomainService = new DomainService(username, ClientMode.ReadWrite, key);` Followed by: `DomainService.GetAllTldInfos()` Error: ``` IOException: -----END PRIVATE KEY not found Org.BouncyCastle.Utilities.IO.Pem.PemReader.LoadObject(string type) Org.BouncyCastle.Utilities.IO.Pem.PemReader.ReadPemObject() Org.BouncyCastle.OpenSsl.PemReader.ReadObject() TransIp.Api.EncryptionHelper.Encrypt(byte[] digest, string key) TransIp.Api.EncryptionHelper.Sign(string privateKey, object[] args) TransIp.Api.ClientBase<TClientType, TChannelType>.SetSignatureCookies(string method, object[] args) TransIp.Api.DomainService.GetAllTldInfos() ``` Is this package not compatible with Dotnet Core 3.1 / C#8? Or am I doing something wrong 😅 Hope you can help me out! :)

Comments

WouterJanson

Hi @dylanpiera Thanks for reporting your issue. I’ll try to see if I can reproduce your issue, I’ll probably get back to you by Wednesday. It should work on Core 3.1 in combination with C# 8.

dylanpiera

@WouterJanson Thanks for the quick response, I already found my issue, I was accidentally truncating my private key!

WouterJanson

I'm glad you've found your issue and were able to continue. If you have other question don't hesitate to open another issue.