You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ranger.apache.org by Walter Bogaardt <wb...@gmail.com> on 2019/04/18 18:33:34 UTC

Re: Ranger KMS Material Length

This is the crux of the problem. The apache commons library implements RFC
2045 . Verses python uses RFC 3548. The same issue with using the Java util
Base64 decode.

So for python or anyone else using insert (other language) note that
different specs on how Ranger encodes and decodes Base64 with mime and no
mime.

For python you will have to pad out the material something similar to this.
material = 'rangermaterialnotpadded'
if len(material) % 4:
# not a multiple of 4, add padding:
  material += '=' * (4 - len(material) % 4)
print(material)
k = base64.urlsafe_b64decode(material)