code: func KeyDigest(key crypto.PublicKey) (string, error) {
  	switch t := key.(type) {
  	case *jose.JSONWebKey:
  		if t == nil {
  			return "", fmt.Errorf("Cannot compute digest of nil key")
  		}
  		return KeyDigest(t.Key)
  	case jose.JSONWebKey:
  		return KeyDigest(t.Key)
  	default:
  		keyDER, err := x509.MarshalPKIXPublicKey(key)
  		if err != nil {
  			logger := blog.Get()
  			logger.Debugf("Problem marshaling public key: %s", err)
  			return "", err
  		}
  		spkiDigest := sha256.Sum256(keyDER)
  		return base64.StdEncoding.EncodeToString(spkiDigest[0:32]), nil
  	}
  }
docs: // KeyDigest produces a padded, standard Base64-encoded SHA256 digest of a
  // provided public key.