草庐IT

certInterface

全部标签

go - 使用 Go 从 PEM 格式的 Google "oauth2/v1/certs"证书中提取公钥

我从以下位置获取了Google证书:https://www.googleapis.com/oauth2/v1/certs但我不知道如何在Go中解析证书并提取公钥并使其适用于rsa.VerifyPKCS1v15()以验证IDtoken(openID连接)签名。如果有人可以建议我,我将不胜感激。这是我已有的代码:res,err:=http.Get("https://www.googleapis.com/oauth2/v1/certs")iferr!=nil{log.Fatal(err)return}certs,err:=ioutil.ReadAll(res.Body)res.Body.Cl

go - 使用 Go 从 PEM 格式的 Google "oauth2/v1/certs"证书中提取公钥

我从以下位置获取了Google证书:https://www.googleapis.com/oauth2/v1/certs但我不知道如何在Go中解析证书并提取公钥并使其适用于rsa.VerifyPKCS1v15()以验证IDtoken(openID连接)签名。如果有人可以建议我,我将不胜感激。这是我已有的代码:res,err:=http.Get("https://www.googleapis.com/oauth2/v1/certs")iferr!=nil{log.Fatal(err)return}certs,err:=ioutil.ReadAll(res.Body)res.Body.Cl