반응형

 

□ base64 명령어  decoding, encoding 

## cat으로 certificate file 보면, decoding 된 data 확인

[node2 pki]$ cat front-proxy-ca.crt
-----BEGIN CERTIFICATE-----
MIIC7zCCAdegAwIBAgIBADANBgkqhkiG9w0BAQsFADAZMRcwFQYDVQQDEw5mcm9u
<중략>
-----END CERTIFICATE-----


## base64 실행하게되면 encoding된 data 확인
[node2 pki]$ cat front-proxy-ca.crt | base64
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUM3ekNDQWRlZ0F3SUJBZ0lCQURBTkJna3Fo
<중략>

 

□ base64  encoding data 한줄로 보기

  -w, --wrap=COLS       wrap encoded lines after COLS character (default 76).
                          Use 0 to disable line wrapping

위 내용 이해하려면 복잡하니깐,  "base64 -w 0" 쓰면 한줄로 나온다.

ex)  "base64 -w 0" 

##  base64 default명령어를 사용하면, 여러줄로 출력
[node2 pki]$ cat front-proxy-ca.crt | base64
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUM3ekNDQWRlZ0F3SUJBZ0lCQURBTkJna3Fo
a2lHOXcwQkFRc0ZBREFaTVJjd0ZRWURWUVFERXc1bWNtOXUKZEMxd2NtOTRlUzFqWVRBZUZ3MHlN
<중략>


## "-w 0" 옵션을 사용하여, 여러줄로 표시될 encoding data를 한줄로 볼수 있음

[node2 pki]$ cat front-proxy-ca.crt | base64 -w 0
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUM3ekNDQWRlZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFaTVJjd0ZRWURWUVFERXc1bWNtOXUKZEMxd2NtOTRlUzFqWVRBZUZ3MHlNekF4TWpjd01URTBNRFJhRncwek16QXhNalF3TVRFME1EUmFNQmt4RnpBVgpCZ05WQkFNVERtWnliMjUwTFhCeWIzaDVMV05oTUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCCkNnS0NBUUVBM0FvdkJHdit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XU4ZlFvcGVPVE5QZUsybUZKeGFIQ1JSTFRlYUZ3PQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
반응형

'OS > LINUX' 카테고리의 다른 글

[nfs] server not responding  (0) 2023.01.21
I/O Error 확인  (0) 2022.12.21
find 명령/옵션 팁  (0) 2022.12.16
/etc/group- , /etc/passwd- 파일생성  (0) 2018.08.07
gvfs  (0) 2018.01.17

+ Recent posts