Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Encode to base64 keystore file

I would like encode my .keystore file for use in Gitlab-ci. So, for encode sur base64, i run this command :

openssl base64 -A -in myFile.keystore

And for decode :

openssl base64 -d <<< $KEY > myFile.keystore

But if i use my file, i've this error : Invalid keystore format

I've compare my initial file with new decode file by running md5sum oldFile.keystore myFile.keystore, but files is same :/

Anyone have an idea ?

Thank you community !

like image 407
s-leg3ndz Avatar asked Feb 26 '19 09:02

s-leg3ndz


People also ask

How do I decode a Base64 file in Linux?

To decode a file with contents that are base64 encoded, you simply provide the path of the file with the --decode flag. base64 --decode /path/to/file. As with encoding files, the output will be a very long string of the original file. You may want to output stdout directly to a file. base64 --decode /path/to/file > output.txt.

Are Base64 encoded files secure?

Base64 is not Encryption Encoding files is not encryption and should never be used to secure sensitive data on disk. Rather it is a useful way of transferring or storing large data in the form of a string. While it may obfuscate that actual data from should surfers, anyone who has access to base64 encoded data can easily decode it.

What is Base64 encoding in Kubernetes?

Base64 encoding and decoding data has many use cases. One being is ensuring data integrity when transferring data over the network, while another is storing Secrets in Kubernetes. After reading this tutorial you will understand how to easily encode files or strings, and then decode them back.

How do I convert a string to Base64?

cross-browser testing tools World's simplest base64 file encoder for web developers and programmers. Just select your file or drag & drop it below, press the Convert to Base64 button, and you'll get a base64 string. Press a button – get base64.


1 Answers

I tried the same and also had some issues when using openssl to perform the base64 encoding.

I believe this to be caused by the trailing % characters that openssl includes in the decoded base64 string, using something else to encode the keystore worked for me. For example, you can do

cat myKeystore.keystore | base64
like image 193
Marino Avatar answered Oct 16 '22 17:10

Marino