handleCertificateGeneration takes a JWT and uses it build a signPayload to send to the Sign endpoint with the public key from the keypair it generated
(token, fullName string)
| 77 | // handleCertificateGeneration takes a JWT and uses it build a signPayload |
| 78 | // to send to the Sign endpoint with the public key from the keypair it generated |
| 79 | func handleCertificateGeneration(token, fullName string) (string, error) { |
| 80 | pub, err := generateKeyPair(fullName) |
| 81 | if err != nil { |
| 82 | return "", err |
| 83 | } |
| 84 | |
| 85 | return SignCert(token, string(pub)) |
| 86 | } |
| 87 | |
| 88 | func SignCert(token, pubKey string) (string, error) { |
| 89 | if token == "" { |
no test coverage detected