()
| 172 | } |
| 173 | |
| 174 | func randomSerial() (*big.Int, error) { |
| 175 | limit := new(big.Int).Lsh(big.NewInt(1), 128) |
| 176 | n, err := rand.Int(rand.Reader, limit) |
| 177 | if err != nil { |
| 178 | return nil, fmt.Errorf("generate serial number: %w", err) |
| 179 | } |
| 180 | return n, nil |
| 181 | } |
| 182 | |
| 183 | // SignCSR signs the given PEM-encoded CSR producing a node client certificate |
| 184 | // whose CommonName is forced to nodeID. The CSR's self-reported subject is not |
no outgoing calls
no test coverage detected