[PATCH] 104 Make the return type of the secrets returned by the KeyClient consistent on both Java and Python sides
Currently, the secrets retrieved using the retrieveKey method of the KeyClient are of the type byte[]. (Attribute of the Key object). But the public key, which is returned in a KeyInfo object, is being accessible as a string (base64 encoded binary data). This patch changes getter/setter of the publicKey attribute of the KeyInfo object to do the conversion from base64 encoded string to byte[] and vice versa. With this patch all the keys retrieved are of the type byte[]. Please review the attached patch. -- Abhishek
ACK On Thu, 2014-08-28 at 19:24 -0400, Abhishek Koneru wrote:
Currently, the secrets retrieved using the retrieveKey method of the KeyClient are of the type byte[]. (Attribute of the Key object). But the public key, which is returned in a KeyInfo object, is being accessible as a string (base64 encoded binary data).
This patch changes getter/setter of the publicKey attribute of the KeyInfo object to do the conversion from base64 encoded string to byte[] and vice versa. With this patch all the keys retrieved are of the type byte[]. Please review the attached patch.
-- Abhishek
_______________________________________________ Pki-devel mailing list Pki-devel@redhat.com https://www.redhat.com/mailman/listinfo/pki-devel
On 8/28/2014 6:24 PM, Abhishek Koneru wrote:
Currently, the secrets retrieved using the retrieveKey method of the KeyClient are of the type byte[]. (Attribute of the Key object). But the public key, which is returned in a KeyInfo object, is being accessible as a string (base64 encoded binary data).
This patch changes getter/setter of the publicKey attribute of the KeyInfo object to do the conversion from base64 encoded string to byte[] and vice versa. With this patch all the keys retrieved are of the type byte[]. Please review the attached patch.
-- Abhishek
Just one thing, in KeyInfo.java the publicKey should be stored internally as byte array because that's the most efficient way to store and use binary data. Base-64 encoding should only be used for input/ouput that cannot handle binary data well (e.g. text file, CLI output, logging, JSON/XML). Once this is fixed, it's ACKed. -- Endi S. Dewata
participants (3)
-
Abhishek Koneru -
Ade Lee -
Endi Sukma Dewata