The Base64 Encoders of Bouncy Castle and Apache return the encoded data (even though they consist only of ASCII characters) as byte arrays (which you know, after all you have used byte[]
as type for these information).
If you want to output the contents in readable form, you should not do XXX.toString()
(because this only result in [B@a470b8,[B@1e4457d,[B@10b4b2f, [B@750159
, i.e. the type identifier [B
and a memory address) but instead new String(XXX)
, e.g. instead of
System.out.println("Signed content: " + bcSignedContent.toString());
use
System.out.println("Signed content: " + new String(bcSignedContent));