func publicJWKSFromKeys(in []interface{}) (*jose.JSONWebKeySet, errors.Aggregate) {
	// Decode keys into a JWKS.
	var keys jose.JSONWebKeySet
	var errs []error
	for i, key := range in {
		var pubkey *jose.JSONWebKey
		var err error

		switch k := key.(type) {
		case publicKeyGetter:
			// This is a private key. Get its public key
			pubkey, err = jwkFromPublicKey(k.Public())
		default:
			pubkey, err = jwkFromPublicKey(k)
		}
		if err != nil {
			errs = append(errs, fmt.Errorf("error constructing JWK for key #%d: %v", i, err))
			continue
		}

		if !pubkey.Valid() {
			errs = append(errs, fmt.Errorf("key #%d not valid", i))
			continue
		}
		keys.Keys = append(keys.Keys, *pubkey)
	}
	if len(errs) != 0 {
		return nil, errors.NewAggregate(errs)
	}
	return &keys, nil
}
// publicJWKSFromKeys constructs a JSONWebKeySet from a list of keys. The key
// set will only contain the public keys associated with the input keys.
publicJWKSFromKeys constructs a JSONWebKeySet from a list of keys. The key
set will only contain the public keys associated with the input keys.
// publicJWKSFromKeys constructs a JSONWebKeySet from a list of keys . The key // set will only contain the public keys associated with the input keys .
func publicJWKSFromKeys(in []interface{}) (*jose.JSONWebKeySet, errors.Aggregate) {
	var keys jose.JSONWebKeySet
	var errs []error
	for i, key := range in {
		var pubkey *jose.JSONWebKey
		var err error
		switch k := key.(type) {
		case publicKeyGetter:
			pubkey, err = jwkFromPublicKey(k.Public())
		default:
			pubkey, err = jwkFromPublicKey(k)
		}
		if err != nil {
			errs = append(errs, fmt.Errorf("error constructing JWK for key #%d: %v", i, err))
			continue
		}
		if !pubkey.Valid() {
			errs = append(errs, fmt.Errorf("key #%d not valid", i))
			continue
		}
		keys.Keys = append(keys.Keys, *pubkey)
	}
	if len(errs) != 0 {
		return nil, errors.NewAggregate(errs)
	}
	return &keys, nil
}
func publicJWKSFromKeys ( in [ ] interface { } ) ( * jose . JSONWebKeySet , errors . Aggregate ) { var keys jose . JSONWebKeySet var errs [ ] error for i , key := range in { var pubkey * jose . JSONWebKey var err error switch k := key . ( type ) { case publicKeyGetter : pubkey , err = jwkFromPublicKey ( k . Public ( ) ) default : pubkey , err = jwkFromPublicKey ( k ) } if err != nil { errs = append ( errs , fmt . Errorf ( " " , i , err ) ) continue } if ! pubkey . Valid ( ) { errs = append ( errs , fmt . Errorf ( " " , i ) ) continue } keys . Keys = append ( keys . Keys , * pubkey ) } if len ( errs ) != 0 { return nil , errors . NewAggregate ( errs ) } return & keys , nil }
publicJWKSFromKeys constructs a JSONWebKeySet from a list of keys.
publicJWKSFromKeys constructs a JSONWebKeySet from a list of keys .
// Decode keys into a JWKS. // This is a private key. Get its public key