Here’s a MWE:
using Base64
using libsodium_jll
ssh_private_key = base64encode('A' ^ 3512)
downloaded_key = base64decode('A' ^ 44)
raw_encoded = Vector{UInt8}(undef,
length(ssh_private_key) +
ccall((:crypto_box_sealbytes, libsodium), Cint, ())
)
init_error_code = ccall((:sodium_init, libsodium), Int32, ())
seal_error_code = ccall(
(:crypto_box_seal, libsodium),
Int32,
(Ptr{UInt8}, Cstring, Cint, Ptr{UInt8}),
raw_encoded, private_key, length(private_key), sodium_key
)
base64encode(raw_encoded)
Unfortunately, I think the only way to validate whether the encoding actually worked is to download and checkout OnlinePackage and try to use it on one of your own packages with docs hosted on githubpages.