Hi Falk!
I responded on Mastodon already but maybe it got lost somewhere. Can you check if this helps you to set the byte array:
https://stackoverflow.com/questions/10672092/read-parse-binary-files-with-powershell
Regards,
Stefan
my answers here from mastodon via auto translate :
"@royalapps@dotnet.socialthat's unfortunately not what I'm looking for. I have my problem here: https://docs.royalapps.com/r2023/scripting/objects/organization/royalcredential.html:
"PrivateKeyContent
Type: byte[], Default Value: new byte[] { }
Assign a key file to the credential by embedding the key file's content."
I can't do anything with that part of the documentation, unfortunately. How do I get a format like that - it's surely been tested?"
"It works via PrivateKeyPath with a path to exactly the key files that I want to use via PrivateKeyContent.
I can leave it like that, but if you can tell me how to do it via content, I would prefer that :)"
so. no. the link provided did not have a solution for.
i would appreciate if you could provide me with an example
"now i need a PowerShell code example on how to use the content of one of
the cert files (that i am using successully via PrivateKeyPath)."
that way i could figure out the rest. i would also provide the soultion (my code) here :)
Sure, here's a simple example:
I hope this helps.
Regards,
Stefan
Perfect, works great! Thanks!
You're welcome! Glad I could help!
Falk Heiland
i have keys working via PrivateKeyPath and am now trying to implement keyfiles as content.
https://docs.royalapps.com/r2023/scripting/objects/organization/royalcredential.html#privatekeypath
> PrivateKeyContent
>
> Type: byte[], Default Value: new byte[] { }
> Assign a key file to the credential by embedding the key file's content.
now i need a PowerShell code example on how to use the content of one of the cert files (that i am using successully via PrivateKeyPath).