Skip to content

Commit

Permalink
Fix pem tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenvegt committed Dec 13, 2024
1 parent 5fa345a commit a376d16
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pem/pem_reader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ package pem

import (
"encoding/base64"
"github.com/nuts-foundation/uzi-did-x509-issuer/x509_cert"
"github.com/stretchr/testify/assert"
"log"
"os"
"strings"
"testing"

"github.com/nuts-foundation/uzi-did-x509-issuer/did_x509"
"github.com/nuts-foundation/uzi-did-x509-issuer/x509_cert"
"github.com/stretchr/testify/assert"
)

func TestParseFileOrPath(t *testing.T) {
Expand Down Expand Up @@ -112,13 +114,13 @@ func TestParseFileOrPath(t *testing.T) {
dataMap := make(map[string][]byte)
for i := 0; i < len(data); i++ {
bytes := (data)[i]
hash, err := x509_cert.Hash(bytes, "sha512")
hash, err := did_x509.Hash(bytes, "sha512")
failError(t, err)
dataMap[base64.RawURLEncoding.EncodeToString(hash)] = bytes
}
for i := 0; i < len(certs); i++ {
bytes := (certs)[i].Raw
hash, err := x509_cert.Hash(bytes, "sha512")
hash, err := did_x509.Hash(bytes, "sha512")
failError(t, err)
fileBytes := dataMap[base64.RawURLEncoding.EncodeToString(hash)]
ok := assert.Equal(t, bytes, fileBytes)
Expand Down

0 comments on commit a376d16

Please sign in to comment.