File tree 1 file changed +37
-5
lines changed 1 file changed +37
-5
lines changed Original file line number Diff line number Diff line change @@ -17,11 +17,6 @@ openssl rsa -in private.pem -out public.pem -pubout -outform PEM
17
17
``` go
18
18
package main
19
19
20
- import (
21
- " fmt"
22
- " github.com/vspaz/rsa-encrypt-decrypt-golang/pkg/cryptolib"
23
- )
24
-
25
20
const (
26
21
testPrivateKey = ` -----BEGIN RSA PRIVATE KEY-----
27
22
MIIEowIBAAKCAQEAxGDcSAjiHKP9v2ITR+BjQmt9Tx2zW08ZyrjOxPew+Gxl2m5z
@@ -63,6 +58,7 @@ bQIDAQAB
63
58
`
64
59
)
65
60
```
61
+
66
62
``` go
67
63
package main
68
64
@@ -143,4 +139,40 @@ func rsaEncryptDecryptAndBase64Encode() {
143
139
}
144
140
```
145
141
142
+ ``` go
143
+ package main
144
+
145
+ import (
146
+ " github.com/vspaz/rsa-encrypt-decrypt-golang/pkg/cryptolib"
147
+ " log"
148
+ )
149
+
150
+ func encodeDecodeWithBase85 () {
151
+ expectedText := " foo"
152
+ encodedText := cryptolib.Encoder {}.ToBase85 ([]byte (expectedText))
153
+ actualText := string (cryptolib.Decoder {}.FromBase85 (encodedText))
154
+ if actualText != expectedText {
155
+ log.Fatal (" failed to decode" )
156
+ }
157
+ }
158
+ ```
159
+
160
+ ``` go
161
+ package main
162
+
163
+ import (
164
+ " github.com/vspaz/rsa-encrypt-decrypt-golang/pkg/cryptolib"
165
+ " log"
166
+ )
167
+
168
+ func encodeDecodeWithBase64 () {
169
+ expectedText := " foo"
170
+ encodedText := cryptolib.Encoder {}.ToBase64 ([]byte (expectedText))
171
+ actualText := string (cryptolib.Decoder {}.FromBase64 (encodedText))
172
+ if actualText != expectedText {
173
+ log.Fatal (" failed to decode" )
174
+ }
175
+ }
176
+ ```
177
+
146
178
** NOTE** : please refer to [ rsa-encrypt-decrypt-python] ( https://github.com/vspaz/rsa-encrypt-decrypt-python ) if you need the Python lib.
You can’t perform that action at this time.
0 commit comments