You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm writing a CGO code on Windows 10 but after I solved an error another one took place and I don't know what it is, how it happened or how to solve it. Someone knows how to fix it?
package main
import (
"fmt"
"github.com/miekg/pkcs11"
)
func main() {
p := pkcs11.New("aetpkss1.dll")
err := p.Initialize()
if err != nil {
panic(err)
}
defer p.Destroy()
defer p.Finalize()
slots, err := p.GetSlotList(true)
if err != nil {
panic(err)
}
session, err := p.OpenSession(slots[0], pkcs11.CKF_SERIAL_SESSION|pkcs11.CKF_RW_SESSION)
if err != nil {
panic(err)
}
defer p.CloseSession(session)
err = p.Login(session, pkcs11.CKU_USER, "1234")
if err != nil {
panic(err)
}
defer p.Logout(session)
p.DigestInit(session, []*pkcs11.Mechanism{pkcs11.NewMechanism(pkcs11.CKM_SHA_1, nil)})
hash, err := p.Digest(session, []byte("this is a string"))
if err != nil {
panic(err)
}
for _, d := range hash {
fmt.Printf("%x", d)
}
fmt.Println()
}
C:\Users\user\Desktop\Teste2> go run main.go
# runtime/cgo
cc1.exe: error: C:\src\github.com\miekg\pkcs11\pkcs11.h: not a directory [-Werror]
cc1.exe: all warnings being treated as errors
The text was updated successfully, but these errors were encountered:
I'm writing a CGO code on Windows 10 but after I solved an error another one took place and I don't know what it is, how it happened or how to solve it. Someone knows how to fix it?
The text was updated successfully, but these errors were encountered: