func ReadKeyRing(r io.Reader) (el EntityList, err error) {
	packets := packet.NewReader(r)
	var lastUnsupportedError error

	for {
		var e *Entity
		e, err = ReadEntity(packets)
		if err != nil {
			// TODO: warn about skipped unsupported/unreadable keys
			if _, ok := err.(errors.UnsupportedError); ok {
				lastUnsupportedError = err
				err = readToNextPublicKey(packets)
			} else if _, ok := err.(errors.StructuralError); ok {
				// Skip unreadable, badly-formatted keys
				lastUnsupportedError = err
				err = readToNextPublicKey(packets)
			}
			if err == io.EOF {
				err = nil
				break
			}
			if err != nil {
				el = nil
				break
			}
		} else {
			el = append(el, e)
		}
	}

	if len(el) == 0 && err == nil {
		err = lastUnsupportedError
	}
	return
}
// ReadKeyRing reads one or more public/private keys. Unsupported keys are
// ignored as long as at least a single valid key is found.
ReadKeyRing reads one or more public/private keys. Unsupported keys are
ignored as long as at least a single valid key is found.
// ReadKeyRing reads one or more public / private keys . Unsupported keys are // ignored as long as at least a single valid key is found .
func ReadKeyRing(r io.Reader) (el EntityList, err error) {
	packets := packet.NewReader(r)
	var lastUnsupportedError error
	for {
		var e *Entity
		e, err = ReadEntity(packets)
		if err != nil {
			if _, ok := err.(errors.UnsupportedError); ok {
				lastUnsupportedError = err
				err = readToNextPublicKey(packets)
			} else if _, ok := err.(errors.StructuralError); ok {
				lastUnsupportedError = err
				err = readToNextPublicKey(packets)
			}
			if err == io.EOF {
				err = nil
				break
			}
			if err != nil {
				el = nil
				break
			}
		} else {
			el = append(el, e)
		}
	}
	if len(el) == 0 && err == nil {
		err = lastUnsupportedError
	}
	return
}
func ReadKeyRing ( r io . Reader ) ( el EntityList , err error ) { packets := packet . NewReader ( r ) var lastUnsupportedError error for { var e * Entity e , err = ReadEntity ( packets ) if err != nil { if _ , ok := err . ( errors . UnsupportedError ) ; ok { lastUnsupportedError = err err = readToNextPublicKey ( packets ) } else if _ , ok := err . ( errors . StructuralError ) ; ok { lastUnsupportedError = err err = readToNextPublicKey ( packets ) } if err == io . EOF { err = nil break } if err != nil { el = nil break } } else { el = append ( el , e ) } } if len ( el ) == 0 && err == nil { err = lastUnsupportedError } return }
ReadKeyRing reads one or more public/private keys.
ReadKeyRing reads one or more public / private keys .
// TODO: warn about skipped unsupported/unreadable keys // Skip unreadable, badly-formatted keys