code: func generateSubjectKeyID(pub crypto.PublicKey) ([]byte, error) {
  	var publicKeyBytes []byte
  	var err error
  
  	switch pub := pub.(type) {
  	case *rsa.PublicKey:
  		publicKeyBytes, err = asn1.Marshal(rsaPublicKey{N: pub.N, E: pub.E})
  		if err != nil {
  			return nil, err
  		}
  	case *ecdsa.PublicKey:
  		publicKeyBytes = elliptic.Marshal(pub.Curve, pub.X, pub.Y)
  	default:
  		return nil, errors.New("only RSA and ECDSA public keys supported")
  	}
  
  	hash := sha1.Sum(publicKeyBytes)
  	return hash[:], nil
  }
docs: // generateSubjectKeyID generates a SHA-1 hash of the subject public key.