plugin/utils/utils_test.go

31 lines
665 B
Go

package utils
import (
"fmt"
"testing"
)
func Test_load(t *testing.T) {
got, err := Load("../../pkg")
if err != nil {
t.Errorf("load() error = %v", err)
return
}
fmt.Printf("%v \n", got)
fmt.Printf("%v \n", got[0])
}
func Test_BuildPem(t *testing.T) {
pri := NewPrivate(WithPemPriHeader(PemPrivateKHeader), WithPemPriFooter(PemPrivateKFooter))
t.Logf("\n%s", pri.Build("pri key 123456"))
puk := NewPublic(WithPemPukHeader(PemPublicHeader), WithPemPukFooter(PemPublicPuFooter))
t.Logf("\n%s", puk.Build("puk key 123456"))
pri2 := NewPrivate()
t.Logf("\n%s", pri2.Build("pri key"))
puk2 := NewPublic()
t.Logf("\n%s", puk2.Build("puk key"))
}