示例#1
0
文件: info.go 项目: kisom/cfssl
func getInfoFromConfig(c cli.Config) (resp *info.Resp, err error) {
	s, err := sign.SignerFromConfig(c)
	if err != nil {
		return
	}

	req := new(info.Req)
	req.Label = c.Label
	req.Profile = c.Profile

	resp, err = s.Info(*req)
	if err != nil {
		return
	}

	return
}
示例#2
0
文件: info.go 项目: kisom/cfssl
func getInfoFromRemote(c cli.Config) (resp *info.Resp, err error) {
	req := new(info.Req)
	req.Label = c.Label
	req.Profile = c.Profile

	serv := client.NewServer(c.Remote)

	reqJSON, _ := json.Marshal(req)
	resp, err = serv.Info(reqJSON)
	if err != nil {
		return
	}

	_, err = helpers.ParseCertificatePEM([]byte(resp.Certificate))
	if err != nil {
		return
	}

	return
}