You are trying to read a certificate with a function intended for
reading a public key.
Use x509.ParseCertificates instead.
Janne Snabb
sn...@epipe.com
On 2017-03-06 16:39, 0x7bc77a wrote:
> Hi,
>
> I would like to load the public key from a DER encoded certificate
>
> Here is my code
>
> fu
Hi,
I would like to load the public key from a DER encoded certificate
Here is my code
func ExampleParsePKIXPublicKey() {
raw, err := ioutil.ReadFile("/Path/To/DER/Encoded/Certificate")
if err != nil {
panic("failed to read certificate" + err.Error())
}
pub, err := x509.ParsePKIXPublicKey(raw)