1
0
Fork 0
mirror of https://github.com/Luzifer/go-openssl.git synced 2024-12-20 19:01:18 +00:00

Update code example in README

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2018-11-02 12:54:45 +01:00
parent 0990dea461
commit b97b103fdb
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -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)
} }