Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Base64 encoding error #13

Open
stefan-juergens opened this issue Nov 9, 2021 · 1 comment
Open

Base64 encoding error #13

stefan-juergens opened this issue Nov 9, 2021 · 1 comment

Comments

@stefan-juergens
Copy link

Hi.
Your schema validator is just fine, but i get an error while validating base64 encoded data.

Part of the schema is:
...
"signature": {
"type": "string",
"contentEncoding": "base64"
},
...

The JSON data is:
"signature": "cckZGzGyCvsX0RRKqc94VuFlX83/XLoZjvXMT0beE79PwVsBwjwyCYJqPEPZnz0RDvl0nnV3A5+T0GCZcJAsCuZUAWhvDz6ezHkU2eBGcdwRzoL7FdaVcGeVZSJeuzkl"

The exception is:
.../signature with "Content encoding failed on: base64. Reason: Illegal base64 character 2f"]

I have no idea why the JSON data is wrong. In my opinion it is a valid base64 string.

Do you have any idea?

Greetings from germany
Stefan

@stefan-juergens
Copy link
Author

Ah... I looked into your source.
I see you use a Base64.getUrlDecoder - why?
In this case you get the exception.
But using a normal Base64.getDecoder all works
Is there a special reason you use a UrlDecoder?
I thought that all kind of data can be encoded as Base64.

Greetings
Stefan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant