mirror of
https://github.com/Luzifer/go-openssl.git
synced 2024-12-21 03:11:18 +00:00
Update code example in README
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
0990dea461
commit
b97b103fdb
1 changed files with 4 additions and 4 deletions
|
@ -43,7 +43,7 @@ The usage is quite simple as you don't need any special knowledge about OpenSSL
|
||||||
```go
|
```go
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/Luzifer/go-openssl"
|
openssl "gopkg.in/Luzifer/go-openssl.v3"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@ -52,7 +52,7 @@ func main() {
|
||||||
|
|
||||||
o := openssl.New()
|
o := openssl.New()
|
||||||
|
|
||||||
enc, err := o.EncryptString(passphrase, plaintext)
|
enc, err := o.EncryptBytes(passphrase, []byte(plaintext), DigestSHA256Sum)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("An error occurred: %s\n", err)
|
fmt.Printf("An error occurred: %s\n", err)
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ func main() {
|
||||||
```go
|
```go
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/Luzifer/go-openssl"
|
openssl "gopkg.in/Luzifer/go-openssl.v3"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@ -75,7 +75,7 @@ func main() {
|
||||||
|
|
||||||
o := openssl.New()
|
o := openssl.New()
|
||||||
|
|
||||||
dec, err := o.DecryptString(passphrase, opensslEncrypted)
|
dec, err := o.DecryptBytes(passphrase, []byte(opensslEncrypted), DigestMD5Sum)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("An error occurred: %s\n", err)
|
fmt.Printf("An error occurred: %s\n", err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue