MCPcopy
hub / github.com/jsha/minica / calculateSKID

Function calculateSKID

main.go:225–241  ·  view source on GitHub ↗
(pubKey crypto.PublicKey)

Source from the content-addressed store, hash-verified

223}
224
225func calculateSKID(pubKey crypto.PublicKey) ([]byte, error) {
226 spkiASN1, err := x509.MarshalPKIXPublicKey(pubKey)
227 if err != nil {
228 return nil, err
229 }
230
231 var spki struct {
232 Algorithm pkix.AlgorithmIdentifier
233 SubjectPublicKey asn1.BitString
234 }
235 _, err = asn1.Unmarshal(spkiASN1, &spki)
236 if err != nil {
237 return nil, err
238 }
239 skid := sha1.Sum(spki.SubjectPublicKey.Bytes)
240 return skid[:], nil
241}
242
243func sign(iss *issuer, domains []string, ipAddresses []string, alg x509.PublicKeyAlgorithm) (*x509.Certificate, error) {
244 var cn string

Callers 1

makeRootCertFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…