BrunORC
BrunORC
CC#
Created by BrunORC on 10/27/2022 in #help
❔ X509 Certificate from base64 string
I will open this project up euther later today or tomorrow and sse if I’ve got something to help you with. I can’t for nothing remeber it properly but I’m sure it is there
71 replies
CC#
Created by BrunORC on 10/27/2022 in #help
❔ X509 Certificate from base64 string
What is it that you need some help with?
71 replies
CC#
Created by BrunORC on 10/27/2022 in #help
❔ X509 Certificate from base64 string
Hey man, I am here but probably won’t remember much about what I ended up doing with this certificate thing. I believe I switched the lib I was using to decode it
71 replies
CC#
Created by BrunORC on 10/27/2022 in #help
❔ X509 Certificate from base64 string
now how do I close this post?
71 replies
CC#
Created by BrunORC on 10/27/2022 in #help
❔ X509 Certificate from base64 string
still can't wrap my head around why microsoft's encryption would not work
71 replies
CC#
Created by BrunORC on 10/27/2022 in #help
❔ X509 Certificate from base64 string
thanks Cisien
71 replies
CC#
Created by BrunORC on 10/27/2022 in #help
❔ X509 Certificate from base64 string
using bouncy castle did the trick
71 replies
CC#
Created by BrunORC on 10/27/2022 in #help
❔ X509 Certificate from base64 string
binary data shows that the c# one has more than 64 bytes of data while java ones always have exactly 64 bytes and 90 chars
71 replies
CC#
Created by BrunORC on 10/27/2022 in #help
❔ X509 Certificate from base64 string
will do it then. Thanks again
71 replies
CC#
Created by BrunORC on 10/27/2022 in #help
❔ X509 Certificate from base64 string
I'm using it already somewhere else in this project, you're telling me to use it for encryption using the public key?
71 replies
CC#
Created by BrunORC on 10/27/2022 in #help
❔ X509 Certificate from base64 string
thanks mate
71 replies
CC#
Created by BrunORC on 10/27/2022 in #help
❔ X509 Certificate from base64 string
yeah, will request the Java dude to hand me the input public key + user info and output of the java one for me to try and replicate in c# and compare byte data then..
71 replies
CC#
Created by BrunORC on 10/27/2022 in #help
❔ X509 Certificate from base64 string
will try finding if there are different encoding options in the Convert.ToBase64String method
71 replies
CC#
Created by BrunORC on 10/27/2022 in #help
❔ X509 Certificate from base64 string
yeah, the userBytes is later encoded using Base64 in Java it woudl go like this:
Base64.getEncoder().encodeToString(userBytes)
Base64.getEncoder().encodeToString(userBytes)
which probably uses the default encoding of the platform in C# it probably also uses a default encoder but they may differ
string identifier = Convert.ToBase64String(userBytes)
string identifier = Convert.ToBase64String(userBytes)
71 replies
CC#
Created by BrunORC on 10/27/2022 in #help
❔ X509 Certificate from base64 string
but your guess sounds about right as it was double the size
71 replies
CC#
Created by BrunORC on 10/27/2022 in #help
❔ X509 Certificate from base64 string
because they are both set to UTF 8 befure encrypting
71 replies
CC#
Created by BrunORC on 10/27/2022 in #help
❔ X509 Certificate from base64 string
c#
using (RSACryptoServiceProvider RSA = ImportPublicKey(authResponse.PublicKey))
{
byte[] userBytes = RSA.Encrypt(Encoding.UTF8.GetBytes(user), false);
using (RSACryptoServiceProvider RSA = ImportPublicKey(authResponse.PublicKey))
{
byte[] userBytes = RSA.Encrypt(Encoding.UTF8.GetBytes(user), false);
byte[] userBytes = encryptCipher.doFinal(user.getBytes(StandardCharsets.UTF_8));
byte[] userBytes = encryptCipher.doFinal(user.getBytes(StandardCharsets.UTF_8));
you mean before encrypting or after?
71 replies
CC#
Created by BrunORC on 10/27/2022 in #help
❔ X509 Certificate from base64 string
so the server refuses it saying it is to big
71 replies
CC#
Created by BrunORC on 10/27/2022 in #help
❔ X509 Certificate from base64 string
with double the expected size
71 replies
CC#
Created by BrunORC on 10/27/2022 in #help
❔ X509 Certificate from base64 string
I tried using it directly but it ends up creating a different sized RSA encrypted string
71 replies