I am working with the payment API. I am trying to create the RSA Public Key. I have retrieved the modulus and exponent from the call to /v2/merchant/{mId}/pay/key.

According to the documentation, the modulus and exponent are base10 strings. So I need to convert that to a byte array. I am having trouble figuring out how to do this. Is there a code example anywhere that reflects this?

I tried converting the string to a biginteger and then retrieving bytes, but that does not seem to work. Any ideas on this?