Skip to content
This repository has been archived by the owner on Mar 13, 2019. It is now read-only.

panic: interface conversion: interface is ed25519.PublicKey, not []uint8 #3

Open
stevenroose opened this issue Dec 10, 2016 · 0 comments

Comments

@stevenroose
Copy link

I'm trying to encode an ed25519.PublicKey (type PublicKey []byte) and I get the following panic.

For some reason, asn1 seems to expect a []uint8 and does not accept a []byte.

panic: interface conversion: interface is ed25519.PublicKey, not []uint8

goroutine 1 [running]:
panic(0x4c0160, 0xc420016140)
	/usr/lib/go/src/runtime/panic.go:500 +0x1a1
github.com/PromonLogicalis/asn1.(*Context).encodeOctetString(0xc42000e4e0, 0x4bdb00, 0xc42000e4c0, 0x97, 0x40e518, 0x30, 0x4cb5e0, 0x1, 0xc420010420)
	/home/steven/gocode/src/github.com/PromonLogicalis/asn1/types.go:188 +0x273
github.com/PromonLogicalis/asn1.(*Context).(github.com/PromonLogicalis/asn1.encodeOctetString)-fm(0x4bdb00, 0xc42000e4c0, 0x97, 0x4bfaa0, 0x4bdb00, 0x0, 0x0, 0x0)
	/home/steven/gocode/src/github.com/PromonLogicalis/asn1/encode.go:127 +0x48
github.com/PromonLogicalis/asn1.(*Context).encodeValue(0xc42000e4e0, 0x4bdb00, 0xc42000e4c0, 0x97, 0xc42000e500, 0x1, 0x1, 0x1)
	/home/steven/gocode/src/github.com/PromonLogicalis/asn1/encode.go:139 +0x131
github.com/PromonLogicalis/asn1.(*Context).encode(0xc42000e4e0, 0x4bdb00, 0xc42000e4c0, 0x97, 0xc42000e500, 0x30, 0x0, 0x556c01)
	/home/steven/gocode/src/github.com/PromonLogicalis/asn1/encode.go:59 +0xd5
github.com/PromonLogicalis/asn1.(*Context).EncodeWithOptions(0xc42000e4e0, 0x4bdb00, 0xc42000e4c0, 0x0, 0x0, 0xc42000e4c0, 0x18, 0x18, 0x1ce8e2fed22701, 0xc42000e4c0)
	/home/steven/gocode/src/github.com/PromonLogicalis/asn1/encode.go:28 +0xa4
github.com/PromonLogicalis/asn1.Encode(0x4bdb00, 0xc42000e4c0, 0xc42000e4c0, 0x4bdb00, 0xc42000e4c0, 0xc420016100, 0x40)
	/home/steven/gocode/src/github.com/PromonLogicalis/asn1/asn1.go:42 +0x191
main.main()
	/home/steven/gocode/src/github.com/me/repo/main.go:18 +0x1cc
exit status 2
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant